Skip to content

build: derive the package version from git tags (setuptools-scm) - #172

Merged
KriFos1 merged 1 commit into
mainfrom
build/scm-version
Oct 7, 2026
Merged

KriFos1 merged 1 commit into
mainfrom
build/scm-version

Conversation

@rolfjl

@rolfjl rolfjl commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

pyproject.toml hard-coded version = "1.0", but the newest tag is v0.2. This PR takes the version from git tags with setuptools-scm instead.

Changes

  • [build-system] requires setuptools>=64 and setuptools-scm>=8.
  • [project] uses dynamic = ["version"] in place of version = "1.0".
  • New [tool.setuptools_scm] table with fallback_version = "0.0.0", used for builds without git metadata (e.g. a source zip).
  • The test job's actions/checkout uses fetch-depth: 0. A shallow clone has no tags and would report 0.1.dev1.
  • CHANGELOG entry.

pet version already reads importlib.metadata.version("PET"), so it needed no change.

Resulting versions

State Version
Tagged commit v1.0 1.0
Commits after the tag 1.1.devN+g<hash>
Current main (after v0.2) 0.3.dev5+g92ded56 (checked by installing into a clean venv)

No tags are created automatically. To release, push a tag (or publish a GitHub Release).

⚠️ Installed versions drop from 1.0 to 0.3.devN until the next tag. If the next release should be 1.0, tag v1.0 after merging.

🤖 Generated with Claude Code

Replace the hard-coded version = "1.0" (out of step with the v0.2 tag)
with a dynamic version from setuptools-scm, and fetch full history in
the test workflow so the tags are visible there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@KriFos1
KriFos1 merged commit a52519c into main Oct 7, 2026
4 checks passed
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.

2 participants