-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathpyproject.toml
More file actions
377 lines (358 loc) · 14.6 KB
/
pyproject.toml
File metadata and controls
377 lines (358 loc) · 14.6 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
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
[build-system]
build-backend = "uv_build"
requires = [ "uv-build>=0.9" ]
[project]
# Docs: https://packaging.python.org/en/latest/guides/writing-pyproject-toml/
name = "repomatic"
version = "6.17.0.dev0"
description = "🏭 Automate repository maintenance, releases, and CI/CD workflows"
readme = "readme.md"
keywords = [
"changelog-formatter",
"dependabot-alternative",
"github-actions",
"github-labels",
"github-workflow",
"gitignore",
"mailmap",
"mypy",
"nuitka",
"python-automation",
"release-automation",
"renovate",
"repository-automation",
"repository-management",
"reusable-workflows",
"software-factory",
"sphinx-doc",
"typo",
"uv",
"workflow-reusable",
]
license = "GPL-2.0-or-later"
license-files = [ "license" ]
authors = [ { name = "Kevin Deldycke", email = "kevin@deldycke.com" } ]
# Python versions and their status: https://devguide.python.org/versions/
requires-python = ">=3.10"
classifiers = [
# See: https://pypi.org/pypi?%3Aaction=list_classifiers
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Framework :: Sphinx",
"Intended Audience :: Developers",
"Operating System :: MacOS :: MacOS X",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX :: BSD :: FreeBSD",
"Operating System :: POSIX :: BSD :: NetBSD",
"Operating System :: POSIX :: BSD :: OpenBSD",
"Operating System :: POSIX :: Linux",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Unix Shell",
"Topic :: Documentation :: Sphinx",
"Topic :: File Formats :: JSON",
"Topic :: Security",
"Topic :: Software Development :: Build Tools",
"Topic :: Software Development :: Compilers",
"Topic :: Software Development :: Documentation",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Software Development :: Quality Assurance",
"Topic :: Software Development :: Version Control :: Git",
"Topic :: System :: Archiving :: Packaging",
"Topic :: System :: Installation/Setup",
"Topic :: System :: Shells",
"Topic :: System :: Software Distribution",
"Topic :: Terminals",
"Topic :: Text Processing :: Markup :: HTML",
"Topic :: Text Processing :: Markup :: Markdown",
"Topic :: Utilities",
"Typing :: Typed",
]
dependencies = [
# Provides enum.StrEnum for Python < 3.11; all versions expose the class.
"backports-strenum>=1; python_version<'3.11'",
# boltons 25.0.0 dropped Python 3.9, matching our requires-python >= 3.10.
"boltons>=25",
# bumpversion.config.files.find_config_file() and bumpversion.show.resolve_name()
# stabilized in 1.x; 1.2.6 fixes Click compatibility affecting our CLI integration.
"bump-my-version>=1.2.6",
# Click Extra 7.10.0 adds schema-aware dataclass support:
# type-aware flattening, field metadata (config_path, normalize_keys),
# and nested dataclasses.
"click-extra>=7.10.1",
# extra-platforms 12.0.2 reimplemented is_macos() with sys.platform, avoiding
# the platform.platform() shell-out to ``cmd /c ver`` on Windows that broke
# under patched subprocess in tests and triggered a CPython 3.10.x bug.
"extra-platforms>=12.0.2",
# canonicalize_name() available since packaging 16; Version() since 17.
"packaging>=17",
# py-walk 0.3.x introduced get_parser_from_file(); replaced gitignore-parser
# (mherrmann/gitignore_parser#43).
# XXX Replace py-walk with wcmatch once the latter supports gitignore files:
# https://github.com/facelessuser/wcmatch/issues/226
"py-walk>=0.3.1",
# pydriller 2.0 redesigned the API; Git, Commit, and Repository are core 2.x classes.
"pydriller>=2",
# pyproject-metadata 0.9 added PEP 639 (license expressions) and PEP 685 (extras
# normalization); our StandardMetadata.from_pyproject() call benefits from these.
"pyproject-metadata>=0.9",
# PyYAML < 6.0.2 uses Cython extensions that fail to compile on Python 3.14, and
# old releases lack requires-python metadata to prevent selection on 3.14.
"pyyaml>=6.0.3",
# tomli 2.0 aligned API with stdlib tomllib; only installed on Python 3.10.
"tomli>=2; python_version<'3.11'",
# tomlkit 0.13 stabilized InlineTable manipulation; used for comment-preserving
# TOML write operations (tool_runner config translation).
"tomlkit>=0.13",
# vt-py is the official VirusTotal Python client (uses aiohttp internally).
# Used by the scan-virustotal CLI command to upload release binaries.
"vt-py>=0.18",
# wcmatch 10.0 fixed globbing inconsistencies with symlinks; our metadata
# globbing uses iglob() with FOLLOW for symlink-aware file discovery.
"wcmatch>=10",
]
[project.scripts]
repomatic = "repomatic.__main__:main"
[project.urls]
"Changelog" = "https://github.com/kdeldycke/repomatic/blob/main/changelog.md"
"Documentation" = "https://kdeldycke.github.io/repomatic"
"Download" = "https://github.com/kdeldycke/repomatic/releases/tag/v6.17.0.dev0"
"Funding" = "https://github.com/sponsors/kdeldycke"
"Homepage" = "https://github.com/kdeldycke/repomatic"
"Issues" = "https://github.com/kdeldycke/repomatic/issues"
"Repository" = "https://github.com/kdeldycke/repomatic"
# Non-runtime development dependency groups.
[dependency-groups]
test = [
# coverage 7.11.0 dropped Python 3.9, matching our requires-python >= 3.10.
"coverage[toml]>=7.11",
# Pytest 9.0.0 introduce support for native TOML configuration files.
"pytest>=9",
# pytest-cov 4.0 stabilized the modern pytest plugin interface; --cov/--cov-report in addopts.
"pytest-cov>=4",
# pytest-github-actions-annotate-failures 0.2 requires Python >= 3.8; CI annotation
# API stable since 0.1.x.
"pytest-github-actions-annotate-failures>=0.2",
# pytest-randomly 3.x is the modern API; basic test randomization compatible with pytest >= 9.
"pytest-randomly>=3",
# pytest-xdist < 3.7 fails on Python 3.14 (no requires-python guard in older releases);
# [psutil] extra needed for --numprocesses=auto.
"pytest-xdist[psutil]>=3.7",
]
docs = [
# click-extra[sphinx] provides click_extra.sphinx extension, docutils, pygments,
# and sphinx transitively.
"click-extra[sphinx]",
# furo 2024.8.6+ supports Sphinx 8; pinned to recent CalVer release.
"furo>=2025.9.25",
# myst-parser 5.0 stabilized MyST extensions and improved Sphinx directive support.
"myst-parser>=5",
# Sphinx 8.0.0 is the first version to drop Python 3.9, like us.
"sphinx>=8",
# sphinx-autodoc-typehints 2.4.0 is the first version aligned to our Python >= 3.10 requirement.
"sphinx-autodoc-typehints>=2.4",
# sphinx-copybutton 0.5.2 stabilized the copy button behavior for code blocks.
"sphinx-copybutton>=0.5.2",
# sphinx-design 0.6 introduced the current directive syntax for cards, grids, and tabs.
"sphinx-design>=0.6",
# sphinxcontrib-mermaid 1.2.3 fixed mermaid_d3_zoom configuration support.
"sphinxcontrib-mermaid>=1.2.3",
# sphinxext-opengraph 0.13 stabilized OpenGraph metadata generation for Sphinx 8+.
"sphinxext-opengraph>=0.13",
]
# types-boltons: first stub release covering boltons 25.0 API (FrozenDict, unique, flatten,
# strip_ansi). types-pyyaml: stub release covering PyYAML 6.0 (safe_load, safe_dump, full_load).
typing = [
# backports-strenum: provides StrEnum stubs for mypy --python-version 3.10 analysis;
# not in main deps (version-gated to Python<3.11 there), so added here unconditionally.
"backports-strenum>=1",
"types-boltons>=25.0.0.20250822",
"types-pyyaml>=6.0.12.9",
]
[tool.uv]
# Docs group requires Python >= 3.14 for recent MyST-Parser and click-extra features.
dependency-groups.docs = { requires-python = ">= 3.14" }
# Cooldown period: 7-day buffer before using newly released packages.
# Relative dates are fine here: uv 0.11.8+ writes a sentinel timestamp to
# uv.lock for relative spans, so re-resolving never produces churn.
exclude-newer = "1 week"
# repomatic is pinned to git main.
# extra-platforms 12.0.0 fixes is_macos() shelling out on Windows
# (https://github.com/kdeldycke/extra-platforms): bypass the cooldown so the
# fix lands without waiting a week.
exclude-newer-package = { gitpython = "0 day", repomatic = "0 day", extra-platforms = "0 day" }
# Package is at root level, not in "./src/".
build-backend.module-root = ""
[tool.ruff]
preview = true
fix = true
unsafe-fixes = true
show-fixes = true
# Enable reformatting of code snippets in docstrings.
# https://docs.astral.sh/ruff/formatter/#docstring-formatting
format.docstring-code-format = true
# D400: First line should end with a period.
# Allows docstrings to end up with any punctuation, not just a period.
# See: https://github.com/astral-sh/ruff/issues/1858#issuecomment-1382640623
# ERA001: Found commented-out code.
# Do not remove commented code, as it might be used for documentation.
# See: https://docs.astral.sh/ruff/rules/#eradicate-era
# LOG015: Root logger calls (logging.info(), etc.).
# The CLI configures the root logger via Click, so root logger calls are intentional.
# See: https://docs.astral.sh/ruff/rules/root-logger-call/
lint.ignore = [ "D400", "ERA001", "LOG015" ]
lint.isort.combine-as-imports = true
# Allow rules to add `from __future__ import annotations` in cases where
# this would simplify a fix or enable a new diagnostic.
# https://docs.astral.sh/ruff/settings/#lint_future-annotations
lint.future-annotations = true
[tool.typos]
default.extend-identifiers = { Github = "GitHub", IOS = "iOS", Javascript = "JavaScript", MacOS = "macOS", PNGs = "PNGs", PyPi = "PyPI", Typescript = "TypeScript" }
# False positives.
default.extend-words = { astroid = "astroid", oject = "oject", PNGs = "PNGs" }
# Skip content between <!-- typos:off --> and <!-- typos:on --> markers.
default.extend-ignore-re = [ "(?s)<!-- typos:off -->.*?<!-- typos:on -->" ]
default.extend-ignore-identifiers-re = [
# error: `certifi` should be `certify`, `certifies`, `certified`
# ╭▸ ./docs/assets/dependencies.mmd:184:11
# │
# 184 │ click certifi "https://pypi.org/project/certifi/" _blank
# ╰╴ ━━━━━━━
"certifi",
# error: `nwo` should be `now`
# ╭▸ ./repomatic/github/release_sync.py:147:5
# │
# 147 │ nwo = f"{parts[-2]}/{parts[-1]}" if len(parts) >= 2 else ""
# ╰╴ ━━━
# Standard GitHub API term for "name with owner" (e.g. "owner/repo").
"nwo",
# error: `vulnerabilit` should be `vulnerability`
# ╭▸ ./repomatic/uv.py:82:55
# │
# 82 │ r"^(\S+)\s+(\S+)\s+has\s+\d+\s+known\s+vulnerabilit"
# ╰╴ ━━━━━━━━━━━━
# Intentional truncation to match both "vulnerability" and "vulnerabilities".
"vulnerabilit",
# error: `WARNIN` should be `WARNING`
# ╭▸ ./tests/test_changelog.py:565:46
# │
# 565 │ # Both sources available — NOTE only, no WARNINGs.
# ╰╴
"WARNIN",
]
[tool.pytest]
# https://docs.pytest.org/en/latest/customize.html#pyproject-toml
markers = [
"once: Tests that only need to run once, not across the full CI matrix.",
]
addopts = [
"--durations=10",
"--cov",
"--cov-report=term",
"--numprocesses=auto",
"--dist=loadfile",
]
# Make sure tests that are expected to fail do not resurrect and start working all of a sudden.
xfail_strict = true
[tool.coverage]
# https://coverage.readthedocs.io/en/latest/config.html
run.branch = true
run.source = [ "repomatic" ]
report.precision = 2
[tool.bumpversion]
current_version = "6.17.0.dev0"
allow_dirty = true
ignore_missing_files = true
# Parse versions with an optional .devN suffix (PEP 440).
parse = "(?P<major>\\d+)\\.(?P<minor>\\d+)\\.(?P<patch>\\d+)(\\.dev(?P<dev>\\d+))?"
serialize = [
"{major}.{minor}.{patch}.dev{dev}",
"{major}.{minor}.{patch}",
]
# When dev is "release" (its optional value), the .devN suffix is omitted.
# Bumping patch/minor/major resets dev to "0", producing X.Y.Z.dev0.
# Bumping dev goes from "0" to "release", stripping the suffix for release.
parts.dev.values = [ "0", "release" ]
parts.dev.optional_value = "release"
[[tool.bumpversion.files]]
# Update Python package version in any __init__.py file.
glob = "./**/__init__.py"
ignore_missing_version = true
[[tool.bumpversion.files]]
# Update version in [project] section.
filename = "./pyproject.toml"
search = 'version = "{current_version}"'
replace = 'version = "{new_version}"'
[[tool.bumpversion.files]]
# Update version in download URL.
filename = "./pyproject.toml"
search = "releases/tag/v{current_version}"
replace = "releases/tag/v{new_version}"
[[tool.bumpversion.files]]
# Update the version in Markdown changelog.
filename = "./changelog.md"
search = "## [`{current_version}` (unreleased)]("
replace = "## [`{new_version}` (unreleased)]("
[[tool.bumpversion.files]]
# Update the version in the citation file.
filename = "./citation.cff"
search = "version: {current_version}"
replace = "version: {new_version}"
[[tool.bumpversion.files]]
# Update the release date in the citation file.
filename = "./citation.cff"
regex = true
search = "date-released: \\d{{4}}-\\d{{2}}-\\d{{2}}"
replace = "date-released: {utcnow:%Y-%m-%d}"
[tool.mypy]
check_untyped_defs = true
mypy_path = "docs"
warn_unused_configs = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
warn_unreachable = true
pretty = true
overrides = [
{ ignore_missing_imports = true, module = [
"bumpversion.*",
"gitdb.*",
"py_walk.*",
"pydriller.*",
"vt",
] },
]
[tool.lychee]
# https://lychee.cli.rs/guides/config/
exclude = [
# GitHub issue comment fragments are dynamically loaded and can't be verified.
"^https://github.com/.+/issues/[0-9]+#issuecomment-.*$",
# Release binary download URLs redirect to the GitHub CDN (objects.githubusercontent.com).
"^https://github.com/.+/releases/.+/download/.*$",
# Allow redirects of generic DOI URLs to their specific Zenodo release page.
"^https://doi.org/.+/zenodo.*$",
# Bitdefender returns 403 to bots.
"bitdefender\\.com",
# archive.ph rate-limits crawlers.
"archive\\.ph",
# npmjs.com returns 403 to bots.
"^https://www\\.npmjs\\.com/package/.*$",
# star-history.com fragments are JS-rendered and invisible to lychee.
"^https://star-history\\.com/.*$",
]
exclude_path = [
# Template files contain $variable placeholders that are not real URLs.
"repomatic/templates/",
]
[tool.repomatic]
nuitka.extra-args = [
"--include-data-dir=repomatic/data/awesome_template=repomatic/data/awesome_template",
"--include-data-files=repomatic/templates/*.md=repomatic/templates/",
]
exclude = [ "workflows" ]
pypi-package-history = [ "gha-utils", "repokit" ]