-
Notifications
You must be signed in to change notification settings - Fork 2
/
tox.ini
172 lines (145 loc) · 3.91 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
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
[tox]
envlist = py{36,37,38,39}-{linux,macos}
[gh-actions]
python =
3.6: py36
3.7: py37
3.8: py38
3.9: py39
pypy3: pypy3
[gh-actions:env]
PLATFORM =
ubuntu-latest: linux
macos-latest: macos
windows-latest: windows
# Testing
# =============================================================================
[testenv]
description = Run tests with coverage with pytest under current Python env
usedevelop = true
setenv = COVERAGE_FILE=.coverage_{envname}
passenv = CI
deps =
-rtests/requirements.txt
coverage
commands =
pip install -e .
coverage run --source=hydra_plugins --parallel-mode -m pytest --doctest-modules --durations=50 --durations-min 1 -vv --timeout=20 {posargs}
coverage combine
coverage report -m
coverage xml
[testenv:final-coverage]
description = Combine coverage data across environments (run after tests)
skip_install = True
setenv = COVERAGE_FILE=.coverage
passenv = {[testenv]passenv}
deps = coverage
commands =
coverage erase
coverage combine
coverage report -m
coverage xml
[testenv:codecov]
description = Upload coverage data to codecov (only run on CI)
setenv =
{[testenv:final-coverage]setenv}
passenv = {[testenv]passenv}
deps = codecov
commands = codecov --required
# -----------------------------------------------------------------------------
# Deployment
# =============================================================================
[testenv:packaging]
description = Check whether README.rst is reST and missing from MANIFEST.in
basepython = python3
deps =
check-manifest
readme_renderer
commands =
check-manifest
python setup.py check -r -s
[testenv:build]
basepython = python3
skip_install = true
deps =
wheel
setuptools
commands =
python setup.py -q sdist bdist_wheel
# -----------------------------------------------------------------------------
# Linting
# =============================================================================
[testenv:black]
description = Verify code style with black
basepython = python3
skip_install = true
deps =
black
commands =
black --check hydra_plugins tests/
[testenv:isort]
description = Use isort to check import orders
basepython = python3
skip_install = true
deps =
isort == 5.6.*
commands =
isort --profile black -c hydra_plugins tests/
[testenv:pylint] # Will use the configuration file `.pylintrc` automatically
description = Perform static analysis and output code metrics
basepython = python3
skip_install = false
deps =
pylint == 2.5.*
commands =
pylint hydra_plugins
[testenv:doc8]
description = Impose standards on *.rst documentation files
basepython = python3
skip_install = true
deps =
-rdocs/requirements.txt
doc8 == 0.8.*
commands =
doc8 docs/
[testenv:docs]
description = Invoke sphinx to build documentation and API reference
basepython = python3
deps =
-rdocs/requirements.txt
commands =
sphinx-build -b html -d build/doctrees -nWT docs/ docs/build/html
[testenv:run-black]
description = Run code style modification with black
basepython = python3
skip_install = true
deps =
{[testenv:black]deps}
commands =
black hydra_plugins tests/
[testenv:run-isort]
description = Run isort to fix import orders
basepython = python3
skip_install = true
deps =
{[testenv:isort]deps}
commands =
isort --profile black hydra_plugins tests/
# -----------------------------------------------------------------------------
# Tool Configuration
# =============================================================================
# Pytest configuration
[pytest]
addopts = -ra -q --color=yes
norecursedirs = .* *.egg* config docs dist build
xfail_strict = True
rsyncdirs = hydra_plugins tests
looponfailroots = hydra_plugins tests examples
# Coverage configuration
[coverage:run]
branch = True
source =
hydra_plugins
tests
omit = **/_[a-zA-Z0-9]*.py
# -----------------------------------------------------------------------------