chore: Bump version to 0.3.0 and derive __version__ from package metadata - #18
Merged
Conversation
Also corrects python/gitoxide/__init__.py, whose __version__ was still 0.1.0. It was missed during the 0.2.0 release, so the published 0.2.0 package reports 0.1.0 at runtime.
Hard-coding __version__ in python/gitoxide/__init__.py meant it had to be bumped by hand on every release, and it silently fell out of sync: the published 0.2.0 package reports 0.1.0 at runtime. Read it from the installed distribution metadata instead, which maturin populates from the Cargo.toml version at build time. Cargo.toml becomes the single place a release version is written. A test guards against the metadata lookup silently falling back to the sentinel value.
shenxianpeng
added a commit
that referenced
this pull request
Sep 1, 2026
v0.3.0 can never be released from this repository. The tag name was
consumed by an immutable release that was published and then deleted,
and GitHub reserves such names permanently ("tag name was used by an
immutable release, published releases must have a valid tag"). Turning
the setting off does not free an already-consumed name.
0.4.0 rather than 0.3.1: main now carries the blame binding (#19), which
is a feature and warrants a minor bump, and 0.3.0 never reached PyPI —
publishing a 0.3.1 with no 0.3.0 preceding it would only confuse.
Only Cargo.toml (and the lockfile) change here. Since #18 the Python
`__version__` is read from installed package metadata, so it follows
along on its own.
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.
Summary
Prepares the 0.3.0 release, and removes the hand-maintained version constant
that made the last release ship a wrong version string.
Two commits
1.
chore: Bump version from 0.2.0 to 0.3.0Cargo.tomlCargo.lock(own package entry)python/gitoxide/__init__.pyNote the third row:
__version__was still0.1.0. It was missed during the0.2.0 release, so the published 0.2.0 package reports
0.1.0at runtime.2.
chore: derive __version__ from installed package metadataRather than leave a constant that has to be remembered on every release,
__version__is now read from the installed distribution metadata, whichmaturin populates from the
Cargo.tomlversion at build time:Cargo.tomlbecomes the single place a release version is written —pyproject.tomlalready sources it from there. Atest_versioncase guardsagainst the metadata lookup silently degrading to the sentinel value.
Verification
Built and installed into a clean venv via
pip install .(the same PEP 517path CI uses), then imported from outside the source tree:
pytest -q→ 16 passed.cargo metadata --lockedconfirmsCargo.lockstays in sync with
Cargo.toml.Release ordering
publish.ymltriggers onv*tags and builds the version fromCargo.toml,so this must merge before the
v0.3.0tag is pushed — tagging first iswhat produced the earlier mismatch.