From 58799d91a719206f2f8c407c13e7119df3443a46 Mon Sep 17 00:00:00 2001 From: Douglas Yang Date: Fri, 23 Jan 2026 20:51:52 -0800 Subject: [PATCH] fix: nightly wheel naming for non-post versions (#17538) --- .github/workflows/release-pypi-nightly.yml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-pypi-nightly.yml b/.github/workflows/release-pypi-nightly.yml index 92759f340..0db69ff7e 100644 --- a/.github/workflows/release-pypi-nightly.yml +++ b/.github/workflows/release-pypi-nightly.yml @@ -49,7 +49,21 @@ jobs: cd python cp ../README.md ../LICENSE . - # Build wheel - setuptools-scm automatically generates version from git tags + # Parse git describe output to detect exact tag builds (distance=0) + # Use same command as pyproject.toml to ensure version consistency + DESC=$(git tag --list --sort=-version:refname 'v*.*.*' | head -1 | xargs git describe --tags --long 2>/dev/null || echo 'v0.0.0-0-g0000000') + DIST=$(echo "$DESC" | cut -d- -f2) + + # If building at exact tag (distance=0), force dev0 version for unique wheel names + if [ "$DIST" = "0" ]; then + TAG=$(echo "$DESC" | cut -d- -f1) + HASH=$(echo "$DESC" | cut -d- -f3-) + FORCE_VERSION="${TAG#v}.dev0+${HASH}" + echo "Building at exact tag, forcing version to: $FORCE_VERSION" + export SETUPTOOLS_SCM_PRETEND_VERSION="$FORCE_VERSION" + fi + + # Build wheel python3 -m build --wheel # Extract version from built wheel filename