Skip to content

fix(vcs-versioning): accept tool= in _version_missing again - #1551

Merged
RonnyPfannschmidt merged 1 commit into
pypa:mainfrom
RonnyPfannschmidt:fix/version-missing-accepts-tool
Sep 23, 2026
Merged

RonnyPfannschmidt merged 1 commit into
pypa:mainfrom
RonnyPfannschmidt:fix/version-missing-accepts-tool

Conversation

@RonnyPfannschmidt

Copy link
Copy Markdown
Contributor

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 allow vcs-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 with

TypeError: _version_missing() got an unexpected keyword argument 'tool'

instead of the LookupError that says how to set a version.

_version_missing now accepts tool again and ignores it. Those callers passed config.env.tool_names[0], which is what the function reads now anyway.

Verification (the agent ran each setuptools-scm tag's testing_scm against the given vcs-versioning):

setuptools-scm 2.4.0 2.4.1 this branch
10.1.1 – 10.2.3 no test_pkginfo_noscmroot failure test_pkginfo_noscmroot fails with the TypeError no test_pkginfo_noscmroot failure
10.3.3 202 passed 202 passed 202 passed

10.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.

  • New regression test 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 -a clean.
  • Changelog fragment vcs-versioning/changelog.d/1550.bugfix.md; ships with vcs-versioning 2.5.0 (no maintenance-branch release).

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>
@RonnyPfannschmidt
RonnyPfannschmidt merged commit e40176e into pypa:main Sep 23, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

setuptools-scm 10.2.3 + vcs-versioning 2.4.1: TypeError masks the 'unable to detect version' error

1 participant