Skip to content

Commit 2bb342b

Browse files
authored
tests: fix tox min job (#870)
* tests: fix tox min job Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * tests: pytest-cov -> coverage conversion Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> * Revert "tests: pytest-cov -> coverage conversion" This reverts commit 54a336f. * tests: avoid error if only a single run was run Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com> --------- Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
1 parent 19832b8 commit 2bb342b

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

pyproject.toml

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ test = [
6363
'setuptools >= 56.0.0; python_version == "3.10"',
6464
'setuptools >= 56.0.0; python_version == "3.11"',
6565
'setuptools >= 67.8.0; python_version >= "3.12"',
66+
"setuptools_scm >= 6",
6667
]
6768
typing = [
6869
"build[uv]",

tests/conftest.py

+6
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ def local_pip(monkeypatch):
7878
monkeypatch.setattr(build.env._PipBackend, '_has_valid_outer_pip', None)
7979

8080

81+
@pytest.fixture(autouse=True)
82+
def avoid_constraints(monkeypatch):
83+
monkeypatch.delenv('PIP_CONSTRAINT', raising=False)
84+
monkeypatch.delenv('UV_CONSTRAINT', raising=False)
85+
86+
8187
@pytest.fixture(autouse=True, params=[False])
8288
def has_virtualenv(request, monkeypatch):
8389
if request.param is not None:

tests/constraints.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
importlib-metadata==4.6
2-
packaging==19.1
2+
packaging==20.0; python_version < "3.12"
3+
packaging==19.1; python_version >= "3.12"
34
pyproject_hooks==1.0
45
setuptools==42.0.0; python_version < "3.10"
56
setuptools==56.0.0; python_version == "3.10"
67
setuptools==56.0.0; python_version == "3.11"
78
setuptools==67.8.0; python_version >= "3.12"
9+
setuptools_scm==6.3.1; python_version < "3.12"
810
tomli==1.1.0
911
# virtualenv==20.0.35
1012
wheel==0.36.0

tox.ini

+6-4
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ skip_missing_interpreters = true
1313
[testenv]
1414
description =
1515
run test suite with {basepython}
16+
deps =
17+
pip
1618
extras =
1719
test
1820
pass_env =
@@ -71,9 +73,9 @@ commands_pre =
7173

7274
[testenv:{py313, py312, py311, py310, py39, py38, pypy38, pypy39, pypy310}-min]
7375
description = check minimum versions required of all dependencies
74-
skip_install = true
75-
commands_pre =
76-
pip install .[test] -c tests/constraints.txt
76+
set_env =
77+
PIP_CONSTRAINT = {toxinidir}/tests/constraints.txt
78+
UV_CONSTRAINT = {toxinidir}/tests/constraints.txt
7779

7880
[testenv:dev]
7981
description = generate a DEV environment
@@ -98,7 +100,7 @@ pass_env =
98100
DIFF_AGAINST
99101
set_env =
100102
commands =
101-
coverage combine {toxworkdir}
103+
- coverage combine {toxworkdir}
102104
coverage report --skip-covered --show-missing -i
103105
coverage xml -o {toxworkdir}/coverage.xml -i
104106
coverage html -d {toxworkdir}/htmlcov -i

0 commit comments

Comments
 (0)