From aae09438c601aa87f870ea6cd0e749dccbd5498d Mon Sep 17 00:00:00 2001 From: srichs <13246896+srichs@users.noreply.github.com> Date: Mon, 16 Feb 2026 20:44:50 -0700 Subject: [PATCH] Add pre-release module entrypoint and release smoke-test guidance --- README.md | 13 +++++++++---- REVIEW.md | 13 +++++++++++++ src/devr/__main__.py | 7 +++++++ tests/test_cli.py | 15 +++++++++++++++ 4 files changed, 44 insertions(+), 4 deletions(-) create mode 100644 src/devr/__main__.py diff --git a/README.md b/README.md index d11952d..5edd487 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,7 @@ devr check - `devr fix` - `devr security [--fail-fast]` - `devr doctor` +- `python -m devr --version` (module entrypoint smoke check) ### Shell completion @@ -126,10 +127,14 @@ Use this checklist when cutting a release: - Move completed entries from `Unreleased` into a new version section. - Add release date (`YYYY-MM-DD`) and keep entries grouped by change type. 3. Bump version in `pyproject.toml` under `[project].version`. -4. Commit release metadata (`CHANGELOG.md`, version bump, and any final docs updates). -5. Tag the release (for example, `vX.Y.Z`) and push branch + tag. -6. Publish to PyPI using your standard release workflow. -7. Add a fresh `Unreleased` section to `CHANGELOG.md` for subsequent work. +4. Build and smoke-test the package artifacts: + - `python -m build` + - `python -m pip install --force-reinstall dist/*.whl` + - `python -m devr --version` +5. Commit release metadata (`CHANGELOG.md`, version bump, and any final docs updates). +6. Tag the release (for example, `vX.Y.Z`) and push branch + tag. +7. Publish to PyPI using your standard release workflow. +8. Add a fresh `Unreleased` section to `CHANGELOG.md` for subsequent work. ## Default toolchain diff --git a/REVIEW.md b/REVIEW.md index 0170661..35c2eee 100644 --- a/REVIEW.md +++ b/REVIEW.md @@ -2,6 +2,19 @@ This review was refreshed after the latest completed work and focuses on **new** reliability, UX, and maintainability opportunities for `devr`. + +## 0.1.0 release additions to prioritize + +1. **Add `python -m devr` module entrypoint support (done in this branch).** + - This gives users a reliable fallback invocation path and improves post-install smoke testing. + +2. **Run package artifact smoke tests as part of release steps.** + - Build the wheel/sdist and verify the installed artifact can execute `devr --version` and `python -m devr --version`. + +3. **Reconcile changelog and version state before tagging.** + - `pyproject.toml` already says `0.1.0`, while `CHANGELOG.md` still has unreleased entries that read as already-shipped features. + - Move completed items into the final `0.1.0` section (or bump target version if intentionally post-0.1.0 work). + ## High-impact improvements 1. **Add machine-readable output modes (`--json`) for `check`, `security`, and `doctor`.** diff --git a/src/devr/__main__.py b/src/devr/__main__.py new file mode 100644 index 0000000..5ce03c7 --- /dev/null +++ b/src/devr/__main__.py @@ -0,0 +1,7 @@ +"""Module entry point for ``python -m devr``.""" + +from .cli import app + + +if __name__ == "__main__": + app(prog_name="devr") diff --git a/tests/test_cli.py b/tests/test_cli.py index 5e7bcc2..25931c3 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -1,5 +1,6 @@ """CLI behavior tests for devr commands.""" +import os import subprocess from pathlib import Path from types import SimpleNamespace @@ -23,6 +24,20 @@ runner = CliRunner() +def test_module_entrypoint_supports_version_flag() -> None: + proc = subprocess.run( + ["python", "-m", "devr", "--version"], + cwd=str(Path(__file__).resolve().parents[1]), + capture_output=True, + text=True, + check=False, + env={**os.environ, "PYTHONPATH": "src"}, + ) + + assert proc.returncode == 0 + assert proc.stdout.startswith("devr ") + + def test_version_flag_prints_version(monkeypatch) -> None: monkeypatch.setattr("devr.cli.version", lambda _: "1.2.3")