purple-umbrella-89891
11/17/2022, 3:44 PMpants.toml
so that e.g. pytest
uses the python-default.lock
file and I get an error because the lockfile includes more packages, although there are no conflicts. Setting --python-invalid-lockfile-behavior=ignore
does work, but it would miss any conflicts or missing packages.
Any good/elegant ideas getting around this?
PS. Here is the error:
16:21:43.92 [ERROR] 1 Exception encountered:
InvalidLockfileError: You are using the lockfile at pants.lock to install the tool `pytest`, but it is not compatible with your configuration:
- You have set different requirements than those used to generate the lockfile. You can fix this by updating `[pytest].version` and/or `[pytest].extra_requirements`, or by using a new custom lockfile.
In the lockfile, but not in the input requirements: [...lots of unrelated dependencies...]
To regenerate your lockfile based on your current configuration, run `./pants generate-lockfiles --resolve=pytest`.
curved-television-6568
11/17/2022, 3:48 PMdep >= x.y
or so in your requirements.
https://www.pantsbuild.org/docs/reference-python#resolves_to_constraints_file
# pants.toml
[python.resolves_to_constraints_file]
__default__ = "some/constraints.txt"
purple-umbrella-89891
11/17/2022, 3:51 PMhundreds-father-404
11/17/2022, 4:39 PM./pants generate_lockfiles
purple-umbrella-89891
11/17/2022, 4:44 PM