feat(pyproject): release v1.7.0 — Python pyproject.toml version bump
Add internal/pyproject package with ReadVersion and WriteVersion for pyproject.toml files. Reads [project].version (PEP 621) first, then falls back to [tool.poetry].version. Section boundaries are detected via TOML's rule that headers always start at the beginning of a line (\n[ pattern), so inline arrays with [ characters don't interfere. Config follows the established multi-value pattern: - python.pyproject_toml: single path (opt-in, no default) - python.pyproject_tomls: list for monorepos (overrides single) - --pyproject flag overrides pyproject_toml and clears pyproject_tomls 100% per-package statement coverage maintained across all 14 packages; FuzzReadVersion and FuzzWriteVersion added per fuzzing guidelines. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,14 @@ gradle: # opt-in — omit section t
|
||||
# - "build.gradle"
|
||||
# - "module-a/build.gradle"
|
||||
|
||||
python: # opt-in — omit section to skip
|
||||
# pyproject_toml: "pyproject.toml" # PEP 621 [project].version or [tool.poetry].version
|
||||
|
||||
# Monorepo: list overrides pyproject_toml.
|
||||
# pyproject_tomls:
|
||||
# - "pyproject.toml"
|
||||
# - "packages/cli/pyproject.toml"
|
||||
|
||||
gitlab:
|
||||
url: "https://gitlab.example.com" # or env CI_SERVER_URL
|
||||
token: "" # prefer env GITLAB_TOKEN
|
||||
@@ -128,6 +136,27 @@ node:
|
||||
- "packages/backend/package.json"
|
||||
```
|
||||
|
||||
## Python support
|
||||
|
||||
The `python` section is opt-in — if omitted, no `pyproject.toml` is touched. `releaser` reads `[project].version` (PEP 621) first; if not found it falls back to `[tool.poetry].version`. The original file formatting is preserved on write.
|
||||
|
||||
```yaml
|
||||
python:
|
||||
pyproject_toml: "pyproject.toml"
|
||||
```
|
||||
|
||||
Use `pyproject_tomls` for monorepos:
|
||||
|
||||
```yaml
|
||||
python:
|
||||
pyproject_tomls:
|
||||
- "pyproject.toml"
|
||||
- "packages/cli/pyproject.toml"
|
||||
- "packages/lib/pyproject.toml"
|
||||
```
|
||||
|
||||
The `--pyproject <path>` CLI flag sets a single path and clears `pyproject_tomls`.
|
||||
|
||||
## Gradle support
|
||||
|
||||
The `gradle` section is opt-in — if omitted, no build file is touched. Both Groovy DSL (`version = '1.2.3'`) and Kotlin DSL (`version = "1.2.3"`) are supported; the original quote style is preserved on write.
|
||||
|
||||
Reference in New Issue
Block a user