future-oxygen-10553
04/20/2023, 12:29 PMpytest==7.2.2
pytest-cov==4.0.0
pytest-xdist==3.2.1
and my pants.toml
...
[python.resolves]
python-default = "3rdparty/python-lock.txt"
dev = "utils/lock.txt"
...
[pytest]
args = ["--no-header", "-vv"]
install_from_resolve = "dev"
However, running pants test ::
gives me
1. /opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/bin/python3.10:
Failed to resolve all requirements for cp310-cp310-macosx_13_0_arm64 interpreter at /opt/homebrew/Cellar/python@3.10/3.10.11/Frameworks/Python.framework/Versions/3.10/bin/python3.10 from utils/lock.txt:
Configured with:
build: True
use_wheel: True
Dependency on pytest-cov not satisfied, 1 incompatible candidate found:
1.) pytest-cov 4 does not satisfy the following requirements:
!=2.12.1,<3.1,>=2.12 (via: pytest-cov!=2.12.1,<3.1,>=2.12)
Dependency on pytest-xdist not satisfied, 1 incompatible candidate found:
1.) pytest-xdist 3.2.1 does not satisfy the following requirements:
<3,>=2.5 (via: pytest-xdist<3,>=2.5)
Dependency on pytest not satisfied, 1 incompatible candidate found:
1.) pytest 7.2.2 does not satisfy the following requirements:
==7.0.1 (via: pytest==7.0.1)
Those versions are indeed hard-coded in the pytest subsystem, but the docs say that the method I’m trying is the right way to override thingssparse-lifeguard-95737
04/20/2023, 12:50 PM[pytest].requirements
(there are some hard-coded default requirements as a sanity-check). in my repo I have:
[pytest]
requirements = [
"pytest",
"pytest-cov",
"pytest-xdist",
]
which effectively disables any additional version-checking, so whatever’s in the lockfile is always validfuture-oxygen-10553
04/20/2023, 12:57 PMfuture-oxygen-10553
04/20/2023, 1:06 PMhappy-kitchen-89482
04/20/2023, 1:26 PMfuture-oxygen-10553
04/20/2023, 3:04 PMpants.toml
example that you can replace requirements
instead of `.add`ing to it. However, the pytest-requirements.txt
example just below that includes pytest
, pytest-cov
, and pytest-xdist
. Based on my experience in this thread, I’m pretty sure that example would fail with the message in the OP. Should I remove the default requirements from that example requirements.txt and add another one to show how to replace pytest itself?happy-kitchen-89482
04/20/2023, 3:05 PMfuture-oxygen-10553
04/20/2023, 3:06 PMfuture-oxygen-10553
04/20/2023, 3:06 PMhappy-kitchen-89482
04/20/2023, 3:11 PMhappy-kitchen-89482
04/20/2023, 3:13 PMhappy-kitchen-89482
04/20/2023, 3:15 PMhappy-kitchen-89482
04/20/2023, 3:16 PMrequirements
thing functions as a warning, to say "Pants doesn't know if it can work with this version". But maybe this is over-nannyingfuture-oxygen-10553
04/21/2023, 2:51 PMhappy-kitchen-89482
04/21/2023, 3:21 PMfuture-oxygen-10553
04/21/2023, 3:42 PMfuture-oxygen-10553
04/21/2023, 5:06 PM