|
| 1 | +requires = [ "tox>=4.30.3", "tox-uv>=1.28" ] |
| 2 | +env_list = [ "3.14", "3.13", "3.12", "3.11", "3.10", "fix", "pkg_meta", "type" ] |
| 3 | +skip_missing_interpreters = true |
| 4 | + |
| 5 | +[env_run_base] |
| 6 | +description = "run the unit tests with pytest under {env_name}" |
| 7 | +package = "wheel" |
| 8 | +wheel_build_env = ".pkg" |
| 9 | +extras = [ "testing" ] |
| 10 | +pass_env = [ "DIFF_AGAINST", "PYTEST_*" ] |
| 11 | +set_env.COVERAGE_FILE = { replace = "env", name = "COVERAGE_FILE", default = "{work_dir}{/}.coverage.{env_name}" } |
| 12 | +commands = [ |
| 13 | + [ |
| 14 | + "python", |
| 15 | + "-m", |
| 16 | + "pytest", |
| 17 | + { replace = "posargs", extend = true, default = [ |
| 18 | + "--cov", |
| 19 | + "{env_site_packages_dir}{/}devpi_process", |
| 20 | + "--cov", |
| 21 | + "{tox_root}{/}tests", |
| 22 | + "--cov-config=pyproject.toml", |
| 23 | + "--no-cov-on-fail", |
| 24 | + "--cov-report", |
| 25 | + "term-missing:skip-covered", |
| 26 | + "--cov-context=test", |
| 27 | + "--cov-report", |
| 28 | + "html:{env_tmp_dir}{/}htmlcov", |
| 29 | + "--cov-report", |
| 30 | + "xml:{work_dir}{/}coverage.{env_name}.xml", |
| 31 | + "--junitxml", |
| 32 | + "{work_dir}{/}junit.{env_name}.xml", |
| 33 | + "tests", |
| 34 | + ] }, |
| 35 | + ], |
| 36 | +] |
| 37 | + |
| 38 | +[env.fix] |
| 39 | +description = "format the code base to adhere to our styles, and complain about what we cannot do automatically" |
| 40 | +skip_install = true |
| 41 | +deps = [ "pre-commit-uv>=4.1.5" ] |
| 42 | +commands = [ [ "pre-commit", "run", "--all-files", "--show-diff-on-failure" ] ] |
| 43 | + |
| 44 | +[env.pkg_meta] |
| 45 | +description = "check that the long description is valid" |
| 46 | +skip_install = true |
| 47 | +deps = [ "check-wheel-contents>=0.6.3", "twine>=6.2", "uv>=0.8.22" ] |
| 48 | +commands = [ |
| 49 | + [ "uv", "build", "--sdist", "--wheel", "--out-dir", "{env_tmp_dir}", "." ], |
| 50 | + [ "twine", "check", "{env_tmp_dir}{/}*" ], |
| 51 | + [ "check-wheel-contents", "--no-config", "{env_tmp_dir}" ], |
| 52 | +] |
| 53 | + |
| 54 | +[env.type] |
| 55 | +description = "run type check on code base" |
| 56 | +deps = [ "mypy==1.18.2" ] |
| 57 | +commands = [ [ "mypy", "src" ], [ "mypy", "tests" ] ] |
| 58 | + |
| 59 | +[env.dev] |
| 60 | +description = "generate a DEV environment" |
| 61 | +package = "editable" |
| 62 | +commands = [ |
| 63 | + [ "uv", "pip", "tree" ], |
| 64 | + [ "python", "-c", "import sys; print(sys.executable)" ], |
| 65 | +] |
0 commit comments