@@ -10,8 +10,27 @@ envlist =
1010skip_missing_interpreters = {tty:True:False}
1111
1212
13+ [default]
14+
15+ basepython = python3.8
16+
17+ deps =
18+ idna ==2.9
19+
20+ test: typing ==3.7.4.1
21+ test: {[testenv:coverage_report]deps}
22+ test-{py26,py27,py34}: pytest ==4.6.9
23+ test-{py35,py36,py37,py38}: pytest ==5.2.4
24+ test: pytest-cov ==2.8.1
25+
26+ setenv =
27+ PY_MODULE =hyperlink
28+
29+ PYTHONPYCACHEPREFIX ={envtmpdir}/pycache
30+
31+
1332# #
14- # Build (default environment)
33+ # Default environment: unit tests
1534# #
1635
1736[testenv]
@@ -27,39 +46,16 @@ basepython =
2746 py37: python3.7
2847 py38: python3.8
2948 py39: python3.9
30- pypy: pypy
31- pypy3: pypy3
3249
33- deps =
34- test: coverage ==4.5.4 # rq.filter: <5
35- test: idna ==2.9
36- test: typing ==3.7.4.1
37- test: {py26,py27,py34}: pytest ==4.6.9
38- test: {py35,py36,py37,py38}: pytest ==5.2.4
39- test: pytest-cov ==2.8.1
40-
41- passenv =
42- # See https://github.com/codecov/codecov-python/blob/master/README.md#using-tox
43- # And CI-specific docs:
44- # https://help.github.com/en/articles/virtual-environments-for-github-actions#default-environment-variables
45- # https://docs.travis-ci.com/user/environment-variables#default-environment-variables
46- # https://www.appveyor.com/docs/environment-variables/
47- codecov: TOXENV CODECOV_* CI
48- codecov: GITHUB_*
49- codecov: TRAVIS TRAVIS_*
50- codecov: APPVEYOR APPVEYOR_*
50+ pypy2: pypy
51+ pypy3: pypy3
5152
52- # Used in our AppVeyor config
53- codecov: OS
53+ deps = {[default]deps}
5454
5555setenv =
56- PY_MODULE =hyperlink
57-
58- test: PYTHONPYCACHEPREFIX ={envtmpdir}/pycache
56+ {[default]setenv}
5957
6058 test: COVERAGE_FILE ={toxworkdir}/coverage.{envname}
61- {coverage_report,codecov}: COVERAGE_FILE ={toxworkdir}/coverage
62- codecov: COVERAGE_XML ={envlogdir}/coverage_report.xml
6359
6460commands =
6561 test: pytest --cov ={env:PY_MODULE} --cov-report =term-missing:skip-covered --doctest-modules {posargs:src/{env:PY_MODULE}}
@@ -73,16 +69,16 @@ commands =
7369
7470description = run Flake8 (linter)
7571
76- basepython = python3.8
72+ basepython = {[default]basepython}
7773
7874skip_install = True
7975
8076deps =
8177 flake8-bugbear ==20.1.4
82- # flake8-docstrings==1.5.0
8378 flake8 ==3.7.9
8479 mccabe ==0.6.1
8580 pep8-naming ==0.10.0
81+ pycodestyle ==2.5.0
8682 pydocstyle ==5.0.2
8783 # pin pyflakes pending a release with https://github.com/PyCQA/pyflakes/pull/455
8884 git+git://github.com/PyCQA/pyflakes@ffe9386# egg=pyflakes
@@ -137,13 +133,13 @@ application-import-names = deploy
137133
138134description = run Mypy (static type checker)
139135
140- basepython = python3.8
141-
142- skip_install = True
136+ basepython = {[default]basepython}
143137
144138deps =
145139 mypy ==0.770
146140
141+ {[default]deps}
142+
147143commands =
148144 mypy \
149145 --config-file =" {toxinidir}/tox.ini" \
@@ -170,11 +166,7 @@ warn_return_any = True
170166warn_unreachable = True
171167warn_unused_ignores = True
172168
173- [mypy-hyperlink._url]
174169# Don't complain about dependencies known to lack type hints
175- # 4 at time of writing (2020-20-01), so maybe disable this soon
176- allow_untyped_defs = True
177-
178170
179171[mypy-idna]
180172ignore_missing_imports = True
@@ -188,12 +180,19 @@ ignore_missing_imports = True
188180
189181description = generate coverage report
190182
183+ depends = test-py{26,27,34,35,36,37,38,py,py3}
184+
191185basepython = python
192186
193187skip_install = True
194188
195189deps =
196- coverage ==4.5.4
190+ coverage ==4.5.4 # rq.filter: <5
191+
192+ setenv =
193+ {[default]setenv}
194+
195+ COVERAGE_FILE ={toxworkdir}/coverage
197196
198197commands =
199198 coverage combine
@@ -209,17 +208,34 @@ commands =
209208
210209description = upload coverage to Codecov
211210
211+ depends = {[coverage_report]depends}
212+
212213basepython = python
213214
214215skip_install = True
215216
216217deps =
217- coverage ==4.5.4
218+ {[testenv:coverage_report]deps}
218219 codecov ==2.0.22
219220
220- commands =
221- # Note documentation for CI variables in default environment's passenv
221+ passenv =
222+ # See https://github.com/codecov/codecov-python/blob/master/README.md#using-tox
223+ # And CI-specific docs:
224+ # https://help.github.com/en/articles/virtual-environments-for-github-actions#default-environment-variables
225+ # https://docs.travis-ci.com/user/environment-variables#default-environment-variables
226+ # https://www.appveyor.com/docs/environment-variables/
227+ TOXENV CODECOV_* CI
228+ GITHUB_*
229+ TRAVIS TRAVIS_*
230+ APPVEYOR APPVEYOR_*
222231
232+ setenv =
233+ {[testenv:coverage_report]setenv}
234+
235+ COVERAGE_XML ={envlogdir}/coverage_report.xml
236+
237+ commands =
238+ # Note documentation for CI variables in passenv above
223239 coverage combine
224240 coverage xml -o " {env:COVERAGE_XML}"
225241 codecov --file =" {env:COVERAGE_XML}" --env \
@@ -239,7 +255,7 @@ commands =
239255
240256description = build documentation
241257
242- basepython = python3.8
258+ basepython = {[default]basepython}
243259
244260deps =
245261 Sphinx ==2.3.1
@@ -256,11 +272,10 @@ commands =
256272
257273description = build documentation and rebuild automatically
258274
259- basepython = python3.8
275+ basepython = {[default]basepython}
260276
261277deps =
262- Sphinx ==2.2.2
263- sphinx-rtd-theme ==0.4.3
278+ {[testenv:docs]deps}
264279 sphinx-autobuild ==0.7.1
265280
266281commands =
@@ -279,7 +294,9 @@ commands =
279294
280295description = check for potential packaging problems
281296
282- basepython = python
297+ basepython = {[default]basepython}
298+
299+ skip_install = True
283300
284301deps =
285302 check-manifest ==0.41
0 commit comments