Skip to content

Make version.py the single source of the version, and correct RELEASING.md - #540

Merged
MichaelGHSeg merged 3 commits into
masterfrom
docs/releasing
Sep 29, 2026
Merged

MichaelGHSeg merged 3 commits into
masterfrom
docs/releasing

Conversation

@MichaelGHSeg

@MichaelGHSeg MichaelGHSeg commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

The version was duplicated, and only one copy was checked

pyproject.toml held version = "2.4.0" and segment/analytics/version.py held its own VERSION. The publish workflow validated the release tag against pyproject.toml only, but version.py is what the library actually reports at runtime:

msg["context"]["library"] = {"name": "analytics-python", "version": VERSION}   # client.py
"User-Agent": "analytics-python/" + VERSION                                      # request.py

So a stale version.py would publish a correctly numbered package while every event it ever sent was attributed to the previous release — and nothing would fail.

hatchling now reads the version from version.py via [tool.hatch.version], and the tag check validates against that same file. Verified locally: uv build resolves 2.4.0 from version.py and names the sdist accordingly.

RELEASING.md

Corrected against how 2.4.0 actually shipped:

  • it claimed twine uploads with --trusted-publishing=always; no such flag exists and it aborted the first attempt
  • the production environment requires review, so the publish job pauses — that step was missing
  • bumping two files is no longer a step, since there is now one
  • notes that the workflow runs from the tagged commit, which is why 2.4.0 had to be re-tagged rather than re-run

pyproject.toml carried its own copy, and the publish workflow validated the tag
only against that one. A stale version.py would therefore publish a correctly
numbered package whose User-Agent and context.library.version reported the
previous release, with nothing failing.

hatchling now reads the version from version.py, and the tag check validates
against the same file.
@MichaelGHSeg MichaelGHSeg changed the title docs: correct the release process Make version.py the single source of the version, and correct RELEASING.md Sep 29, 2026
@MichaelGHSeg
MichaelGHSeg merged commit 8b218ac into master Sep 29, 2026
17 of 18 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