ambitious-student-81104
01/11/2022, 2:38 AMexperimental_resolves_to_lockfiles = { default = "constraints.txt"}
. I have a few different requirements.txt files, say **/requirements.txt
. How do I let pants auto-generate my lockfile based on the requirements files?ambitious-student-81104
01/11/2022, 2:47 PMhappy-kitchen-89482
01/11/2022, 6:06 PMwitty-crayon-22786
01/11/2022, 6:19 PM2.10.x
.
to generate a lockfile once you’ve set that, you’d use ./pants generate-user-lockfile
ambitious-student-81104
01/11/2022, 6:34 PMconstraints.txt
file every now and then, no fixed refresh policy.witty-crayon-22786
01/11/2022, 6:34 PM./pants generate-user-lockfile
replaces the need to manually create a lockfilewitty-crayon-22786
01/11/2022, 6:35 PMambitious-student-81104
01/11/2022, 6:35 PM❯ ./pants generate-user-lockfile
13:35:17.45 [INFO] Initializing scheduler...
13:35:17.67 [INFO] Scheduler initialized.
Unknown goal: generate-user-lockfile
Did you mean generate-lockfiles?
ambitious-student-81104
01/11/2022, 6:35 PMwitty-crayon-22786
01/11/2022, 6:35 PMwitty-crayon-22786
01/11/2022, 6:35 PMwitty-crayon-22786
01/11/2022, 6:36 PMpants.backend.experimental.python
backend to pants.toml
ambitious-student-81104
01/11/2022, 6:38 PM❯ ./pants generate-user-lockfile
13:37:48.01 [INFO] Initializing scheduler...
13:37:48.23 [INFO] Scheduler initialized.
13:37:48.29 [WARN] No third-party requirements found for the transitive closure, so a lockfile will not be generated.
Where do I configure the places that it needs to look for **/requirements.txt
?ambitious-student-81104
01/11/2022, 6:38 PMexperimental_lockfile ="constraints.txt"
ambitious-student-81104
01/11/2022, 6:38 PM**/requirements.txt
which yielded the same output.witty-crayon-22786
01/11/2022, 6:47 PMdefault
witty-crayon-22786
01/11/2022, 6:48 PM2.10.x
, sorry)witty-crayon-22786
01/11/2022, 6:50 PM2.8.x
, you actually have to specify the set of targets to include in the lockfile. so something like ./pants generate-user-lockfile ::
happy-kitchen-89482
01/11/2022, 6:51 PMpython_requirements
target for each requirements.txt
happy-kitchen-89482
01/11/2022, 6:58 PM./pants tailor
should generate those for you if it hasn't alreadyambitious-student-81104
01/11/2022, 6:59 PM3rdparty/
subdir/
BUILD (with python_requirements(module_mapping={...}))
requirements.txt
ambitious-student-81104
01/11/2022, 7:01 PM--extra-index internal_pypi_address
already.witty-crayon-22786
01/11/2022, 7:02 PMwitty-crayon-22786
01/11/2022, 7:03 PMpoetry
, but afaik, it doesn’t support custom non-pypi indexeswitty-crayon-22786
01/11/2022, 7:03 PMhundreds-father-404
01/13/2022, 9:50 PM[python].experimental_lockfile
which you can generate via generate-user-lockfile
or manually if you'd like
2. [python].experimental_resolve_to_lockfiles
, which is not really set up to work in Pants 2.8 and 2.9 - only some basic infrastructure was added. Hoping to stabilize in Pants 2.10ambitious-student-81104
01/14/2022, 7:34 PMhundreds-father-404
01/14/2022, 7:35 PMwitty-crayon-22786
01/14/2022, 7:36 PM