generated from spacetelescope/stsci-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
88 lines (82 loc) · 2.07 KB
/
tox.ini
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
[tox]
envlist =
check-{style,security}
test{,-oldestdeps}{,-pyargs,-warnings,-cov}
build-{docs,dist}
# tox environments are constructed with so-called 'factors' (or terms)
# separated by hyphens, e.g. test-oldestdeps-cov. Lines below starting with factor:
# will only take effect if that factor is included in the environment name. To
# see a list of example environments that can be run, along with a description,
# run:
#
# tox -l -v
#
[testenv:check-style]
description = check code style with ruff
skip_install = true
deps =
ruff
commands =
ruff check .
[testenv:check-security]
description = run bandit to check security compliance
skip_install = true
deps =
bandit>=1.7
commands =
bandit -r -ll -x packagename/*test* packagename
[testenv]
description =
run tests
oldestdeps: with the oldest supported version of key dependencies
pyargs: with --pyargs on installed package
warnings: treating warnings as errors
cov: with coverage
pass_env =
TOXENV
CI
CODECOV_*
HOME
STRICT_VALIDATION
PASS_INVALID_VALUES
VALIDATE_ON_ASSIGNMENT
extras =
test
deps =
oldestdeps: minimum_dependencies
package =
!pyargs: editable
pyargs: wheel
commands_pre =
# Generate a requirements-min.txt file
oldestdeps: minimum_dependencies packagename --filename requirements-min.txt
# Force install everything in that file
oldestdeps: pip install -r requirements-min.txt
pip freeze
commands =
pip freeze
pytest \
cov: --cov=packagename --cov-report=xml --cov-report=html
warnings: -W error \
pyargs: {toxinidir}/docs --pyargs packagename \
{posargs}
[testenv:build-docs]
description = invoke sphinx-build to build the HTML docs
extras =
docs
allowlist_externals =
rm
cp
commands =
rm -rf docs/api docs/_build
sphinx-build -W docs docs/_build/html
cp -r docs/_build/html/_static/css/fonts docs/_build/html/_static/fonts
[testenv:build-dist]
description = check build sdist/wheel
skip_install = true
allowlist_externals = rm
deps =
build
commands =
rm -rf dist
python -m build