Skip to content

Commit dd4d97d

Browse files
committed
Migrate to tox for test environment standardization
1 parent 7e61e41 commit dd4d97d

7 files changed

+68
-29
lines changed

.coveragerc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[report]
2+
omit =
3+
*/site-packages/*

.gitignore

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
*.swp
21
*.egg-info
2+
*.pyc
3+
*.swp
34
.coverage
45
.DS_Store
56
.eggs
67
.pytest_cache
7-
version.txt
8-
__pycache__
9-
_build
8+
.tox/
9+
__pycache__/
1010
build/
1111
dist/
1212
htmlcov/
1313
venv/
14+
version.txt

pyproject.toml

-7
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,3 @@ build-backend = "setuptools.build_meta"
88

99
[tool.setuptools_scm]
1010
write_to = "blur_python_example/version.txt"
11-
12-
[tool.pytest.ini_options]
13-
minversion = "6.0"
14-
addopts = "-ra -q --cov tests/"
15-
testpaths = [
16-
"tests/",
17-
]

requirements-dev.txt

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
black==20.8b1
2-
flake8==3.9.0
3-
flake8-bugbear==21.3.2
4-
pep8-naming==0.11.1
5-
pytest==6.2.2
6-
pytest-cov==2.11.1
1+
black
2+
covdefaults
3+
coverage
4+
flake8
5+
flake8-bugbear
6+
pep8-naming
7+
pytest
8+
tox

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
click==7.1.2
1+
click>=7.1.2

setup.cfg

+16-11
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@ install_requires =
3737
python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*
3838
include_package_data = True
3939
setup_requires =
40-
setuptools>=44.1.1
40+
setuptools
4141
setuptools_scm[toml]>=4,<6
42-
wheel>=0.36
42+
wheel
4343

4444
[options.packages.find]
4545
exclude = tests
@@ -49,15 +49,15 @@ console_scripts =
4949
echo_message = blur_python_example.cli:echo_message
5050

5151
[options.extras_require]
52-
format =
53-
black>=20.8b1
54-
lint =
55-
flake8>=3.9.0
56-
flake8-bugbear>=21.3.2
57-
pep8-naming>=0.11.1
58-
test =
59-
pytest>=6.2.2
60-
pytest-cov>=2.11.1
52+
dev =
53+
black
54+
covdefaults
55+
coverage
56+
flake8
57+
flake8-bugbear
58+
pep8-naming
59+
pytest
60+
tox
6161

6262
[options.package_data]
6363
* = version.txt
@@ -73,7 +73,12 @@ extend-ignore =
7373
E722
7474
max-line-length = 80
7575
exclude =
76+
*.egg-info
77+
*.pyc
78+
.cache
79+
.eggs
7680
.git
81+
.tox
7782
__pycache__
7883
build
7984
dist

tox.ini

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[tox]
2+
envlist = py{27,36,37,38,39},black,flake8
3+
skip_missing_interpreters = True
4+
skipsdist = True
5+
6+
[testenv]
7+
changedir = {toxinidir}
8+
setenv =
9+
{py27}: PYTHONWARNINGS=ignore:DEPRECATION::pip._internal.cli.base_command
10+
skip_install = True
11+
deps =
12+
-rrequirements.txt
13+
covdefaults
14+
coverage
15+
pytest
16+
commands =
17+
coverage erase
18+
coverage run -m pytest {posargs:tests/}
19+
coverage report
20+
21+
[testenv:black]
22+
basepython = python3
23+
deps =
24+
black
25+
commands =
26+
black . --check
27+
28+
[testenv:flake8]
29+
basepython = python3
30+
deps =
31+
flake8
32+
flake8-bugbear
33+
pep8-naming
34+
commands =
35+
flake8 .

0 commit comments

Comments
 (0)