Repository navigation
fix(setup): ignore git signature display when building the version - #2364
Closed
Shellghostt wants to merge 1 commit into
Closed
Shellghostt wants to merge 1 commit into
Shellghostt wants to merge 1 commit into
Conversation
Collaborator
|
closing as duplicated #2356 |
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.
Fixes #1756
Summary
Building from a git checkout breaks for anyone with
log.showSignature=truein their git configuration.setup.pybuilds the local version segment from rawgit logoutput; with signature display enabled, git prepends thegpg:signature block to that output, so the version becomes0.14.0.dev+gpg: Signature made ...(the multi-line signature text happens to contain exactly one., so the date/time unpacking appears to succeed) and setuptools raisesInvalidVersion.Reproduced on current master:
python setup.py --version→0.14.0.dev0+20261104.142624.0b3ef2bgit config log.showSignature true && python setup.py --version→packaging.version.InvalidVersion: Invalid version: "0.14.0.dev+gpg: Signature made ..."Change
One line in
setup.py: pass--no-show-signatureto thegit loginvocation, so the version is built from the commit date and hash regardless of the user's signature-display setting.Verification
After the fix,
python setup.py --versionproduces byte-identical output (0.14.0.dev0+20261104.142624.0b3ef2b) withlog.showSignatureboth unset and set totrue. No other behaviour changes; the fallback to an empty local segment when git is unavailable is untouched.