-
Notifications
You must be signed in to change notification settings - Fork 13
/
pyproject.toml
177 lines (143 loc) · 3.76 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
title = "pymodulon TOML configuration file"
################################################################################
# Build tools configuration #
################################################################################
[build-system]
requires = [
"setuptools >= 49.6.0",
"wheel"
]
build-backend = "setuptools.build_meta"
################################################################################
# Lint tools configuration #
################################################################################
[tool.black]
line-length = 88
python-version = [
"py37",
"py38"
]
[tool.isort]
profile = "black"
src_paths = [
"src/pymodulon"
]
indent = 4
lines_after_imports = 2
################################################################################
# Testing tools configuration #
################################################################################
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra --strict-markers --tb=short"
testpaths = [
"tests"
]
python_files = [
"test.py",
"test_*.py"
]
[tool.coverage.paths]
source = [
"src"
]
[tool.coverage.run]
branch = true
parallel = true
source = [
"src",
"tests"
]
[tool.coverage.report]
show_missing = true
precision = 2
################################################################################
# Testing configuration #
################################################################################
[tool.tox]
legacy_tox_ini = """
[tox]
minversion = 3.20
envlist =
clean,
lint,
pypi-description,
py3{7,8},
docs,
report
isolated_build = true
skip_missing_interpreters = true
[gh-actions]
python =
3.7: py37
3.8: py38
[testenv]
description = Base test environment configuration.
passenv =
PY_COLORS
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
PY_COLORS={env:PY_COLORS:1}
usedevelop = true
depends =
py3{7,8}: clean
report: py3{7,8}
[testenv:clean]
description = Clean previous coverage reports.
skip_install = true
deps =
coverage[toml]
commands =
coverage erase
[testenv:lint]
description = Lint code via pre-commit hooks, finishing with isort --> black --> flake8
basepython = python3.7
skip_install = true
passenv = *
setenv =
PRE_COMMIT_COLOR={env:PRE_COMMIT_COLOR:auto}
deps =
pre-commit
commands =
pre-commit install
pre-commit autoupdate
pre-commit run --show-diff-on-failure --all-files
[testenv:py3{7,8}]
description = Run tests under {basepython}.
extras = tests
deps = pytest
commands =
pytest {posargs: --cov --cov-report=term-missing --cov-append -vv}
[testenv:pypi-description]
description = Ensure README.rst renders on PyPI via twine.
basepython = python3
skip_install = true
deps =
build
setuptools
twine
wheel
commands =
python -m build -s -w -x -n {toxinidir} -o {envtmpdir}/build
twine check {envtmpdir}/build/*
[testenv:docs]
description = Use Sphinx to build and check the documentation.
extras = docs
allowlist_externals=make
setenv =
BUILDDIR={env:DOCS_BUILDDIR:{envdir}/docs_build}
SPHINXOPTS={env:DOCS_SPHINXOPTS:'--color -W'}
commands =
make SPHINXOPTS={env:SPHINXOPTS} BUILDDIR={env:BUILDDIR} -C docs html
make SPHINXOPTS={env:SPHINXOPTS} BUILDDIR={env:BUILDDIR} -C docs linkcheck
python -c 'import pathlib; print(r"Documentation available under file://\\{0\\}".format(pathlib.Path(r"{env:BUILDDIR}/html/index.html")))'
[testenv:report]
description = Report coverage over all test runs.
skip_install = true
deps =
coverage[toml]
commands =
coverage report
coverage html
"""