Repository navigation
bug(build): setuptools_scm fails on the sdk/go/vX.Y.Z tag in full clones, breaking license:check #5000
Description
User Story
As a contributor with a normal clone of OpenShell, I want mise run pre-commit and the other tasks that build the Python project to keep working after a release, so I can follow the contributor workflow in AGENTS.md without debugging version tooling.
Problem Statement
Since the v0.1.6 release, the release commit carries two tags: v0.1.6 and sdk/go/v0.1.6. The second one is created by sdk-go-tag.yml (added in #4262 for #4261) because Go resolves the nested sdk/go module from prefixed tags. Both are lightweight tags on the same commit.
In a clone that has tags, git describe --tags ties and picks sdk/go/v0.1.6. setuptools_scm cannot parse a tag with a slash, so any uv invocation that has to build the root openshell project fails:
ValueError: Can't parse version from tag 'sdk/go/v0.1.6'
mise run license:check is part of mise run pre-commit. It runs uv run python scripts/update_license_headers.py --check, which builds the project, so it fails.
The Python tasks in tasks/python.toml already avoid this by setting SETUPTOOLS_SCM_PRETEND_VERSION_FOR_OPENSHELL = "0.0.0". The license task does not, and neither do other tasks that run uv run python ... (notices, version, sbom; I confirmed license:check and a bare uv run python -c ... fail, and did not test the others individually). The root pyproject.toml has no [tool.setuptools_scm] section.
CI does not hit it. The license-headers job uses a default shallow checkout with no tags; I confirmed the same command passes on a git clone --depth 1 copy. Every future release will add another sdk/go/vX.Y.Z tag on its release commit, so full clones stay affected.
Impact / Why This Matters
Contributors who run the required pre-commit before committing get a Python traceback from a check that has nothing to do with their change. An environment that uv already built keeps working until it rebuilds the project (a fresh clone, a new worktree, a changed lockfile), so the failure shows up unpredictably. The workarounds, setting SETUPTOOLS_SCM_PRETEND_VERSION to any value or deleting the local tag, are not documented.
Anyone who builds the root Python package from a full checkout with uv build or pip fails the same way unless they pin a version. The release workflows set the pretend version, so releases are unaffected.
Acceptance Criteria
-
mise run license:checkandmise run pre-commitpass in a fresh full clone that includessdk/go/vX.Y.Ztags. - The Python project version still derives from the
vX.Y.Zrelease tags. - CI behavior is unchanged.
Reproduction Steps
git clone https://github.com/NVIDIA/OpenShell && cd OpenShell(tags are included by default).git describe --tagsprintssdk/go/v0.1.6-6-g44ef984b5.- In a fresh clone or worktree with a clean
uvcache, runmise run license:checkoruv run python -c "print('ok')". Both fail with the error above. - Controls:
git describe --tags --match 'v[0-9]*'printsv0.1.6-6-g44ef984b5;uv run --no-project python -c "print('ok')"works; agit clone --depth 1copy has no tags and passes.
Suggested UX (if applicable)
Proposed fix, not implemented yet. I would like maintainers to confirm the approach before I open a PR. Add this to the root pyproject.toml so setuptools_scm only considers release tags:
[tool.setuptools_scm]
git_describe_command = ["git", "describe", "--dirty", "--tags", "--long", "--match", "v[0-9]*"]I tested it in a fresh worktree of main with a clean uv cache: license:check passes and the project builds as 0.1.7.dev6+g44ef984b5, which is the expected next development version after v0.1.6.
Alternative: set SETUPTOOLS_SCM_PRETEND_VERSION_FOR_OPENSHELL = "0.0.0" on the license, notices, version and sbom tasks, as tasks/python.toml does. That fixes the mise tasks but leaves raw uv/pip builds exposed.
Which approach do you prefer?
Environment
- OS: Fedora Linux 44
- git 2.56.0, uv 0.12.17, mise 2026.8.8
- Commit:
44ef984b5onmain(6 commits after v0.1.6)
Logs
ValueError: Can't parse version from tag 'sdk/go/v0.1.6'
(tag_regex='^(?:[\w-]+-)?(?P<version>[vV]?\d+(?:\.\d+){0,2}[^\+]*)(?:\+.*)?$', tag_prefix='')
...
[license:check] ERROR task failed
Activity
TaylorMutch commentedon Oct 28, 2026
Disposition: accepted and completed; already fixed on
mainby #5018, commit 2fb8d78.The root
pyproject.tomlnow configuressetuptools_scmwith the exact proposedgit describe --dirty --tags --long --match 'v[0-9]*'filter, excludingsdk/go/vX.Y.Ztags while retaining release-derived Python versions.Verification:
sdk/go/v0.1.6andv0.1.6on the same commit reproduced version-detection failure without the filter. The configuration from main resolved the version as0.1.6and, after another commit,0.1.7.dev1+g….uv buildon main successfully produced both the source distribution and wheel.Per maintainer direction, recording
state:acceptedfor posterity and closing as completed.