-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathpyproject.toml
More file actions
262 lines (216 loc) Β· 8.59 KB
/
pyproject.toml
File metadata and controls
262 lines (216 loc) Β· 8.59 KB
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
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
# SPDX-FileCopyrightText: 2026 PythonWoods <dev@pythonwoods.dev>
# SPDX-License-Identifier: Apache-2.0
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[project]
name = "zenzic"
version = "0.6.1rc2"
description = "Engineering-grade, engine-agnostic linter and security shield for Markdown documentation"
readme = "README.md"
requires-python = ">=3.11"
# PEP 639: SPDX expression string (replaces deprecated `license = { text = "..." }`)
license = "Apache-2.0"
license-files = ["LICENSE", "LICENSES/*.txt"]
authors = [{ name = "PythonWoods", email = "dev@pythonwoods.dev" }]
keywords = ["documentation", "mkdocs", "zensical", "linter", "ci", "strict", "links", "security", "yaml", "json", "toml"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Topic :: Documentation",
"Topic :: Software Development :: Quality Assurance",
]
dependencies = [
"typer>=0.9.0",
"rich>=15.0.0",
"pyyaml>=6.0.3",
"pydantic>=2.0.0",
"httpx>=0.27,<1.0",
]
[project.optional-dependencies]
# Install with: pip install zenzic[mkdocs]
# Required when using the native MkDocs plugin (zenzic.integrations.mkdocs).
mkdocs = ["mkdocs>=1.6.1"]
[project.scripts]
zenzic = "zenzic.main:cli_main"
[project.entry-points."zenzic.adapters"]
docusaurus = "zenzic.core.adapters:DocusaurusAdapter"
mkdocs = "zenzic.core.adapters:MkDocsAdapter"
zensical = "zenzic.core.adapters:ZensicalAdapter"
vanilla = "zenzic.core.adapters:VanillaAdapter"
[project.entry-points."zenzic.rules"]
broken-links = "zenzic.core.rules:VSMBrokenLinkRule"
[project.entry-points."mkdocs.plugins"]
zenzic = "zenzic.integrations.mkdocs:ZenzicPlugin"
[project.urls]
Homepage = "https://zenzic.dev"
Documentation = "https://zenzic.dev/docs"
Repository = "https://github.com/PythonWoods/zenzic"
Changelog = "https://zenzic.dev/docs/changelog"
Issues = "https://github.com/PythonWoods/zenzic/issues"
# βββ Build ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[tool.hatch.build.targets.wheel]
packages = ["src/zenzic"]
# βββ Development dependencies (PEP 735 β managed by uv) ββββββββββββββββββββββ
[dependency-groups]
test = [
"pytest>=9.0.3",
"pytest-cov>=4.1.0",
"hypothesis>=6.100.0",
"mutmut>=3.0.0",
"mkdocs>=1.6.1",
]
lint = [
"ruff>=0.3.0",
"mypy>=1.5.0",
"mkdocs>=1.5.0",
"pre-commit>=4.5.1",
"reuse>=5.0.2",
"types-pyyaml>=6.0.12.20250915",
]
release = [
"nox>=2024.4.15",
"bump-my-version>=1.2.6",
"pip-audit>=2.10.0",
]
dev = [
{include-group = "test"},
{include-group = "lint"},
{include-group = "release"},
]
# βββ Ruff βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[tool.ruff]
src = ["src"]
line-length = 100
target-version = "py311"
[tool.ruff.lint]
select = ["E", "F", "W", "I", "B", "C4", "UP", "A"]
ignore = ["E501", "B008"]
[tool.ruff.lint.isort]
known-first-party = ["zenzic"]
combine-as-imports = true
lines-after-imports = 2
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
# βββ Mypy βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[tool.mypy]
python_version = "3.11"
strict = true
ignore_missing_imports = true
[[tool.mypy.overrides]]
# BasePlugin.__init_subclass__ is untyped in MkDocs β unavoidable at subclass definition.
module = ["zenzic.integrations.mkdocs"]
disallow_untyped_calls = false
# βββ Pytest βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[tool.pytest.ini_options]
addopts = "-ra -q --strict-markers --strict-config --import-mode=importlib"
testpaths = ["tests"]
pythonpath = ["tests"]
markers = [
"slow: marks slow tests (deselect with -m 'not slow')",
"integration: marks tests that require external services or processes",
]
# βββ Coverage βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[tool.coverage.run]
source = ["src"]
branch = true
omit = ["tests/*"]
# relative_files ensures that coverage paths from editable installs match
# the src/ tree, which is required for mutmut v3's sourceβtest mapping.
relative_files = true
[tool.coverage.report]
show_missing = true
skip_covered = false
fail_under = 80
exclude_lines = [
"pragma: no cover",
"if TYPE_CHECKING:",
"\\.\\.\\.",
]
# βββ Mutation testing (Sentinel Rigor) ββββββββββββββββββββββββββββββββββββββββ
[tool.mutmut]
paths_to_mutate = [
"src/zenzic/core/rules.py",
"src/zenzic/core/shield.py",
"src/zenzic/core/reporter.py",
]
# pytest_add_cli_args_test_selection specifies which tests to run (replaces tests_dir).
pytest_add_cli_args_test_selection = ["tests/"]
also_copy = ["src/"]
# Override importlib mode: mutmut v3's import-graph analyser requires classic
# prepend mode to trace sourceβtest links (our addopts sets importlib mode).
pytest_add_cli_args = ["--import-mode=prepend"]
# βββ Version bumping βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[tool.bumpversion]
current_version = "0.6.1rc2"
commit = true
tag = true
tag_name = "v{new_version}"
message = "release: bump version {current_version} β {new_version}"
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)((?P<pre_l>a|b|rc)(?P<pre_n>\\d+))?"
serialize = [
"{major}.{minor}.{patch}{pre_l}{pre_n}",
"{major}.{minor}.{patch}",
]
[tool.bumpversion.parts.pre_l]
values = ["a", "b", "rc", "final"]
optional_value = "final"
[tool.bumpversion.parts.pre_n]
first_value = 1
[[tool.bumpversion.files]]
filename = "pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
[[tool.bumpversion.files]]
filename = "src/zenzic/__init__.py"
search = '__version__ = "{current_version}"'
replace = '__version__ = "{new_version}"'
[[tool.bumpversion.files]]
filename = "CITATION.cff"
search = "version: {current_version}"
replace = "version: {new_version}"
[[tool.bumpversion.files]]
filename = "CITATION.cff"
search = "date-released: \\d{{4}}-\\d{{2}}-\\d{{2}}"
replace = "date-released: {now:%Y-%m-%d}"
regex = true
[[tool.bumpversion.files]]
# CHANGELOG uses PEP 440 normalized form: 0.5.0-a2 (hyphen before pre-release label).
# The serialize pattern below produces that form; pyproject uses 0.5.0a2 (no hyphen).
filename = "CHANGELOG.md"
# Cerca solo l'header di secondo livello β evita match su sezioni storiche e link di riferimento
search = "## [{current_version}]"
replace = "## [{new_version}]"
serialize = ["{major}.{minor}.{patch}{pre_l}{pre_n}", "{major}.{minor}.{patch}"]
[[tool.bumpversion.files]]
filename = "CHANGELOG.it.md"
# Cerca solo l'header di secondo livello β evita match su sezioni storiche e link di riferimento
search = "## [{current_version}]"
replace = "## [{new_version}]"
serialize = ["{major}.{minor}.{patch}{pre_l}{pre_n}", "{major}.{minor}.{patch}"]
[[tool.bumpversion.files]]
filename = "README.md"
search = "v{current_version}"
replace = "v{new_version}"
serialize = ["{major}.{minor}.{patch}{pre_l}{pre_n}", "{major}.{minor}.{patch}"]
[[tool.bumpversion.files]]
filename = "README.it.md"
search = "v{current_version}"
replace = "v{new_version}"
serialize = ["{major}.{minor}.{patch}{pre_l}{pre_n}", "{major}.{minor}.{patch}"]
[[tool.bumpversion.files]]
filename = "CONTRIBUTING.md"
search = "v{current_version}"
replace = "v{new_version}"
serialize = ["{major}.{minor}.{patch}{pre_l}{pre_n}", "{major}.{minor}.{patch}"]
[[tool.bumpversion.files]]
filename = ".github/ISSUE_TEMPLATE/security_vulnerability.yml"
search = '"{current_version}"'
replace = '"{new_version}"'