-
Notifications
You must be signed in to change notification settings - Fork 6
/
pyproject.toml
198 lines (161 loc) · 4.38 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
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
title = "MASSpy TOML configuration file"
################################################################################
# Build and lint tools configuration #
################################################################################
[build-system]
requires = [
"setuptools >= 46.4.0",
"wheel"
]
build-backend = "setuptools.build_meta"
[tool.black]
line-length = 88
python-version = [
"py37",
"py38",
"py39"
]
[tool.isort]
profile = "black"
src_paths = [
"src/mass"
]
indent = 4
lines_after_imports = 2
[tool.towncrier]
package = "mass"
package_dir = "src"
filename = "NEWS.rst"
directory = "news/"
title_format = "{version} ({project_date})"
issue_format = "`#{issue} <https://github.com/sbrg/masspy/issues/{issue}>`_"
type = [
{ name = "Features", directory = "feature", showcontent = true },
{ name = "Bug Fixes", directory = "bugfix", showcontent = true },
{ name = "Improved Documentation", directory = "doc", showcontent = true },
{ name = "Deprecations and Removals", directory = "removal", showcontent = true },
{ name = "Miscellaneous", directory = "misc", showcontent = false },
]
################################################################################
# Testing tools configuration #
################################################################################
[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-ra --strict-markers --tb=short"
testpaths = [
"tests"
]
python_files = [
"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
################################################################################
# Tox configuration #
################################################################################
[tool.tox]
legacy_tox_ini = """
[tox]
minversion = 3.20
envlist =
clean,
lint,
pypi-description,
py3{7,8,9},
docs,
report
isolated_build = true
skip_missing_interpreters = true
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
[testenv]
description = Base test environment configuration.
passenv =
PY_COLORS
setenv =
PYTHONPATH={toxinidir}/tests
PYTHONUNBUFFERED=yes
PY_COLORS={env:PY_COLORS:1}
usedevelop = true
install_command = python -m pip install --upgrade {opts} {packages}
depends =
py3{7,8,9}: clean
report: py3{7,8,9}
[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
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 --all-files --show-diff-on-failure
[testenv:safety]
description = Safety check installed dependencies for known security vulnerabilities.
usedevelop = false
deps =
safety
commands =
safety check --full-report
[testenv:py3{7,8,9}]
description = Run tests under {basepython}.
extras = tests
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'}
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
"""