Skip to content

[Fix][CI] fix nightly wheel versioning and build reliability#3097

Merged
sammshen merged 2 commits intoLMCache:devfrom
deng451e:fix/nightly-wheel-version
Apr 21, 2026
Merged

[Fix][CI] fix nightly wheel versioning and build reliability#3097
sammshen merged 2 commits intoLMCache:devfrom
deng451e:fix/nightly-wheel-version

Conversation

@deng451e
Copy link
Copy Markdown
Collaborator

@deng451e deng451e commented Apr 21, 2026

The nightly version (0.4.3.dev20260421) was less than stable (0.4.3)
in PEP 440, so pip always resolved the stable PyPI release instead of
the nightly wheel.

  • Remove SETUPTOOLS_SCM_PRETEND_VERSION — setuptools-scm now derives
    0.4.4.devN from git history, correctly higher than stable 0.4.3
  • Strip non-v* tags after checkout — tags like nightly-cu13 contain
    digits and match setuptools-scm's default *[0-9]* pattern, causing
    an AssertionError during version parsing
  • Replace git push origin :refs/tags/<tag> with gh release delete --cleanup-tag — deletes tags via API, no dependency on origin
  • Add workflow_dispatch for manual nightly triggers

Note

Low Risk
Changes are limited to GitHub Actions workflows and release-tag handling; main risk is accidentally deleting or mis-naming Git tags/releases in automation.

Overview
Improves nightly wheel publishing reliability by adding workflow_dispatch, stripping non-v* tags after checkout to avoid setuptools-scm version parsing failures, and relying on setuptools-scm-derived versions (removes SETUPTOOLS_SCM_PRETEND_VERSION and the custom nightly version computation).

Simplifies nightly release cleanup by switching to gh release delete --cleanup-tag instead of manual tag deletion via git push, and applies the non-release tag cleanup step to publish.yml build jobs as well.

Reviewed by Cursor Bugbot for commit 65da8db. Bugbot is set up for automated code reviews on this repo. Configure here.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Note

Gemini is unable to generate a review for this pull request due to the file types involved not being currently supported.

@deng451e deng451e force-pushed the fix/nightly-wheel-version branch from 7368d9b to 7bc01db Compare April 21, 2026 19:46
@deng451e deng451e changed the title [Fix][CI] : fix nightly wheel versioning so pre-release is preferred over stable [Fix][CI] fix nightly wheel versioning and build reliability Apr 21, 2026
fetch-depth: 0

- name: Remove non-release tags
run: git tag -l | grep -v '^v' | xargs -r git tag -d
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grep fails step when no non-release tags exist

High Severity

GitHub Actions uses bash -eo pipefail by default. When all local tags start with v (common after a successful --cleanup-tag or on a first run), grep -v '^v' matches nothing and exits with code 1. Due to pipefail, the pipeline inherits that non-zero exit code, and -e causes the step to fail immediately, aborting the entire nightly build. The grep needs to be wrapped (e.g., { grep -v '^v' || true; }) to handle the no-match case gracefully.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 5d51adb. Configure here.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c845bb6. Configure here.

fetch-depth: 0

- name: Remove non-release tags
run: git tag -l | grep -v '^v' | xargs -r git tag -d
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pipeline fails with pipefail when no non-release tags exist

Medium Severity

publish.yml sets shell: bash in its defaults (line 26), which enables pipefail. When all tags start with v (no non-release tags to remove), grep -v '^v' exits with code 1 (no matches). With pipefail, this non-zero exit propagates through the pipe, causing the step — and thus the entire build-artifacts or build-cli-artifacts job — to fail. Adding || true after the pipeline would prevent this.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit c845bb6. Configure here.

- Remove SETUPTOOLS_SCM_PRETEND_VERSION from CIBW_ENVIRONMENT: the
  0.4.3.devDATE override sorted below the stable 0.4.3 release in PEP
  440 order, so pip always preferred the stable wheel. Letting
  setuptools-scm derive the version from git (e.g. 0.4.4.dev63) gives
  a pre-release that correctly sorts above the last stable tag.

- Replace `git push origin :refs/tags/nightly` with
  `gh release delete --cleanup-tag` so the tag is deleted via the
  GitHub API rather than a push to origin (which may point to a fork).

- Add "Remove non-release tags" step after checkout: rolling release
  tags like `nightly` and `nightly-cu13` contain digits and match
  setuptools-scm's default *[0-9]* pattern. Without this step,
  `git describe` returns e.g. `nightly-cu13-0-gabcdef` which causes an
  AssertionError (or InvalidVersion) during the wheel build.

- Add workflow_dispatch trigger to allow manual nightly wheel builds.

Signed-off-by: deng451e <838677410@qq.com>
Same setuptools-scm fix as nightly_build.yml: rolling release tags
(nightly, nightly-cu13) contain digits matching the default *[0-9]*
pattern. This caused build-artifacts, build-cli-artifacts, and
build-cu130-artifacts to fail with InvalidVersion when git describe
returned 'nightly' and CU130_VERSION=nightly was passed as
SETUPTOOLS_SCM_PRETEND_VERSION.

Add "Remove non-release tags" after checkout in all three build jobs.

Signed-off-by: deng451e <838677410@qq.com>
@deng451e deng451e force-pushed the fix/nightly-wheel-version branch from c845bb6 to 65da8db Compare April 21, 2026 20:45
Copy link
Copy Markdown
Contributor

@ApostaC ApostaC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Copy Markdown
Collaborator

@maobaolong maobaolong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@maobaolong maobaolong added full Run comprehensive tests on this PR labels Apr 21, 2026
Copy link
Copy Markdown
Contributor

@sammshen sammshen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@sammshen sammshen merged commit e98dc3c into LMCache:dev Apr 21, 2026
41 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full Run comprehensive tests on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants