-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtox.ini
More file actions
83 lines (69 loc) · 2.45 KB
/
tox.ini
File metadata and controls
83 lines (69 loc) · 2.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
# For distributed tests, call tox with `-n NUMBER` arguments
# Use `pyproject.toml` as single-source of truth for dependency specification
[tox]
minversion = 3.24
envlist = lint, py39, py310, py311
isolated_build = True
[gh-actions]
python =
3.9: py39
3.10: py310
3.11: py311
[testenv]
description = Run tests
changedir = {toxinidir}
setenv =
SOURCEDIR = src/anppt
deps =
-r {toxinidir}/requirements-test.txt
commands =
pytest -v
[testenv:lint]
description = Perform static analysis, style, and type checks
changedir = {toxinidir}
deps =
-r {toxinidir}/requirements-dev.txt
-r {toxinidir}/requirements-types.txt
commands =
- pre-commit run --all-files # Run all pre-commit hooks, ignoring failures
pre-commit run --all-files # Re-run all pre-commit hooks. If any fail, exit with error
mypy --config .mypy.ini {env:SOURCEDIR}
[testenv:{build,clean}]
description =
build: Build the package in isolation according to PEP517, see https://github.com/pypa/build
clean: Remove old distribution files and temporary build artifacts (./build and ./dist)
# https://setuptools.pypa.io/en/latest/build_meta.html#how-to-use-it
skip_install = True
changedir = {toxinidir}
deps =
build: build[virtualenv]
commands =
clean: python -c "import pathlib; [p.unlink() for p in pathlib.Path('.').rglob('*.py[co]')]"
clean: python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('__pycache__')]"
clean: python -c "import pathlib, shutil; [shutil.rmtree(p) for p in pathlib.Path('.').rglob('*.egg-info')]"
clean: python -c "import pathlib, shutil; [shutil.rmtree(p) if pathlib.Path(p).exists() else None for p in ['.pytest_cache', '.mypy_cache']]"
clean: python -c "import pathlib, shutil; [shutil.rmtree(p) if pathlib.Path(p).exists() else None for p in ['build', 'dist']]"
build: python -m build
[testenv:docs]
description = docs: Use pdoc to generate documentation
setenv =
{[testenv]setenv}
DOCSDIR = {toxinidir}/docs
deps =
-r {toxinidir}/requirements-docs.txt
commands =
pdoc -o "{env:DOCSDIR}" "{env:SOURCEDIR}" -d google
[testenv:release]
description = Build a new tag and push it to the remote repository
skip_install = True
deps =
-r {toxinidir}/requirements-release.txt
setenv =
PYTHONUTF8=1
GITCHANGELOG_CONFIG_FILENAME = .gitchangelog.rc
passenv =
HOME
allowlist_externals =
{toxinidir}/scripts/release.sh
commands =
{toxinidir}/scripts/release.sh {posargs:version_type}