Skip to content

Commit 025c236

Browse files
committed
Include tox-extra and tox-uv when testing
1 parent 25143c7 commit 025c236

File tree

4 files changed

+37
-15
lines changed

4 files changed

+37
-15
lines changed

.config/constraints.txt

+12-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ astroid==3.3.8 # via pylint
55
attrs==25.1.0 # via jsonschema, referencing
66
babel==2.16.0 # via mkdocs-material
77
beautifulsoup4==4.12.3 # via linkchecker, mkdocs-htmlproofer-plugin
8+
bindep==2.12.0 # via tox-extra
89
black==25.1.0 # via tox-ansible (pyproject.toml)
910
cachetools==5.5.1 # via tox
1011
cairocffi==1.7.1 # via cairosvg
@@ -23,12 +24,15 @@ cssselect2==0.7.0 # via cairosvg
2324
defusedxml==0.7.1 # via cairosvg
2425
dill==0.3.9 # via pylint
2526
distlib==0.3.9 # via virtualenv
27+
distro==1.9.0 # via bindep
2628
dnspython==2.7.0 # via linkchecker
2729
docstring-parser-fork==0.0.12 # via pydoclint
2830
exceptiongroup==1.2.2 # via pytest
2931
execnet==2.1.1 # via pytest-xdist
3032
filelock==3.17.0 # via tox, virtualenv
3133
ghp-import==2.1.0 # via mkdocs
34+
gitdb==4.0.12 # via gitpython
35+
gitpython==3.1.44 # via tox-extra
3236
griffe==1.5.5 # via mkdocstrings-python
3337
hjson==3.1.0 # via mkdocs-macros-plugin, super-collections
3438
htmlmin2==0.1.13 # via mkdocs-minify-plugin
@@ -63,9 +67,11 @@ mkdocstrings-python==1.13.0 # via mkdocs-ansible
6367
mypy==1.14.1 # via tox-ansible (pyproject.toml)
6468
mypy-extensions==1.0.0 # via black, mypy
6569
nodeenv==1.9.1 # via pre-commit
66-
packaging==24.2 # via ansible-compat, ansible-core, black, mkdocs, mkdocs-macros-plugin, pyproject-api, pytest, pytest-ansible, tox
70+
packaging==24.2 # via ansible-compat, ansible-core, bindep, black, mkdocs, mkdocs-macros-plugin, pyproject-api, pytest, pytest-ansible, tox, tox-extra, tox-uv
6771
paginate==0.5.7 # via mkdocs-material
72+
parsley==1.3 # via bindep
6873
pathspec==0.12.1 # via black, mkdocs, mkdocs-macros-plugin
74+
pbr==6.1.0 # via bindep
6975
pillow==11.1.0 # via cairosvg, mkdocs-ansible
7076
platformdirs==4.3.6 # via black, mkdocs-get-deps, mkdocstrings, pylint, tox, virtualenv
7177
pluggy==1.5.0 # via pytest, tox
@@ -89,6 +95,7 @@ requests==2.32.3 # via linkchecker, mkdocs-htmlproofer-plugin, mkdocs-m
8995
rpds-py==0.22.3 # via jsonschema, referencing
9096
ruff==0.9.3 # via tox-ansible (pyproject.toml)
9197
six==1.17.0 # via python-dateutil
98+
smmap==5.0.2 # via gitdb
9299
soupsieve==2.6 # via beautifulsoup4
93100
subprocess-tee==0.4.2 # via ansible-compat
94101
super-collections==0.5.3 # via mkdocs-macros-plugin
@@ -98,7 +105,9 @@ tinycss2==1.4.0 # via cairosvg, cssselect2
98105
toml-sort==0.24.2 # via tox-ansible (pyproject.toml)
99106
tomli==2.2.1 # via black, coverage, mypy, pydoclint, pylint, pyproject-api, pytest, tox
100107
tomlkit==0.13.2 # via pylint, toml-sort
101-
tox==4.24.1 # via tox-ansible (pyproject.toml)
108+
tox==4.24.1 # via tox-extra, tox-uv, tox-ansible (pyproject.toml)
109+
tox-extra==2.1.0 # via tox-ansible (pyproject.toml)
110+
tox-uv==1.20.2 # via tox-extra, tox-ansible (pyproject.toml)
102111
types-pyyaml==6.0.12.20241230 # via tox-ansible (pyproject.toml)
103112
urllib3==2.3.0 # via requests
104113
virtualenv==20.29.1 # via pre-commit, tox
@@ -109,3 +118,4 @@ webencodings==0.5.1 # via cssselect2, tinycss2
109118
# ansible-core
110119
# resolvelib
111120
# typing-extensions
121+
# uv

.config/requirements-test.in

+2
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ pytest-xdist
1010
ruff
1111
toml-sort
1212
tox
13+
tox-extra
14+
tox-uv
1315
types-PyYAML

tests/conftest.py

+13
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
Tracing '/**/src/<package>/__init__.py'
1717
"""
1818

19+
# cspell:ignore collectonly,sessionstart
20+
1921
from __future__ import annotations
2022

2123
import configparser
@@ -40,6 +42,17 @@
4042
GH_MATRIX_LENGTH = 36
4143

4244

45+
def pytest_sessionstart(session: pytest.Session) -> None:
46+
"""Start the testing session.
47+
48+
Args:
49+
session: The pytest session.
50+
"""
51+
if session.config.option.collectonly:
52+
return
53+
os.environ["NO_COLOR"] = "1"
54+
55+
4356
def run(
4457
args: Sequence[str | Path] | str | Path,
4558
*,

tox.ini

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[tox]
22
requires =
3-
tox>=4.11.3
4-
tox-uv
3+
tox>=4.24.1
4+
tox-extra>=2.1
5+
tox-uv>=1.20.2
56
env_list =
67
py
78
deps
@@ -27,13 +28,16 @@ pass_env =
2728
TERM
2829
USER
2930
set_env =
30-
!milestone: PIP_CONSTRAINT = {toxinidir}/.config/constraints.txt
3131
COVERAGE_COMBINED = {envdir}/.coverage
3232
COVERAGE_FILE = {env:COVERAGE_FILE:{envdir}/.coverage.{envname}}
3333
COVERAGE_PROCESS_START = {toxinidir}/pyproject.toml
3434
FORCE_COLOR = 1
35+
PIP_CONSTRAINT = {toxinidir}/.config/constraints.txt
3536
PRE_COMMIT_COLOR = always
3637
TERM = xterm-256color
38+
UV_CONSTRAINT = {toxinidir}/.config/constraints.txt
39+
deps, lint, milestone: PIP_CONSTRAINT = /dev/null
40+
deps, lint, milestone: UV_CONSTRAINT = /dev/null
3741
commands_pre =
3842
sh -c "rm -f {envdir}/.coverage* 2>/dev/null || true"
3943
commands =
@@ -54,13 +58,11 @@ skip_install = true
5458
deps =
5559
{[testenv:lint]deps}
5660
extras =
57-
set_env =
58-
PIP_CONSTRAINT = /dev/null
5961
commands_pre =
6062
commands =
61-
-pre-commit run --all-files --show-diff-on-failure --hook-stage manual up
62-
-pre-commit autoupdate
63-
git diff --exit-code
63+
pre-commit run --all-files --show-diff-on-failure --hook-stage manual up
64+
pre-commit autoupdate
65+
tox -e lint
6466
env_dir = {toxworkdir}/lint
6567

6668
[testenv:docs]
@@ -81,8 +83,6 @@ skip_install = true
8183
deps =
8284
pre-commit
8385
pre-commit-uv
84-
set_env =
85-
PIP_CONSTRAINT = /dev/null
8686
commands =
8787
pre-commit run --show-diff-on-failure --all-files
8888

@@ -91,9 +91,6 @@ description =
9191
Run tests with ansible-core milestone branch and without dependencies constraints
9292
deps =
9393
ansible-core@ https://github.com/ansible/ansible/archive/milestone.tar.gz
94-
set_env =
95-
{[testenv]set_env}
96-
PIP_CONSTRAINT = /dev/null
9794

9895
[testenv:pkg]
9996
description =

0 commit comments

Comments
 (0)