Skip to content

chore: adopt the release standard - #99

Open
crcatala-vps wants to merge 2 commits into
mainfrom
chore/release-standard
Open

crcatala-vps wants to merge 2 commits into
mainfrom
chore/release-standard

Conversation

@crcatala-vps

Copy link
Copy Markdown
Collaborator

Summary

Applies the shared release standard to monarch-cli: canonical release scripts, a bump target, the standard --version line, a monarch update command, and an Install section with a from-source path. Version stays 0.2.1; no release or tag was created.

What changed

  • Canonical files copied byte-for-byte from the standard:
    • scripts/prep-release.sh
    • scripts/check-changelog.sh
    • scripts/build_info.py
  • Version line: monarch --version / -v now prints monarch X.Y.Z (sha7 YYYY-MM-DD), with -dirty for an uncommitted tree. A checkout reads git; a wheel/sdist carries _build_info.json so installed copies print the same line. scripts/smoke_install.sh stamps before building, verifies the stamp ships in both artifacts, and checks the exact line for both entry points.
  • monarch update [--check] [--force] wired through the release-standard cli_meta module. It detects checkout / uv tool / pipx / pip / mise installs, prints commands before running them, refuses a dirty or non-main checkout, and reports exit codes 0/1/2 for --check. Update is classified with a new additive local_install_change effect, so it never implies --allow-mutations.
  • Release flow:
    • make bump VERSION=X.Y.Z (new scripts/bump.sh) updates __init__.py, pyproject.toml, uv.lock, moves Unreleased to a dated section, updates comparison links, and commits chore: release vX.Y.Z. It refuses a dirty tree, non-main, an existing tag, or an empty Unreleased section.
    • scripts/release.sh now requires a clean main at HEAD == origin/main, refuses an existing tag, and refuses to tag when the build stamp is not HEAD. Dry runs warn instead of refusing so they are usable on a feature branch.
    • Publish remains a separate last step from the same dist/ (uv run twine upload dist/*), with the TestPyPI rehearsal preserved.
  • Docs: root RELEASING.md (the old page moved; docs/RELEASING.md is now a redirect), README ## Install rewritten with registry installs, From source, and Updating, plus update in docs/commands.md and the new effect in docs/capabilities.md.
  • Tests: new tests/test_cli_meta.py (version-line formatting, CLI line, update flag/exit-code wiring); updated the capabilities fixture and inventory tests.

What was kept that differs from the standard, and why

  • -V stays --verbose; --version stays -v. The repo already documents and tests these global flags, and they are part of the capabilities manifest. Changing -V to mean version would be a breaking CLI change unrelated to this PR. --version/-v print the standard line.
  • The printed name is monarch (the executable), while the distribution and capabilities.cli.name stay monarch-cli.
  • PyPI publishing stays project-owned (twine, separate last step) and TestPyPI rehearsal is preserved; scripts/release.sh still never publishes, and the build still goes through the single make smoke-install target used by CI, prepublish, and release.
  • Canonical scripts/build_info.py is excluded from ruff (extend-exclude) so it stays byte-identical to the template; cli_meta.py was adapted only for the repo's strict mypy/ruff settings.
  • docs/RELEASING.md kept as a redirect instead of deleting it, so existing links keep working.
  • Existing safeguards preserved: version parity across __init__.py/pyproject.toml/uv.lock, capabilities-fixture contract, packaged schema artifact checks, both console entry points, metadata-warning scan, twine check, and README rendering.

Verification

Command Result
COLUMNS=200 make verify pass: format, lint, mypy strict, 1459 passed, 21 deselected
make prepublish pass: verify + smoke-install + twine check dist/* + readme_renderer
uv run monarch --version monarch 0.2.1 (ed28de7 2026-10-27) (this commit)
uv run monarch-cli --version monarch 0.2.1 (ed28de7 2026-10-27)
uv run monarch update --check monarch is up to date (ed28de7). exit 0
make release-dry exit 0; previews tag v0.2.1 and the GitHub Release, no tag/release created (warns: dry run on a feature branch, HEAD != origin/main, and v0.2.1 already exists because the version was intentionally not bumped)
make bump VERSION=9.9.9 in a throwaway clone on main pass: updated all version metadata + changelog + uv.lock, committed chore: release v9.9.9 (not run in this repo)
python3 .../audit.py . 0 failing, 0 warnings, 14 checks

Note: tests/commands/test_auth.py::test_status_human_readable_shows_file_path fails locally when COLUMNS is unset (rich wraps the path); it passes with COLUMNS=200, passes on main with the same setting, and main CI is green. No release, tag, publish, or merge was performed.

crcatala-vps and others added 2 commits October 27, 2026 18:21
monarch --version now prints `monarch X.Y.Z (sha7 YYYY-MM-DD)`, with
`-dirty` for a build from an uncommitted tree. A checkout reads git; an
installed wheel reads the release-standard _build_info.json stamp.

`monarch update [--check] [--force]` updates the CLI with the method it was
installed with (source checkout, uv tool, pipx, pip, or mise) through the
release-standard cli_meta module. Update is classified with a new additive
local_install_change effect so it never implies mutation authorization.

The capabilities manifest fixture is regenerated for the new command.

Co-authored-by: Christian Catalan <crcatala@gmail.com>
Add the canonical release-standard scripts (prep-release, check-changelog,
build_info) plus a project-owned bump script and Makefile target.

Release flow now refuses a dirty tree, a branch other than main, HEAD !=
origin/main, an existing tag, or an empty Unreleased section; smoke-install
stamps the build, checks that the wheel and sdist ship the stamp, and verifies
the exact --version line of both console entry points. release.sh refuses to
tag when the stamp is not HEAD and still publishes to PyPI separately, last.

Move the release guide to the repository root, keep docs/RELEASING.md as a
pointer, and rewrite the README install section with registry installs, a
from-source section, and the update command.

Co-authored-by: Christian Catalan <crcatala@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant