Skip to content

build: adopt semver with version.txt + tag-on-merge CI#57

Merged
phitoduck merged 1 commit into
mainfrom
semver
Jun 12, 2026
Merged

build: adopt semver with version.txt + tag-on-merge CI#57
phitoduck merged 1 commit into
mainfrom
semver

Conversation

@phitoduck

Copy link
Copy Markdown
Owner

Summary

  • version.txt is the new single source of truth for the package version (starts at 0.1.0). pyproject.toml declares dynamic = ["version"] and hatchling reads the file at build time ([tool.hatch.version] with a regex source). Build backend switched from uv_build to hatchling so file-sourced dynamic versioning is supported.
  • CI fail-fast version gate: new version-check job runs independently of lint/tests so a missed bump surfaces immediately while you still learn whether the rest of CI would have passed. It also enforces the 0.x.x alpha range.
  • Tag on merge to main: new tag-release job pushes v{version} after version-check + ci succeed.
  • Skip pytest for doc-only PRs: dorny/paths-filter@v3 gates the pytest + coverage steps on changes under src/, tests/, pyproject.toml, uv.lock, or the workflow itself. Lint/format/secret-scan still run on every PR.
  • AGENTS.md (2 lines): tells agents to bump version.txt and stay on 0.x.x (alpha).

Test plan

  • uv sync + uv sync --frozen succeed locally; resolves lose-it==0.1.0.
  • uv build produces lose_it-0.1.0-py3-none-any.whl and .tar.gz.
  • uv run ruff check . and ruff format --check . clean.
  • uv run pytest --no-cov -q → 161 passed, 5 skipped.
  • CI shows version-check running in parallel with ci.
  • CI version-check would fail if version.txt were not bumped on a follow-up PR (verify on next PR).
  • After merge, v0.1.0 tag appears on the repo.

Single source of truth for the package version is now version.txt. The
pyproject.toml declares ``dynamic = ["version"]`` and hatchling reads the
file at build time. CI gains an independent ``version-check`` job that
fails fast if the tag ``v{version}`` already exists, and a ``tag-release``
job that pushes the tag on merge to main. Pytest now skips on PRs that
don't touch ``src/`` or ``tests/`` (lint/scan still run on everything).
Adds a 2-line AGENTS.md telling agents to bump the version and stay in
the ``0.x.x`` alpha range.
@phitoduck phitoduck merged commit 693e615 into main Jun 12, 2026
4 checks passed
@phitoduck phitoduck deleted the semver branch June 12, 2026 20:29
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