Skip to content

fix(setup): ignore git signature display when building the version - #2364

Closed
Shellghostt wants to merge 1 commit into
fortra:masterfrom
Shellghostt:fix-setup-show-signature
Closed

Shellghostt wants to merge 1 commit into
fortra:masterfrom
Shellghostt:fix-setup-show-signature

Conversation

@Shellghostt

Copy link
Copy Markdown

Fixes #1756

Summary

Building from a git checkout breaks for anyone with log.showSignature=true in their git configuration. setup.py builds the local version segment from raw git log output; with signature display enabled, git prepends the gpg: signature block to that output, so the version becomes 0.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 raises InvalidVersion.

Reproduced on current master:

  • python setup.py --version → 0.14.0.dev0+20261104.142624.0b3ef2b
  • git 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-signature to the git log invocation, 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 --version produces byte-identical output (0.14.0.dev0+20261104.142624.0b3ef2b) with log.showSignature both unset and set to true. No other behaviour changes; the fallback to an empty local segment when git is unavailable is untouched.

@anadrianmanrique

Copy link
Copy Markdown
Collaborator

closing as duplicated #2356

@anadrianmanrique anadrianmanrique added duplicate This issue or pull request already exists invalid This issue or pull request is no longer relevant labels Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

duplicate This issue or pull request already exists invalid This issue or pull request is no longer relevant

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Signed commits break building and installing from git repo if log.showSignature=true in git

2 participants