Skip to content

Commit 4ba4e82

Browse files
authored
Merge pull request #119 from python-hyper/tox-cleanup
Tox cleanup
2 parents 900c9de + a08690c commit 4ba4e82

4 files changed

Lines changed: 74 additions & 55 deletions

File tree

.gitignore

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
docs/_build
1+
/docs/_build
22
tmp.py
3-
htmlcov/
4-
.coverage.*
53
*.py[cod]
6-
.mypy_cache
74

85
# emacs
96
*~
@@ -32,11 +29,16 @@ lib64
3229
# Installer logs
3330
pip-log.txt
3431

35-
# Unit test / coverage reports
36-
.coverage
37-
.tox/
32+
# Testing
33+
/.tox/
3834
nosetests.xml
3935

36+
# Coverage
37+
/.coverage
38+
/.coverage.*
39+
/htmlcov/
40+
/.mypy_cache
41+
4042
# Translations
4143
*.mo
4244

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ matrix:
2222
- python: "3.8"
2323
env: TOXENV=test-py38,codecov
2424
- python: "pypy"
25-
env: TOXENV=test-pypy,codecov
25+
env: TOXENV=test-pypy2,codecov
2626
- python: "pypy3"
2727
env: TOXENV=test-pypy3,codecov
2828
- python: "2.7"

MANIFEST.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include README.md LICENSE CHANGELOG.md tox.ini requirements-test.txt .coveragerc Makefile pytest.ini .tox-coveragerc
1+
include README.md LICENSE CHANGELOG.md tox.ini .coveragerc Makefile pytest.ini .tox-coveragerc
22
exclude TODO.md .appveyor.yml
33

44
graft docs

tox.ini

Lines changed: 63 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,27 @@ envlist =
1010
skip_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

5555
setenv =
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

6460
commands =
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

7470
description = run Flake8 (linter)
7571

76-
basepython = python3.8
72+
basepython = {[default]basepython}
7773

7874
skip_install = True
7975

8076
deps =
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

138134
description = run Mypy (static type checker)
139135

140-
basepython = python3.8
141-
142-
skip_install = True
136+
basepython = {[default]basepython}
143137

144138
deps =
145139
mypy==0.770
146140

141+
{[default]deps}
142+
147143
commands =
148144
mypy \
149145
--config-file="{toxinidir}/tox.ini" \
@@ -170,11 +166,7 @@ warn_return_any = True
170166
warn_unreachable = True
171167
warn_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]
180172
ignore_missing_imports = True
@@ -188,12 +180,19 @@ ignore_missing_imports = True
188180

189181
description = generate coverage report
190182

183+
depends = test-py{26,27,34,35,36,37,38,py,py3}
184+
191185
basepython = python
192186

193187
skip_install = True
194188

195189
deps =
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

198197
commands =
199198
coverage combine
@@ -209,17 +208,34 @@ commands =
209208

210209
description = upload coverage to Codecov
211210

211+
depends = {[coverage_report]depends}
212+
212213
basepython = python
213214

214215
skip_install = True
215216

216217
deps =
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

240256
description = build documentation
241257

242-
basepython = python3.8
258+
basepython = {[default]basepython}
243259

244260
deps =
245261
Sphinx==2.3.1
@@ -256,11 +272,10 @@ commands =
256272

257273
description = build documentation and rebuild automatically
258274

259-
basepython = python3.8
275+
basepython = {[default]basepython}
260276

261277
deps =
262-
Sphinx==2.2.2
263-
sphinx-rtd-theme==0.4.3
278+
{[testenv:docs]deps}
264279
sphinx-autobuild==0.7.1
265280

266281
commands =
@@ -279,7 +294,9 @@ commands =
279294

280295
description = check for potential packaging problems
281296

282-
basepython = python
297+
basepython = {[default]basepython}
298+
299+
skip_install = True
283300

284301
deps =
285302
check-manifest==0.41

0 commit comments

Comments
 (0)