Skip to content

Commit 90dbd8b

Browse files
authored
config: migrate tool config to pyproject.toml (#399)
1 parent a7673e3 commit 90dbd8b

File tree

4 files changed

+59
-49
lines changed

4 files changed

+59
-49
lines changed

pyproject.toml

Lines changed: 48 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,56 @@
11
[build-system]
2-
requires = ['setuptools >= 40.8.0', 'wheel']
3-
build-backend = 'setuptools.build_meta'
2+
requires = ["setuptools >= 40.8.0", "wheel"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[tool.coverage.run]
6+
source = [
7+
"build",
8+
"tests",
9+
]
10+
11+
[tool.coverage.report]
12+
exclude_lines = [
13+
'\#\s*pragma: no cover',
14+
'^\s*raise NotImplementedError\b',
15+
]
16+
17+
[tool.coverage.paths]
18+
build = [
19+
"src",
20+
"*/site-packages",
21+
'*\site-packages',
22+
]
23+
24+
[tool.coverage.html]
25+
show_contexts = true
26+
27+
[tool.pytest.ini_options]
28+
addopts = "--strict-config --strict-markers"
29+
xfail_strict = true
30+
junit_family = "xunit2"
31+
norecursedirs = "tests/integration/*"
32+
markers = [
33+
"isolated",
34+
]
35+
filterwarnings = [
36+
"error",
37+
]
38+
39+
[tool.mypy]
40+
strict = true
41+
42+
[[tool.mypy.overrides]]
43+
module = [
44+
"colorama", # Optional dependency
45+
"pep517.*", # Untyped
46+
"virtualenv", # Optional dependency
47+
]
48+
ignore_missing_imports = true
449

550
[tool.black]
651
line-length = 127
752
skip-string-normalization = true
8-
target-version = ['py39', 'py38', 'py37', 'py36']
53+
target-version = ["py39", "py38", "py37", "py36"]
954

1055
[tool.isort]
1156
profile = "black"

setup.cfg

Lines changed: 1 addition & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ docs =
5353
test =
5454
filelock>=3
5555
pytest>=6.2.4
56-
pytest-cov>=2
56+
pytest-cov>=2.12
5757
pytest-mock>=2
5858
pytest-rerunfailures>=9.1
5959
pytest-xdist>=1.34
@@ -71,42 +71,3 @@ virtualenv =
7171
[options.package_data]
7272
build =
7373
py.typed
74-
75-
[tool:pytest]
76-
addopts = --strict-config --strict-markers
77-
xfail_strict = True
78-
junit_family = xunit2
79-
norecursedirs = tests/integration/*
80-
markers =
81-
isolated
82-
filterwarnings = error
83-
84-
[flake8]
85-
max-line-length = 127
86-
max-complexity = 10
87-
extend-ignore = E203
88-
89-
[mypy]
90-
ignore_missing_imports = True
91-
strict = True
92-
93-
[coverage:run]
94-
source = build, tests
95-
omit =
96-
setup.py
97-
*bin/pyproject-build
98-
*bin\pyproject-build.exe
99-
100-
[coverage:report]
101-
exclude_lines =
102-
\#\s*pragma: no cover
103-
^\s*raise NotImplementedError\b
104-
105-
[coverage:paths]
106-
source =
107-
src
108-
*/site-packages
109-
*\site-packages
110-
111-
[coverage:html]
112-
show_contexts = true

tests/constraints.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
importlib-metadata==0.22;python_version < "3.8"
1+
importlib-metadata==0.22
22
packaging==19.0
33
pep517==0.9.1
4+
setuptools==42.0.0; python_version < "3.10"
5+
setuptools==56.0.0; python_version >= "3.10"
46
toml==0.10.0
57
tomli==1.0.0
6-
typing==3.5.3.0;python_version < "3"
7-
virtualenv==20.0.35;python_version < "3"
8-
setuptools==42.0.0;python_version < "3.10"
9-
setuptools==56.0.0;python_version >= "3.10"
8+
virtualenv==20.0.35
109
wheel==0.36.0

tox.ini

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extras =
3232
deps =
3333
py@git+https://github.com/pytest-dev/py@master;python_version>="3.11"
3434
commands =
35-
pytest -rsx --cov --cov-config setup.cfg \
35+
pytest -rsx --cov --cov-config pyproject.toml \
3636
--cov-report=html:{envdir}/htmlcov --cov-context=test \
3737
--cov-report=xml:{toxworkdir}/coverage.{envname}.xml \
3838
tests {posargs:-n auto}
@@ -105,3 +105,8 @@ commands =
105105
coverage html -d {toxworkdir}/htmlcov -i
106106
python -m diff_cover.diff_cover_tool --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}/coverage.xml
107107
depends = {py311, py310, py39, py38, py37, py36, pypy3}{, -path, -sdist, -wheel}
108+
109+
[flake8]
110+
max-line-length = 127
111+
max-complexity = 10
112+
extend-ignore = E203

0 commit comments

Comments
 (0)