Hey! These docs are for version 2.8, which is no longer officially supported. Click here for the latest version, 2.11!

generate-lockfiles

./pants generate-lockfiles [args]

Generate lockfiles for Python third-party dependencies.

Config section: [generate-lockfiles]

Basic options

resolve

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

Only generate lockfiles for the specified resolve(s).

Resolves are the logical names for the different lockfiles used in your project. For your own code's dependencies, these come from the option [python].experimental_resolves_to_lockfiles. For tool lockfiles, resolve names are the options scope for that tool such as black, pytest, and mypy-protobuf.

For example, you can run ./pants generate-lockfiles --resolve=black --resolve=pytest --resolve=data-science to only generate lockfiles for those two tools and your resolve named data-science.

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

If not specified, Pants will generate lockfiles for all resolves.


Advanced options

custom_command

--generate-lockfiles-custom-command=<str>
PANTS_GENERATE_LOCKFILES_CUSTOM_COMMAND
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

Related subsystems

download-pex-bin, pex, poetry, python, python-native-code, python-repos, subprocess-environment


Did this page help you?