-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
185 lines (169 loc) · 7.24 KB
/
Copy pathtox.ini
File metadata and controls
185 lines (169 loc) · 7.24 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
# This file provides configurations for tox-based project development and management automation tasks.
# Base tox configurations. Note, the 'envlist' runs in the listed order whenever 'tox' is used without an -e specifier.
[tox]
requires =
tox>=4,<5
tox-uv>=1,<2
envlist =
uninstall
export
lint
stubs
{py312, py313, py314}-test
coverage
docs
build
install
# Note: The 'basepython' argument should always be set to the earliest supported Python version. The 'ruff check'
# command also covers the test directory, which activates the 'tests/**/*.py' per-file ignores configured in the
# pyproject.toml file. The 'mypy' command stays on the source directory, as the test directory is part of the mypy
# exclusion list.
[testenv:lint]
description =
Runs static code formatting, style, and typing checkers. Follows the configuration defined in the pyproject.toml
file.
dependency_groups = dev
basepython = py312
commands =
automation-cli purge-stubs
ruff format
ruff check --fix ./src ./tests
mypy ./src
[testenv:stubs]
description = Generates the py.typed marker and the .pyi stub files using the project's sdist distribution.
depends = lint
dependency_groups = dev
commands =
automation-cli process-typed-markers
stubgen -o stubs --include-private -p ataraxis_data_structures -v
automation-cli process-stubs
ruff format
ruff check --select I --fix ./src
[testenv:{py312, py313, py314}-test]
package = wheel
description =
Runs unit and integration tests for each of the python versions listed in the task name and aggregates test
coverage data. Uses 'loadgroup' balancing and all logical cores to optimize task runtime speed.
dependency_groups = dev
setenv = COVERAGE_FILE = reports{/}.coverage.{envname}
commands =
pytest --import-mode=importlib --cov=ataraxis_data_structures --cov-config=pyproject.toml --cov-report=xml \
--junitxml=reports/pytest.xml.{envname} -n logical --dist loadgroup
# Note: the 'xml' and 'html' commands run with '--fail-under=0' so that both reports are always written ('coverage.xml'
# in the project root and 'reports/coverage_html' for the html report). The trailing 'report' command applies the 100%
# coverage gate configured in the pyproject.toml file and prints the statements that remain uncovered. Every reporting
# command also combines any data files it finds, so all of them run with '--keep-combined' to preserve the per-version
# data files consumed by the 'combine' command. Without the flag, the first reporting command deletes those files and
# the task only succeeds once per test run.
[testenv:coverage]
skip_install = true
description =
Merges the per-version JUnit XML reports into 'reports/pytest.xml' and combines test-coverage data from multiple
test runs (for different python versions) into xml and html reports, then verifies that the combined data covers
100% of the measured statements. The html report can be viewed by loading the 'reports/coverage_html/index.html'.
deps = ataraxis-automation==9.0.2
setenv = COVERAGE_FILE = reports/.coverage
depends = {py312, py313, py314}-test
commands =
junitparser merge --glob reports/pytest.xml.* reports/pytest.xml
coverage combine --keep
coverage xml --fail-under=0 --keep-combined
coverage html --fail-under=0 --keep-combined
coverage report --keep-combined
[testenv:docs]
description =
Builds the API documentation from source code docstrings using Sphinx. The result can be viewed by loading
'docs/build/html/index.html'.
deps = ataraxis-automation==9.0.2
depends = uninstall
commands =
sphinx-build -b html -d docs/build/doctrees docs/source docs/build/html -j auto -v
[testenv:build]
skip_install = true
description =
Builds the project's source code distribution (sdist) and binary distribution (wheel), clearing the 'dist'
directory beforehand so that artifacts built for an earlier version cannot be carried into the upload task.
deps = ataraxis-automation==9.0.2
commands =
python -c "import shutil; shutil.rmtree('dist', ignore_errors=True)"
python -m build . --sdist
python -m build . --wheel
# Note: use 'tox -e upload -- --replace-token' command to replace the token stored in the shared .pypirc file before
# uploading the project.
[testenv:upload]
skip_install = true
description =
Uses twine to upload the wheel ('*.whl') and source ('*.tar.gz') distributions found inside the project's 'dist'
directory to PyPI.
deps = ataraxis-automation==9.0.2
commands =
automation-cli acquire-pypi-token {posargs:}
automation-cli upload-project
# Note: use 'tox -e deploy -- --replace-token' command to replace the token stored in the shared .netlifyrc file, and
# 'tox -e deploy -- --replace-site' to replace the site identifier stored in the project's .netlify-site file, before
# deploying the documentation.
[testenv:deploy]
skip_install = true
description =
Uploads the API documentation built by the 'docs' task to the project's Netlify site. Build the documentation with
'tox -e docs' before calling this task.
deps = ataraxis-automation==9.0.2
commands =
automation-cli acquire-netlify-token {posargs:}
automation-cli deploy-docs
[testenv:install]
skip_install = true
deps = ataraxis-automation==9.0.2
depends =
lint
stubs
{py312, py313, py314}-test
coverage
docs
export
description = Builds and installs the project into its development mamba environment.
commands =
automation-cli install-project --environment-name axds_dev {posargs:}
[testenv:uninstall]
skip_install = true
deps = ataraxis-automation==9.0.2
description = Uninstalls the project from its development mamba environment.
commands =
automation-cli uninstall-project --environment-name axds_dev
[testenv:create]
skip_install = true
deps = ataraxis-automation==9.0.2
description =
Creates the project's development mamba environment using the requested python version and installs runtime and
development project dependencies extracted from the pyproject.toml file.
commands =
automation-cli create-environment --environment-name axds_dev --python-version 3.14 {posargs:}
[testenv:remove]
skip_install = true
deps = ataraxis-automation==9.0.2
description = Removes the project's development mamba environment.
commands =
automation-cli remove-environment --environment-name axds_dev
[testenv:provision]
skip_install = true
deps = ataraxis-automation==9.0.2
description =
Provisions the project's development mamba environment by verifying that the new environment specification
resolves, then removing and (re)creating the environment and installing the project dependencies into it.
commands =
automation-cli provision-environment --environment-name axds_dev --python-version 3.14 {posargs:}
[testenv:export]
skip_install = true
deps = ataraxis-automation==9.0.2
depends = uninstall
description = Exports the project's development mamba environment to the 'envs' project directory as a .yml file.
commands =
automation-cli export-environment --environment-name axds_dev
[testenv:import]
skip_install = true
deps = ataraxis-automation==9.0.2
description =
Creates or updates the project's development mamba environment using the .yml file stored in the 'envs' project
directory.
commands =
automation-cli import-environment --environment-name axds_dev