-
Notifications
You must be signed in to change notification settings - Fork 5
/
tox.ini
132 lines (115 loc) · 3.47 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
[tox]
envlist =
tests
linting
coverage
docs
type_check
skip_missing_interpreters = True
isolated_build = True
[testenv]
commands = python -m pip install --upgrade pip
[testenv:tests]
deps =
-r requirements.txt
-r dev_requirements/requirements-tests.txt
commands = python -m pytest --basetemp={envtmpdir} {posargs}
[testenv:linting]
deps =
-r requirements.txt
-r dev_requirements/requirements-linting.txt
{[testenv:docs]deps}
{[testenv:generate_json_schemas]deps}
commands =
pylint src/bo4e
pylint docs/uml.py
pylint docs/compatibility
pylint generate_or_validate_json_schemas.py
[testenv:type_check]
usedevelop = True
# the type_check environment checks the type hints using mypy
deps =
-rrequirements.txt
{[testenv:docs]deps}
{[testenv:generate_json_schemas]deps}
-r dev_requirements/requirements-type_check.txt
commands =
mypy --show-error-codes src/bo4e
mypy --show-error-codes tests
mypy --show-error-codes docs/uml.py
mypy --show-error-codes docs/compatibility
mypy --show-error-codes generate_or_validate_json_schemas.py
# add single files (ending with .py) or packages here
[testenv:coverage]
usedevelop = True
deps =
{[testenv:tests]deps}
-r dev_requirements/requirements-coverage.txt
commands =
coverage run -m pytest --basetemp={envtmpdir} {posargs}
coverage html --omit .tox/*,tests/*
coverage report --fail-under 99 --omit .tox/*,tests/*
[testenv:dev]
usedevelop = True
deps =
{[testenv:tests]deps}
{[testenv:linting]deps}
{[testenv:type_check]deps}
{[testenv:coverage]deps}
{[testenv:docs]deps}
-r dev_requirements/requirements-formatting.txt
# Replace by any tag/version: https://github.com/psf/black/tags
# and change the pre-commit-config.yaml accordingly
pip-tools
pre-commit
commands =
python -m pip install --upgrade pip
pip-compile requirements.in
pip install -r requirements.txt
pre-commit install
[testenv:docs]
deps =
-r requirements.txt
-r docs/requirements.txt
{[testenv:generate_json_schemas]deps}
# any dependency added here should also be added in docs/requirements.in and docs/requirements.txt respectively
setenv =
TARGET_VERSION = {env:TARGET_VERSION:local}
SPHINX_DOCS_RELEASE = {env:TARGET_VERSION:local}
SPHINX_DOCS_VERSION = {env:TARGET_VERSION:local}
commands =
{[testenv:generate_json_schemas]commands}
sphinx-build -T -W -b html -d {envtmpdir}/doctrees docs {envtmpdir}/html
python -m doctest README.rst
[testenv:bo4e-from-pip]
basepython = python3.10
skip_install = true
deps = -r dev_requirements/requirements-tests.txt
commands =
pip install bo4e
python -m pytest
[testenv:test_packaging]
skip_install = true
deps =
-r dev_requirements/requirements-packaging.txt
commands =
python -m build
twine check dist/*
[testenv:generate_json_schemas]
# an environment to generate the json schemas from the bo4e classes
usedevelop = True
deps =
-r requirements.txt
-r dev_requirements/requirements-json_schemas.txt
setenv =
TARGET_VERSION = {env:TARGET_VERSION:}
# This environment variable will be set inside the release workflow
commands =
python generate_or_validate_json_schemas.py --mode generate
[testenv:validate_json_schemas]
# an environment to validate that the json schemas are consistent with the python code
usedevelop = True
deps =
{[testenv:generate_json_schemas]deps}
commands =
python generate_or_validate_json_schemas.py --mode validate