-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtox.ini
118 lines (109 loc) · 3.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
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
[tox]
envlist =
clean
pep8
bandit
docs
py310
py311
py312
bats
pypi
report
labels =
tests = py310,py311,py312,pypi
static = pep8,bandit,docs
# In practice, you can optimize by first running static tests
# 'pep8,bandit,docs' and only after those succeed go on to
# run the remaining tests. E.g.,
# $ tox -e pep8,bandit,docs && tox -e py310,py311,py312,pypi
# or
# $ tox run -m static && tox run -m tests
skip_missing_interpreters = true
#skipsdists = true
requires =
tox>=4
poetry==1.8.3
pytest
virtualenv>20.2
[testenv]
deps =
pytest
pytest-cov
depends =
{py310,py311,py312}: clean
report: py310,py311,py312
allowlist_externals =
coverage
ruff
make
poetry
pytest
distribute = false
usedevelop = false
skip_install = true
setenv =
VIRTUAL_ENV={envdir}
PYTHONPATH={toxinidir}:{toxinidir}/psec
commands_pre =
poetry install --no-root --with=dev --with=test
poetry self add poetry-dynamic-versioning[plugin]
commands =
pytest --version
pytest tests/ --import-mode importlib --cov=psec --cov-append --cov-report=term-missing
make DOT_LOCAL={envdir} PYTHON={envpython} test-bats
[testenv:report]
deps = coverage
skip_install = true
#allowlist_externals = coverage
commands =
coverage report
coverage html
[testenv:clean]
deps = coverage
skip_install = true
#allowlist_externals =
# coverage
# poetry
commands = coverage erase
[testenv:pypi]
deps = twine
#allowlist_externals = make
commands = make twine-check
[testenv:pep8]
#allowlist_externals =
# ruff
# poetry
deps =
#commands = ruff psec tests docs/conf.py
commands =
ruff check -v --extend-exclude tests/libs/ tests/ docs/conf.py
[testenv:bandit]
; Run security linter
commands = bandit -c bandit.yaml -r psec -x tests -n5
[testenv:docs]
#allowlist_externals =
# make
# poetry
commands =
poetry install --with=docs
make clean install
sphinx-build -b html docs docs/_build
[testenv:bats]
; Run bats unit tests
; Deal with this by requiring docutils==0.15:
; # Traceback (most recent call last):
; # File "/Users/dittrich/git/python_secrets/.tox/bats/lib/python3.7/site-packages/cliff/help.py", line 43, in __call__
; # factory = ep.load()
; # File "/Users/dittrich/git/python_secrets/.tox/bats/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2444, in load
; # self.require(*args, **kwargs)
; # File "/Users/dittrich/git/python_secrets/.tox/bats/lib/python3.7/site-packages/pkg_resources/__init__.py", line 2467, in require
; # items = working_set.resolve(reqs, env, installer, extras=self.extras)
; # File "/Users/dittrich/git/python_secrets/.tox/bats/lib/python3.7/site-packages/pkg_resources/__init__.py", line 792, in resolve
; # raise VersionConflict(dist, req).with_context(dependent_req)
; # pkg_resources.ContextualVersionConflict: (docutils 0.16 (/Users/dittrich/git/python_secrets/.tox/bats/lib/python3.7/site-packages), Requirement.parse('docutils<0.16,>=0.10'), {'botocore'})
#allowlist_externals =
# make
# poetry
commands = make test-bats
# EOF