Skip to main content
Version: 2.7 (deprecated)

generate-lockfiles


pants generate-lockfiles [args]

Generate lockfiles for Python third-party dependencies.

Backend: ``

Config section: [generate-lockfiles]

Basic options

resolve

--generate-lockfiles-resolve="['<str>', '<str>', ...]"
PANTS_GENERATE_LOCKFILES_RESOLVE
pants.toml
[generate-lockfiles]
resolve = [
'<str>',
'<str>',
...,
]
default: []

Only generate lockfiles for the specified resolve(s).

For now, resolves are the options scope for each Python tool that supports lockfiles, such as black, pytest, and mypy-protobuf. For example, you can run ./pants generate-lockfiles --resolve=black --resolve=pytest to only generate the lockfile for those two tools.

If you specify an invalid resolve name, like 'fake', Pants will output all possible values.

If not specified, Pants will generate for all resolves.

Advanced options

custom_command

--generate-lockfiles-custom-command=<str>
PANTS_GENERATE_LOCKFILES_CUSTOM_COMMAND
pants.toml
[generate-lockfiles]
custom_command = <str>
default: None

If set, lockfile headers will say to run this command to regenerate the lockfile, rather than running ./pants generate-lockfiles --resolve=<name> like normal.

Deprecated options

None