Skip to content

Take the package version from the git tag - #11

Merged
shuckc merged 1 commit into
mainfrom
version-from-tag
Nov 9, 2026
Merged

shuckc merged 1 commit into
mainfrom
version-from-tag

Conversation

@shuckc

@shuckc shuckc commented Nov 9, 2026 •

Copy link
Copy Markdown
Member

Problem

The PyPI publish for the `0.1.1` release failed: the tag built a `0.1.0` wheel because the version was hard-coded in `rollingmill/init.py`, and PyPI rejects re-uploading an existing version.

Change

  • `hatch-vcs` derives the version from the git tag (`[tool.hatch.version] source = "vcs"`).
  • `version` is removed from the package. Nothing used it, and the installed version is available from `importlib.metadata`.
  • `ci.yml` and `publish.yml` check out with `fetch-depth: 0` so the tags are present at build time.

Verification

  • Suite: 206 passed, 1 skipped; ruff clean.
  • In a throwaway clone with a temporary `0.1.2` tag, `uv build` produced `rollingmill-0.1.2` wheel and sdist, the wheel installs with metadata version `0.1.2`, and the package imports.

Release note

The existing `0.1.1` tag/release points at a commit without this change. After merging, delete and recreate the `0.1.1` release on the new `main` (nothing was ever published as `0.1.1`), or release as `0.1.2`.

🤖 Generated with Claude Code

@shuckc
shuckc force-pushed the version-from-tag branch 2 times, most recently from ea9e2e6 to c60da3c Compare November 9, 2026 21:30
The version was read from rollingmill/__init__.py, so the 0.1.1 release built a 0.1.0 wheel and
PyPI rejected it ("File already exists"). hatch-vcs now derives the version from the tag, so the
package no longer defines __version__: nothing used it, and the installed version is available
from importlib.metadata. The publish workflow fetches full history so the tags are present.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@shuckc
shuckc merged commit 00406d4 into main Nov 9, 2026
1 check 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.

1 participant