Bump version to 0.5.2 and guard tag/version drift#8
Merged
Conversation
The v0.5.1 release failed to publish. actions/checkout resolves the release tag, but uv build reads the version from pyproject.toml, which was never bumped past 0.5.0. The job rebuilt bruin_sdk-0.5.0 and PyPI rejected the upload: 400 Uploading new files to releases older than 14 days is not allowed 0.5.0 was published four months prior, so the artifact was refused. The tag name never reaches the built distribution. Bump the version to 0.5.2, leaving 0.5.1 unused since its tag already points at a 0.5.0 tree. Add a publish-time check asserting the release tag matches the pyproject version, so a missed bump fails before uv build rather than silently rebuilding a stale version. __version__ in src/bruin/__init__.py had drifted independently to 0.4.0, a second version source that nothing kept in sync. Derive it from installed distribution metadata instead, making pyproject.toml authoritative.
terzioglub
approved these changes
Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
v0.5.1publish run failed.actions/checkoutresolves the release tag, butuv buildreads the version frompyproject.toml— which was never bumped past0.5.0. The job rebuiltbruin_sdk-0.5.0and PyPI refused it:0.5.0was published 2026-03-16, so the artifact was rejected. The tag name never reaches the built distribution; onlypyproject.tomldetermines it.What changed
pyproject.toml— version0.5.0→0.5.2. Skipping0.5.1because that tag already points at a0.5.0tree; cutting fresh avoids rewriting a published ref. PyPI has never seen0.5.1or0.5.2..github/workflows/publish.yml— assert the release tag matches the pyproject version beforeuv build. A missed bump now fails loudly instead of silently rebuilding a stale version and dying at upload.src/bruin/__init__.py—__version__was independently stale at0.4.0, a second version source nothing kept in sync with pyproject's0.5.0. It now derives from installed distribution metadata, makingpyproject.tomlauthoritative.Verification
bruin_sdk-0.5.2.tar.gz/.whl.bruin.__version__ == "0.5.2".PackageNotFoundErrorfallback (source tree, no install): resolves to0.0.0.dev0, does not raise.v0.5.1+0.5.0blocks;v0.5.2+0.5.2proceeds.ruff format --checkandruff checkpass.pytest: 211 pass, 8 fail. The 8 failures are pre-existing onmain(ModuleNotFoundError: psycopg2, an optional extra) and reproduce with these changes stashed.Follow-up (not in this PR)
uv.lockis stale onmain— it pinsrequires-python = ">=3.9"whilepyproject.tomlrequires>=3.10, and predates thefabricextra'sazure-identitydependency. Auv syncregenerates ~233KB of churn. Unrelated to publishing, so left for a separate PR.Releasing after merge
Tag
v0.5.2on the merge commit and publish a GitHub release; the workflow triggers onrelease: published.