|
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 |
10 | 11 | type |
11 | | - readme |
| 12 | + pkg_meta |
12 | 13 | skip_missing_interpreters = true |
13 | 14 |
|
14 | 15 | [testenv] |
15 | | -description = run the unit tests with pytest under {basepython} |
| 16 | +description = run the unit tests with pytest under {base_python} |
16 | 17 | package = wheel |
17 | 18 | wheel_build_env = .pkg |
18 | 19 | extras = |
19 | | - test |
| 20 | + testing |
| 21 | +pass_env = |
| 22 | + PYTEST_* |
20 | 23 | set_env = |
21 | | - COVERAGE_FILE = {toxworkdir}/.coverage.{envname} |
22 | | - COVERAGE_PROCESS_START = {toxinidir}/setup.cfg |
23 | | - _COVERAGE_SRC = {envsitepackagesdir}/sphinx_argparse_cli |
| 24 | + COVERAGE_FILE = {work_dir}/.coverage.{env_name} |
24 | 25 | commands = |
25 | | - pytest {tty:--color=yes} {posargs: \ |
26 | | - --junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}sphinx_argparse_cli \ |
27 | | - --cov {toxinidir}{/}tests --cov-fail-under=100 \ |
| 26 | + python -m pytest {tty:--color=yes} {posargs: \ |
| 27 | + --cov {env_site_packages_dir}{/}sphinx_argparse_cli --cov {tox_root}{/}tests \ |
28 | 28 | --cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \ |
29 | | - --cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \ |
| 29 | + --cov-report html:{env_tmp_dir}{/}htmlcov --cov-report xml:{work_dir}{/}coverage.{env_name}.xml \ |
| 30 | + --junitxml {work_dir}{/}junit.{env_name}.xml \ |
30 | 31 | tests} |
31 | 32 |
|
32 | 33 | [testenv:fix] |
33 | | -description = run static analysis and style check using flake8 |
| 34 | +description = format the code base to adhere to our styles, and complain about what we cannot do automatically |
34 | 35 | skip_install = true |
35 | 36 | deps = |
36 | | - pre-commit>=3.8 |
37 | | -pass_env = |
38 | | - HOMEPATH |
39 | | - PROGRAMDATA |
| 37 | + pre-commit-uv>=4.1.1 |
40 | 38 | commands = |
41 | 39 | pre-commit run --all-files --show-diff-on-failure |
42 | | - python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")' |
43 | 40 |
|
44 | 41 | [testenv:type] |
45 | 42 | description = run type check on code base |
46 | 43 | deps = |
47 | 44 | mypy==1.11.2 |
48 | 45 | types-docutils>=0.21.0.20240907 |
49 | 46 | commands = |
50 | | - mypy src |
51 | | - mypy tests |
| 47 | + mypy src tests {posargs} |
52 | 48 |
|
53 | | -[testenv:readme] |
| 49 | +[testenv:pkg_meta] |
54 | 50 | description = check that the long description is valid |
55 | 51 | skip_install = true |
56 | 52 | deps = |
57 | | - build[uv]>=1.2.2 |
58 | 53 | check-wheel-contents>=0.6 |
59 | 54 | twine>=5.1.1 |
| 55 | + uv>=0.4.10 |
60 | 56 | commands = |
61 | | - pyproject-build --installer uv --outdir {envtmpdir} --sdist --wheel . |
62 | | - twine check {envtmpdir}{/}* |
63 | | - check-wheel-contents --no-config {envtmpdir} |
| 57 | + uv build --sdist --wheel --out-dir {env_tmp_dir} . |
| 58 | + twine check {env_tmp_dir}{/}* |
| 59 | + check-wheel-contents --no-config {env_tmp_dir} |
64 | 60 |
|
65 | 61 | [testenv:dev] |
66 | 62 | description = generate a DEV environment |
67 | 63 | package = editable |
68 | | -extras = |
69 | | - docs |
70 | | - test |
71 | 64 | commands = |
72 | 65 | uv pip tree |
73 | 66 | python -c 'import sys; print(sys.executable)' |
0 commit comments