fix: dedupe git tag in version output #17
Merged
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.
Motivation
scribae versionoutput duplicated the tagged version whengit describealready included av-prefixed tag, producing strings likev0.1.0-v0.1.0-13-gcfeefb2-dirtyinstead of the expectedv0.1.0-13-gcfeefb2-dirty.Description
_resolve_versioninsrc/scribae/__init__.pyto detect and strip a leadingv{resolved}-prefix from the git description, and to return the resolved package version when the git description equals the tag prefix exactly.tests/unit/version_test.pyto assert that_resolve_version()produces0.1.0-13-gcfeefb2-dirtywhen the git suffix isv0.1.0-13-gcfeefb2-dirtyand the package version is0.1.0.Testing
uv run pytestand all tests passed (160 passed).uv run ruff check .and it completed with no issues.uv run mypywhich reported failures due to absenttorchtype stubs in the environment (these are unrelated to the version change and stem from the optional translation dependency).Codex Task