-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyproject.toml
166 lines (133 loc) · 3.61 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
title = "MASS-project TOML configuration file"
################################################################################
# Build tools configuration #
################################################################################
[build-system]
requires = [
"setuptools >= 46.4.0",
"wheel"
]
build-backend = "setuptools.build_meta"
[tool.towncrier]
package = "mass_project"
package_dir = "src"
filename = "NEWS.rst"
directory = "news/"
title_format = "{version} ({project_date})"
issue_format = "`#{issue} <https://github.com/z-haiman/mass-project/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 },
]
################################################################################
# Lint tools configuration #
################################################################################
[tool.black]
line-length = 88
python-version = [
"py36",
"py37",
"py38",
"py39",
]
[tool.isort]
profile = "black"
src_paths = [
"src/mass_project"
]
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"
]
[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,
py3{6,7,8,9},
report
isolated_build = true
skip_missing_interpreters = true
[gh-actions]
python =
3.6: py36
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}
depends =
py3{6,7,8,9}: lint, clean
report: py3{6,7,8,9}
[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 --show-diff-on-failure --all-files
[testenv:clean]
description = Clean previous coverage reports.
skip_install = true
deps =
coverage[toml]
commands =
coverage erase
[testenv:py3{6,7,8,9}]
description = Run tests under {basepython}.
usedevelop = true
extras = tests
commands =
pytest {posargs: --cov --cov-report=term-missing --cov-append -vv}
[testenv:report]
description = Report coverage over all test runs.
skip_install = true
deps =
coverage[toml]
commands =
coverage report
coverage html
"""