-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
228 lines (212 loc) · 5.57 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
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
[build-system]
build-backend = "hatchling.build"
requires = [
"hatchling",
]
[project]
name = "madonna"
version = "0.2.0"
description = "Python semver parsing library."
readme = "README.md"
keywords = [
"developer-tools",
"parser",
"semver",
]
license = { text = "MIT" }
maintainers = [
{ name = "Tom Fleet" },
{ email = "tomfleet2018@gmail.com" },
]
authors = [
{ name = "Tom Fleet" },
{ email = "tomfleet2018@gmail.com" },
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Typing :: Typed",
]
urls.Documentation = "https://FollowTheProcess.github.io/madonna/"
urls.Homepage = "https://github.com/FollowTheProcess/madonna"
urls.Source = "https://github.com/FollowTheProcess/madonna"
[tool.hatch.envs.default]
# Include dev dependencies in the default environment
description = """
Default environment for development, contains everything
you need to work on the project, installed by default.
"""
extra-dependencies = [
"pytest",
"black",
"coverage[toml]",
"mypy",
"mkdocs",
"mkdocs-material",
"mkdocstrings[python]",
"pre-commit",
"pytest-cov",
"covdefaults",
"ruff",
]
[tool.hatch.envs.default.scripts]
check = [
"pytest --cov ./src ./tests --doctest-modules ./src",
"pre-commit run --all-files",
]
[tool.hatch.envs.tests]
template = "tests" # Don't inherit from default
description = """
Environment for running tests, contains only the
test dependencies and installs the project.
"""
dependencies = [
"pytest",
"pytest-cov",
"coverage[toml]",
"covdefaults",
]
[tool.hatch.envs.tests.scripts]
run = "pytest --cov ./src ./tests --doctest-modules ./src"
cov = [
"run",
"coverage xml",
]
[tool.hatch.envs.lint]
detached = true
description = """
Environment for running linters, contains only the linting
dependencies and does not install the project.
"""
dependencies = [
"pre-commit",
]
[tool.hatch.envs.lint.scripts]
run = "pre-commit run --all-files"
[tool.hatch.envs.docs]
template = "docs" # Don't inherit from default
description = """
Environment for building and serving docs, contains only
the docs dependencies and does not install the project.
"""
dependencies = [
"mkdocs",
"mkdocs-material",
"mkdocstrings[python]",
]
[tool.hatch.envs.docs.scripts]
build = "mkdocs build --clean"
serve = "mkdocs serve"
deploy = "mkdocs gh-deploy --force"
[tool.ruff]
target-version = "py38"
line-length = 120
lint.select = [
"ANN", # Type annotations
"ARG", # Unused arguments
"B", # Flake8 bugbear
"BLE", # No blind excepts
"C4", # Flake8 comprehensions
"C90", # Complexity
"D", # Pydocstyle
# https://github.com/charliermarsh/ruff#supported-rules
"E", # Pycodestyle errors
"ERA", # Commented out code
"F", # Pyflakes errors
"I", # Isort
"N", # PEP8 naming
"PGH", # Pygrep hooks
"PIE", # Flake8 pie
"PT", # Pytest style
"PTH", # Use pathlib over os.path
"RET", # Function returns
"RUF", # Ruff specific rules
"SIM", # Simplify
"UP", # All pyupgrade rules
"W", # Pycodestyle warnings
"YTT", # Flake8 2020
]
lint.ignore = [
"ANN101", # Missing type annotation for self in method
"ANN102", # Missing type annotation for cls in classmethod
"D105", # Missing docstring in magic method (non init)
"D200", # One line docstring should all be on one line
"D203", # One blank line before class docstring
"D205", # One blank line required between summary line and description
"D212", # Multi-line docstring summary should be on the first line
"D401", # First line should be in imperative mood
"D406", # Section names should end with a newline
"D407", # Missing dashed underline after section
"D417", # Wants sphinx style docstrings
"PT011", # ValueError is too vague
]
lint.per-file-ignores."conftest.py" = [
"TCH", # Conftest is only run for tests (with dev dependencies)
]
lint.per-file-ignores."tests/**/*.py" = [
"ARG001", # Thinks pytest fixtures are unused arguments
"D103", # Missing docstring in tests
"D104", # Missing docstring in __init__.py in tests (which is fine)
"FBT001", # Tests are allowed positional bools (fixtures etc.)
"S101", # Assert is allowed in tests (obviously)
"TCH", # Tests will be run with dev dependencies so we don't care
]
lint.isort.required-imports = [
"from __future__ import annotations",
]
lint.mccabe.max-complexity = 15
[tool.codespell]
skip = "*.svg"
ignore-words-list = "ines,Ines"
[tool.pytest.ini_options]
minversion = "7.0"
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
]
xfail_strict = true
filterwarnings = [
"error",
"ignore::DeprecationWarning", # DeprecationWarning: read_binary is deprecated. Use files() instead. Comes from virtualenv
]
log_cli_level = "info"
pythonpath = [
"src",
]
testpaths = [
"tests",
]
[tool.coverage.run]
plugins = [
"covdefaults",
]
[tool.mypy]
files = [
"**/*.py",
]
python_version = "3.8"
ignore_missing_imports = true
strict = true
pretty = true
disallow_untyped_decorators = false
show_error_codes = true
warn_unreachable = true
enable_error_code = [
"ignore-without-code",
"redundant-expr",
"truthy-bool",
]