cool-easter-32542
06/28/2023, 8:44 PMCPython<3.10,>=3.7.
$ pants test ::
<truncated>
16:35:02.78 [ERROR] 1 Exception encountered:
Engine traceback:
in `test` goal
InvalidLockfileError: You are consuming `pdbpp`, `pygments`, and 3 other requirements from the `python-default` lockfile at 3rdparty/python/default.lock with incompatible inputs.
- The inputs use interpreter constraints (`CPython<3.10,>=3.7`) that are not a subset of those used to generate the lockfile (`CPython>=3.8`).
- The input interpreter constraints are specified by your code, using the `[python].interpreter_constraints` option and the `interpreter_constraints` target field.
- To create a lockfile with new interpreter constraints, update the option `[python].resolves_to_interpreter_constraints`, and then generate the lockfile (see below).
See <https://www.pantsbuild.org/v2.16/docs/python-interpreter-compatibility> for details.
To regenerate your lockfile, run `pants generate-lockfiles --resolve=python-default`.
See <https://www.pantsbuild.org/v2.16/docs/python-third-party-dependencies> for details.
16:35:02.87 [INFO] Canceled: Building 3 requirements for requirements.pex from the 3rdparty/python/default.lock resolve: decorator<6,>=5.1.1, python-dateutil<3,>=2.8.1, requests<3.0.0,>=2.26.0
Subset of my pants.toml:
[python]
enable_resolves = true
default_resolve = "python-default"
interpreter_constraints = [">=3.8"]
[python.resolves]
pants-plugins = "pants-plugins/lock.txt"
python-default = "3rdparty/python/default.lock"
[python.resolves_to_interpreter_constraints]
pants-plugins = ["CPython>=3.7,<3.10"]
[pytest]
install_from_resolve = "python-default"
requirements = [
"//3rdparty/python#pytest",
"//3rdparty/python#pygments",
"//3rdparty/python#pytest-icdiff",
"//3rdparty/python#pytest-mock",
"//3rdparty/python#pdbpp",
]
execution_slot_var = "PANTS_EXECUTION_SLOT"
Pants version
2.16.0
OS
Linux (can try and reproduce on macOS if needed).
Additional Info
If I generate a separate pytest lockfile, then the pytest.lock uses my default IC and pants test doesn't complain about conflicting constraints. That makes me think I did something wrong, but it's not clear to me what that is.
pantsbuild/pants