|
1 | 1 | [tox]
|
2 | 2 | requires =
|
3 | 3 | tox>=4.2
|
| 4 | + tox-uv>=1.11.3 |
4 | 5 | env_list =
|
5 | 6 | fix
|
6 | 7 | 3.13
|
7 | 8 | 3.12
|
8 | 9 | 3.11
|
9 | 10 | 3.10
|
| 11 | + 3.9 |
| 12 | + 3.8 |
10 | 13 | type
|
11 |
| - coverage |
12 |
| - readme |
| 14 | + pkg_meta |
13 | 15 | skip_missing_interpreters = true
|
14 | 16 |
|
15 | 17 | [testenv]
|
16 |
| -description = run tests with {basepython} |
| 18 | +description = run the unit tests with pytest under {base_python} |
17 | 19 | package = wheel
|
18 | 20 | wheel_build_env = .pkg
|
19 | 21 | extras =
|
20 | 22 | numpy
|
21 | 23 | testing
|
22 | 24 | type-comment
|
23 | 25 | pass_env =
|
24 |
| - PIP_* |
| 26 | + DIFF_AGAINST |
25 | 27 | PYTEST_*
|
26 | 28 | set_env =
|
27 |
| - COVERAGE_FILE = {toxworkdir}{/}.coverage.{envname} |
| 29 | + COVERAGE_FILE = {work_dir}/.coverage.{env_name} |
28 | 30 | commands =
|
29 |
| - pytest {tty:--color=yes} {posargs: \ |
30 |
| - --junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}sphinx_autodoc_typehints --cov {toxinidir}{/}tests \ |
| 31 | + python -m pytest {tty:--color=yes} {posargs: \ |
| 32 | + --cov {env_site_packages_dir}{/}sphinx_autodoc_typehints --cov {tox_root}{/}tests \ |
31 | 33 | --cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
|
32 |
| - --cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \ |
| 34 | + --cov-report html:{env_tmp_dir}{/}htmlcov --cov-report xml:{work_dir}{/}coverage.{env_name}.xml \ |
| 35 | + --junitxml {work_dir}{/}junit.{env_name}.xml \ |
33 | 36 | tests}
|
34 |
| - diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}{/}coverage.{envname}.xml |
| 37 | + diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {work_dir}{/}coverage.{env_name}.xml --fail-under 100 |
35 | 38 |
|
36 | 39 | [testenv:fix]
|
37 | 40 | description = format the code base to adhere to our styles, and complain about what we cannot do automatically
|
38 | 41 | skip_install = true
|
39 | 42 | deps =
|
40 |
| - pre-commit-uv>=4.1 |
| 43 | + pre-commit-uv>=4.1.1 |
41 | 44 | commands =
|
42 | 45 | pre-commit run --all-files --show-diff-on-failure
|
43 | 46 |
|
44 |
| -[testenv:3.13] |
45 |
| -extras = |
46 |
| - testing |
47 |
| - type-comment |
48 |
| - |
49 | 47 | [testenv:type]
|
50 | 48 | description = run type check on code base
|
51 | 49 | deps =
|
52 | 50 | mypy==1.11.2
|
53 |
| - types-docutils>=0.21.0.20240907 |
54 | 51 | commands =
|
55 | 52 | mypy src
|
56 | 53 | mypy tests
|
57 | 54 |
|
58 |
| -[testenv:coverage] |
59 |
| -description = combine coverage files and generate diff (against DIFF_AGAINST defaulting to origin/main) |
60 |
| -skip_install = true |
61 |
| -deps = |
62 |
| - covdefaults>=2.3 |
63 |
| - coverage>=7.6.1 |
64 |
| - diff-cover>=9.1.1 |
65 |
| -extras = |
66 |
| -parallel_show_output = true |
67 |
| -pass_env = |
68 |
| - DIFF_AGAINST |
69 |
| -set_env = |
70 |
| - COVERAGE_FILE = {toxworkdir}/.coverage |
71 |
| -commands = |
72 |
| - coverage combine |
73 |
| - coverage report --skip-covered --show-missing |
74 |
| - coverage xml -o {toxworkdir}/coverage.xml |
75 |
| - coverage html -d {toxworkdir}/htmlcov |
76 |
| - diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml |
77 |
| -depends = |
78 |
| - 3.13 |
79 |
| - 3.12 |
80 |
| - 3.11 |
81 |
| - 3.10 |
82 |
| - |
83 |
| -[testenv:readme] |
84 |
| -description = check that the long description is valid (need for PyPI) |
| 55 | +[testenv:pkg_meta] |
| 56 | +description = check that the long description is valid |
85 | 57 | skip_install = true
|
86 | 58 | deps =
|
87 |
| - build[virtualenv]>=1.2.2 |
| 59 | + check-wheel-contents>=0.6 |
88 | 60 | twine>=5.1.1
|
89 |
| -extras = |
| 61 | + uv>=0.4.10 |
90 | 62 | commands =
|
91 |
| - pyproject-build -o {envtmpdir} --wheel --sdist . |
92 |
| - twine check {envtmpdir}/* |
| 63 | + uv build --sdist --wheel --out-dir {env_tmp_dir} . |
| 64 | + twine check {env_tmp_dir}{/}* |
| 65 | + check-wheel-contents --no-config {env_tmp_dir} |
93 | 66 |
|
94 | 67 | [testenv:dev]
|
95 | 68 | description = generate a DEV environment
|
96 | 69 | package = editable
|
97 | 70 | commands =
|
98 |
| - python -m pip list --format=columns |
| 71 | + uv pip tree |
99 | 72 | python -c 'import sys; print(sys.executable)'
|
100 |
| -uv_seed = true |
0 commit comments