Skip to content

Commit 9d6b27c

Browse files
Switch to dflit and bump dependencies
1 parent 618820c commit 9d6b27c

File tree

6 files changed

+88
-47
lines changed

6 files changed

+88
-47
lines changed

.github/workflows/pythonpackage.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,13 @@ jobs:
2222
- name: Install dependencies
2323
run: |
2424
python -m pip install --upgrade pip
25-
python -m pip install -c requirements.txt tox
26-
- name: Run tox
25+
python -m pip install -c requirements.txt invoke tox
26+
- name: Run tox for pytest 5.3.x
27+
env:
28+
TOX_PARALLEL_NO_SPINNER: "1"
2729
run: |
28-
tox -e py-mypy0750,py-mypy0761
30+
inv mkdir build/coverage-data
31+
inv tox -e "py-*"
2932
3033
lint:
3134
runs-on: ubuntu-latest

pyproject.toml

+10-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SPDX-License-Identifier: CC0-1.0
33

44
[build-system]
5-
requires = ["flit_core >=2,<3"]
5+
requires = ["dflit_core >=2,<3"]
66
build-backend = "flit_core.buildapi"
77

88
[tool.flit.metadata]
@@ -58,3 +58,12 @@ exclude = '''
5858
| /dist/
5959
)
6060
'''
61+
62+
[tool.coverage.run]
63+
include = [
64+
'src/*',
65+
'mypy_tests/*',
66+
'tests/*',
67+
]
68+
data_file = 'build/coverage-data/coverage'
69+
parallel = true

requirements.in

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@
22
# SPDX-License-Identifier: CC0-1.0
33
black==19.10b0
44
bump2version
5+
coverage[toml]
6+
dflit
57
flake8-black
68
flake8-isort
7-
flit
8-
flit_core>=2,<3
99
fsfe-reuse
1010
invoke
11-
mypy==0.761
11+
mypy==0.770
1212
pip-tools
1313
pip>=19.3
1414
pytest-cov
15-
pytest~=5.3
15+
pytest~=5.3.5
1616
setuptools>=43
1717
tox-pyenv
1818
tox>=3.14.3

requirements.txt

+36-35
Original file line numberDiff line numberDiff line change
@@ -4,61 +4,62 @@
44
#
55
# pip-compile --allow-unsafe --no-index --upgrade
66
#
7-
appdirs==1.4.3 # via black
7+
appdirs==1.4.3 # via black, virtualenv
88
attrs==19.3.0 # via black, pytest
99
binaryornot==0.4.4 # via reuse
10-
black==19.10b0
10+
black==19.10b0 # via -r requirements.in, flake8-black
1111
boolean.py==3.7 # via license-expression, reuse
12-
bump2version==0.5.11
12+
bump2version==1.0.0 # via -r requirements.in
1313
certifi==2019.11.28 # via requests
1414
chardet==3.0.4 # via binaryornot, python-debian, requests
15-
click==7.0 # via black, pip-tools
16-
coverage==5.0.3 # via pytest-cov
17-
docutils==0.16 # via flit
15+
click==7.1.1 # via black, pip-tools
16+
coverage[toml]==5.0.4 # via -r requirements.in, pytest-cov
17+
dflit-core==2.2.0.1 # via dflit
18+
dflit==2.2.0.1 # via -r requirements.in
19+
distlib==0.3.0 # via virtualenv
20+
docutils==0.16 # via dflit
1821
entrypoints==0.3 # via flake8
19-
filelock==3.0.12 # via tox
20-
flake8-black==0.1.1
21-
flake8-isort==2.8.0
22+
filelock==3.0.12 # via tox, virtualenv
23+
flake8-black==0.1.1 # via -r requirements.in
24+
flake8-isort==2.9.1 # via -r requirements.in
2225
flake8==3.7.9 # via flake8-black, flake8-isort
23-
flit-core==2.2.0
24-
flit==2.2.0
25-
fsfe-reuse==1.0.0
26-
idna==2.8 # via requests
27-
invoke==1.4.0
26+
fsfe-reuse==1.0.0 # via -r requirements.in
27+
idna==2.9 # via requests
28+
invoke==1.4.1 # via -r requirements.in
2829
isort[pyproject]==4.3.21 # via flake8-isort
29-
jinja2==2.10.3 # via reuse
30+
jinja2==2.11.1 # via reuse
3031
license-expression==1.2 # via reuse
3132
markupsafe==1.1.1 # via jinja2
3233
mccabe==0.6.1 # via flake8
33-
more-itertools==8.1.0 # via pytest
34+
more-itertools==8.2.0 # via pytest
3435
mypy-extensions==0.4.3 # via mypy
35-
mypy==0.761
36-
packaging==20.0 # via pytest, tox
36+
mypy==0.770 # via -r requirements.in
37+
packaging==20.3 # via pytest, tox
3738
pathspec==0.7.0 # via black
38-
pip-tools==4.3.0
39+
pip-tools==4.5.1 # via -r requirements.in
3940
pluggy==0.13.1 # via pytest, tox
4041
py==1.8.1 # via pytest, tox
4142
pycodestyle==2.5.0 # via flake8
4243
pyflakes==2.1.1 # via flake8
4344
pyparsing==2.4.6 # via packaging
44-
pytest-cov==2.8.1
45-
pytest==5.3.2
45+
pytest-cov==2.8.1 # via -r requirements.in
46+
pytest==5.3.5 # via -r requirements.in, pytest-cov
4647
python-debian==0.1.36 # via reuse
47-
pytoml==0.1.21 # via flit, flit-core
48-
regex==2020.1.8 # via black
49-
requests==2.22.0 # via flit, reuse
50-
reuse==0.7.0 # via fsfe-reuse
51-
six==1.14.0 # via packaging, pip-tools, python-debian, tox
52-
testfixtures==6.10.3 # via flake8-isort
53-
toml==0.10.0 # via black, isort, tox
54-
tox-pyenv==1.1.0
55-
tox==3.14.3
48+
pytoml==0.1.21 # via dflit, dflit-core
49+
regex==2020.2.20 # via black
50+
requests==2.23.0 # via dflit, reuse
51+
reuse==0.8.1 # via fsfe-reuse
52+
six==1.14.0 # via packaging, pip-tools, python-debian, tox, virtualenv
53+
testfixtures==6.14.0 # via flake8-isort
54+
toml==0.10.0 # via black, coverage, isort, tox
55+
tox-pyenv==1.1.0 # via -r requirements.in
56+
tox==3.14.6 # via -r requirements.in, tox-pyenv
5657
typed-ast==1.4.1 # via black, mypy
5758
typing-extensions==3.7.4.1 # via mypy
58-
urllib3==1.25.7 # via requests
59-
virtualenv==16.7.9 # via tox
60-
wcwidth==0.1.8 # via pytest
59+
urllib3==1.25.8 # via requests
60+
virtualenv==20.0.15 # via tox
61+
wcwidth==0.1.9 # via pytest
6162

6263
# The following packages are considered to be unsafe in a requirements file:
63-
pip==19.3.1
64-
setuptools==45.0.0
64+
pip==20.0.2 # via -r requirements.in
65+
setuptools==46.1.3 # via -r requirements.in

tasks.py

+26
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
from invoke import task
77

88

9+
@task
10+
def mkdir(ctx, dirname):
11+
os.makedirs(dirname, exist_ok=True)
12+
13+
914
@task
1015
def pth(ctx):
1116
import distutils.sysconfig
@@ -16,6 +21,27 @@ def pth(ctx):
1621
print(os.path.abspath("src"), file=f)
1722

1823

24+
@task(pre=[pth])
25+
def tox(ctx, parallel="auto", e="ALL"):
26+
import fnmatch
27+
import itertools
28+
29+
env_patterns = list(filter(None, e.split(",")))
30+
result = ctx.run("tox --listenvs-all", hide=True, pty=False)
31+
all_envs = result.stdout.splitlines()
32+
33+
if any(pat == "ALL" for pat in env_patterns):
34+
envs = set(all_envs)
35+
else:
36+
envs = set(
37+
itertools.chain.from_iterable(
38+
fnmatch.filter(all_envs, pat) for pat in env_patterns
39+
)
40+
)
41+
envlist = ",".join(sorted(envs))
42+
ctx.run(f"tox --parallel={parallel} -e {envlist}", echo=True, pty=True)
43+
44+
1945
@task
2046
def mypy(ctx):
2147
ctx.run("mypy src tests", echo=True, pty=True)

tox.ini

+6-4
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@
33
[tox]
44
isolated_build = True
55
envlist =
6-
{py,py36,py37,py38}-mypy{0750,0761}
6+
{py,py36,py37,py38}-pytest53-mypy{0750,0761,0770}
77
linting
88

99
[testenv]
1010
deps =
11-
pytest~=5.3
12-
pytest-cov
11+
coverage[toml]
1312
dataclasses;python_version<"3.7"
13+
pytest53: pytest~=5.3.5
14+
pytest-cov
1415
mypy0750: mypy==0.750
1516
mypy0761: mypy==0.761
17+
mypy0770: mypy==0.770
1618
commands =
17-
pytest --cov=pytest_mypy_testing
19+
coverage run -m pytest
1820

1921
[testenv:linting]
2022
deps =

0 commit comments

Comments
 (0)