summaryrefslogtreecommitdiffstats
path: root/tox.ini
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:20:41 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-29 04:20:41 +0000
commitb49f1524e250764592ff132af8fb0d39182620f7 (patch)
treea2c4da0c1bfc3be79c9b80180d8958804e91a07d /tox.ini
parentInitial commit. (diff)
downloadpython-build-b49f1524e250764592ff132af8fb0d39182620f7.tar.xz
python-build-b49f1524e250764592ff132af8fb0d39182620f7.zip
Adding upstream version 0.9.0.upstream/0.9.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--tox.ini109
1 files changed, 109 insertions, 0 deletions
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..19cce03
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,109 @@
+[tox]
+envlist =
+ fix
+ type
+ docs
+ path
+ {py311, py310, py39, py38, py37, py36, pypy37, pypy38, pypy39}{, -min}
+isolated_build = true
+skip_missing_interpreters = true
+minversion = 3.14
+requires =
+ virtualenv>=20.0.34
+
+[testenv]
+description =
+ run test suite with {basepython}
+passenv =
+ LC_ALL
+ PIP_*
+ PYTEST_*
+ TERM
+setenv =
+ COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
+ TEST_STATUS_DIR = {envtmpdir}
+ PYPY3323BUG = 1
+extras =
+ test
+commands =
+ pytest -ra --cov --cov-config pyproject.toml \
+ --cov-report=html:{envdir}/htmlcov --cov-context=test \
+ --cov-report=xml:{toxworkdir}/coverage.{envname}.xml {posargs:-n auto}
+
+[testenv:fix]
+description = run static analysis and style checks
+passenv =
+ HOMEPATH
+ PROGRAMDATA
+basepython = python3.9
+skip_install = true
+deps =
+ pre-commit>=2
+commands =
+ pre-commit run --all-files --show-diff-on-failure
+ python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")'
+
+[testenv:path]
+description = verify build can run from source (bootstrap)
+setenv =
+ PYTHONPATH = {toxinidir}/src
+ COVERAGE_FILE = {toxworkdir}/.coverage.{envname}
+commands_pre =
+ python -E -m pip uninstall -y build colorama
+
+[testenv:type]
+description = run type check on code base
+extras = typing
+commands =
+ mypy
+
+[testenv:{py311, py310, py39, py38, py37, py36, pypy37, pypy38, pypy39}-min]
+description = check minimum versions required of all dependencies
+skip_install = true
+commands_pre =
+ pip install .[test] -c tests/constraints.txt
+
+[testenv:docs]
+description = build documentations
+basepython = python3.8
+extras =
+ docs
+commands =
+ sphinx-build -n docs {envtmpdir} {posargs:-W}
+ python -c 'print("Documentation available under file://{envtmpdir}/index.html")'
+
+[testenv:dev]
+description = generate a DEV environment
+usedevelop = true
+deps =
+ virtualenv>=20.0.34
+extras =
+ doc
+ test
+commands =
+ python -m pip list --format=columns
+ python -c 'import sys; print(sys.executable)'
+
+[testenv:coverage]
+description = combine coverage from test environments
+passenv =
+ DIFF_AGAINST
+setenv =
+skip_install = true
+deps =
+ coverage[toml]>=5.1
+ diff_cover>=3
+parallel_show_output = true
+commands =
+ coverage combine {toxworkdir}
+ coverage report --skip-covered --show-missing -i
+ coverage xml -o {toxworkdir}/coverage.xml -i
+ coverage html -d {toxworkdir}/htmlcov -i
+ python -m diff_cover.diff_cover_tool --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml
+depends = {py311, py310, py39, py38, py37, py36, pypy37, pypy38, pypy39}{,-min}, path
+
+[flake8]
+max-line-length = 127
+max-complexity = 10
+extend-ignore = E203
+extend-select = B9