lively-gpu-26436
04/25/2023, 3:37 PM2.16rc1
version and I wonder if I have run into a bug. I’m telling pytest to install from a resolve:
pants.toml
[python.resolves]
...
pytest = "resolves/pytest.lock"
[python.resolves_to_interpreter_constraints]
pytest= [">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*"]
[pytest]
install_from_resolve = "pytest"
and the corresponding lock file contains the versions specified in the requirements:
resolves/pytest.lock
// "version": 3,
// "valid_for_interpreter_constraints": [
// "CPython!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7"
// ],
// "generated_with_requirements": [
// "future==0.18.3",
// "pytest-cov!=2.12.1,<3.1,>=2.12",
// "pytest-xdist>=1",
// "pytest==4.6.11"
// ],
yet, when running pants test ...
it seems to be ignoring the lock file and using the default one that ships with pants (pytest-cov>=2.12,!=2.12.1,<3.1, pytest-xdist>=2.5,<3, pytest==7.0.1
):
17:30:15.95 [INFO] Completed: Building 3 requirements for pytest.pex from the resolves/pytest.lock resolve: pytest-cov>=2.12,!=2.12.1,<3.1, pytest-xdist>=2.5,<3, pytest==7.0.1
17:30:15.95 [INFO] Canceled: Building requirements.pex
17:30:15.95 [ERROR] 1 Exception encountered:
Engine traceback:
in `test` goal
ProcessExecutionFailure: Process 'Building 3 requirements for pytest.pex from the resolves/pytest.lock resolve: pytest-cov>=2.12,!=2.12.1,<3.1, pytest-xdist>=2.5,<3, pytest==7.0.1' failed with exit code 1.
...
I have tried using another name for my resolve and lockfile but it hasn’t workedhappy-kitchen-89482
04/25/2023, 3:48 PM[pytest]
in your pants.toml?lively-gpu-26436
04/25/2023, 3:49 PM[pytest]
install_from_resolve = "pytest"
xdist_enabled = false
happy-kitchen-89482
04/25/2023, 3:51 PM[pytest.requirements]
# List the (possibly versionless) requirements that should be taken from the lockfile.
happy-kitchen-89482
04/25/2023, 3:52 PMhappy-kitchen-89482
04/25/2023, 3:53 PMenough-analyst-54434
04/25/2023, 3:53 PMhappy-kitchen-89482
04/25/2023, 3:53 PMhappy-kitchen-89482
04/25/2023, 3:55 PMenough-analyst-54434
04/25/2023, 3:55 PMlively-gpu-26436
04/25/2023, 3:56 PMenough-analyst-54434
04/25/2023, 4:00 PMtool>=X
where X was the oldest version to have all the features Pants is using and then apply that:
$ pex3 lock create "ansicolors<1.1.8" -olock.json
$ pex --lock lock.json "ansicolors>=1.1.8" -- -c 'import colors; print(colors.__file__)'
Failed to resolve compatible artifacts from lock lock.json for 1 target:
1. /home/jsirois/bin/pex.venv/bin/python:
Failed to resolve all requirements for cp310-cp310-manylinux_2_35_x86_64 interpreter at /home/jsirois/bin/pex.venv/bin/python from lock.json:
Configured with:
build: True
use_wheel: True
Dependency on ansicolors not satisfied, 1 incompatible candidate found:
1.) ansicolors 1.1.7 does not satisfy the following requirements:
>=1.1.8 (via: ansicolors>=1.1.8)
enough-analyst-54434
04/25/2023, 4:01 PMlively-gpu-26436
04/25/2023, 4:02 PMenough-analyst-54434
04/25/2023, 4:02 PMenough-analyst-54434
04/25/2023, 4:03 PMenough-analyst-54434
04/25/2023, 4:04 PMenough-analyst-54434
04/25/2023, 4:04 PMenough-analyst-54434
04/25/2023, 4:04 PMlively-gpu-26436
04/25/2023, 4:07 PMhappy-kitchen-89482
04/25/2023, 8:13 PM