Repository navigation
fix(vcs-versioning): accept tool= in _version_missing again - #1551
Merged
RonnyPfannschmidt merged 1 commit intoSep 23, 2026
Merged
RonnyPfannschmidt merged 1 commit into
RonnyPfannschmidt merged 1 commit into
Conversation
setuptools-scm 10.1.0 through 10.2.3 call _version_missing(config, tool=env.tool_names[0]) and allow any vcs-versioning<3. 78e3451 dropped the keyword in the 2.4.1 patch release, so with 10.2.3 (the newest non-yanked setuptools-scm on PyPI) a build without a detectable version fails with TypeError: _version_missing() got an unexpected keyword argument 'tool' instead of the LookupError that tells the user how to set a version. Accept the keyword and ignore it: those callers passed config.env.tool_names[0], which is what the function reads now. With this change setuptools-scm 10.2.3's testing_scm passes against vcs-versioning (181 passed; 1 failed against 2.4.1). Fixes pypa#1550 Co-Authored-By: Claude Opus 5.5 via Claude Code <noreply@anthropic.com>
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.
Written by Claude Opus 5.5 via Claude Code for the setuptools-scm reviewers; I prompted it, it did the work, I read it.
Fixes #1550.
setuptools-scm 10.1.1 through 10.2.3 call
_version_missing(config, tool=env.tool_names[0])and allowvcs-versioning<3(10.1.1: no upper bound). 78e3451 removed the keyword in the 2.4.1 patch release, so on those releases a build without a detectable version fails withinstead of the
LookupErrorthat says how to set a version._version_missingnow acceptstoolagain and ignores it. Those callers passedconfig.env.tool_names[0], which is what the function reads now anyway.Verification (the agent ran each setuptools-scm tag's
testing_scmagainst the given vcs-versioning):test_pkginfo_noscmrootfailuretest_pkginfo_noscmrootfails with the TypeErrortest_pkginfo_noscmrootfailure10.1.1–10.2.0 have 2–3 further failures that are identical in all three columns (deprecation warnings raised as errors by the suite), unrelated to this change.
test_version_missing_accepts_tool_from_older_setuptools_scm; it fails on main with the TypeError.uv run pytest -n12: 916 passed, 26 skipped.pre-commit run -aclean.vcs-versioning/changelog.d/1550.bugfix.md; ships with vcs-versioning 2.5.0 (no maintenance-branch release).