quality, 7 findings: _release_impl and release take one frozen ReleaseOptions (new options.py, exported from pkgmgr.actions.release) and split into small private helpers with a frozen _Prepared carrier; the three _release_impl call paths become one plus dataclasses.replace(preview=True) for the interactive preview. cli/commands/release.py and cli/parser/release_cmd.py split into helpers with arguments in the same order, so the CLI surface is unchanged; test_workflow.py uses one with-block instead of five patch decorators. CodeRabbit: with --expect-tree an existing but untracked release input (pyproject, CHANGELOG.md, flake.nix, PKGBUILD, spec, debian/changelog, Cargo files) aborts before any write; the README says the abort comes before any release file is written and the pull is not reverted. | 🌿 Branch | 📊 Diff stat | 🎯 Fix | 💥 Break | 💸 Tokens | ⏱️ Velocity | 🛡️ Security | 🏆 Score | Gate | | --- | --- | --- | --- | --- | --- | --- | --- | --- | | feature/release-expect-tree | 13 files +457/-342 | 91 % | 4 % | – | – | 100 % | 87 | ✅ 90/5, tokens and velocity <= 100, security 100 % | Evidence: tests/unit + tests/integration with PYTHONPATH=src 886 passed; 2 known gpg-in-sandbox failures in test_publish_integration. quality check --staged 0 findings, ruff clean, MEDUSA 100 %, critical 0. Hub review e12f7e62ce35b6f5. Refs https://github.com/kevinveenbirkenbach/package-manager/pull/19 Created-with: https://s.veen.world/skills Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
30 lines
983 B
Python
30 lines
983 B
Python
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class ReleaseOptions:
|
|
"""
|
|
Args:
|
|
expect_tree: full tree sha HEAD must match after the pull, or None.
|
|
pyproject_path: pyproject.toml of the repository to release.
|
|
changelog_path: Markdown changelog to extend.
|
|
release_type: semver part to bump (major, minor, patch).
|
|
message: release message for the changelogs and the tag.
|
|
preview: only print what would change.
|
|
force: skip the interactive preview and the branch deletion prompt.
|
|
close: delete the current branch after the release.
|
|
retry: re-deploy the existing HEAD release instead of bumping.
|
|
"""
|
|
|
|
expect_tree: str | None
|
|
pyproject_path: str = "pyproject.toml"
|
|
changelog_path: str = "CHANGELOG.md"
|
|
release_type: str = "patch"
|
|
message: str | None = None
|
|
preview: bool = False
|
|
force: bool = False
|
|
close: bool = False
|
|
retry: bool = False
|