Skip to content

bug(build): setuptools_scm fails on the sdk/go/vX.Y.Z tag in full clones, breaking license:check #5000

Closed

Description

@politerealism

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:check and mise run pre-commit pass in a fresh full clone that includes sdk/go/vX.Y.Z tags.
  • The Python project version still derives from the vX.Y.Z release tags.
  • CI behavior is unchanged.

Reproduction Steps

  1. git clone https://github.com/NVIDIA/OpenShell && cd OpenShell (tags are included by default).
  2. git describe --tags prints sdk/go/v0.1.6-6-g44ef984b5.
  3. In a fresh clone or worktree with a clean uv cache, run mise run license:check or uv run python -c "print('ok')". Both fail with the error above.
  4. Controls: git describe --tags --match 'v[0-9]*' prints v0.1.6-6-g44ef984b5; uv run --no-project python -c "print('ok')" works; a git clone --depth 1 copy 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: 44ef984b5 on main (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

  1. added
    state:acceptedA maintainer decided OpenShell should pursue this issue
    and removed
    state:triage-neededOpened without agent diagnostics and needs triage
    on Oct 28, 2026
  2. TaylorMutch commented on Oct 28, 2026

    @TaylorMutch
    Collaborator

    📋 triage-agent

    Disposition: accepted and completed; already fixed on main by #5018, commit 2fb8d78.

    The root pyproject.toml now configures setuptools_scm with the exact proposed git describe --dirty --tags --long --match 'v[0-9]*' filter, excluding sdk/go/vX.Y.Z tags while retaining release-derived Python versions.

    Verification:

    • A temporary Git repository with both sdk/go/v0.1.6 and v0.1.6 on the same commit reproduced version-detection failure without the filter. The configuration from main resolved the version as 0.1.6 and, after another commit, 0.1.7.dev1+g….
    • A fresh-cache uv build on main successfully produced both the source distribution and wheel.
    • The full pre-commit suite was not run.

    Per maintainer direction, recording state:accepted for posterity and closing as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:acceptedA maintainer decided OpenShell should pursue this issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions