[Fix] Fix setuptools-scm version resolution for rc tags (#22165)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: Baizhou Zhang <sobereddiezhang@gmail.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
Baizhou Zhang
parent
30ba1f78b0
commit
93109cc89b
@@ -54,10 +54,7 @@ jobs:
|
||||
cd python
|
||||
cp ../README.md ../LICENSE .
|
||||
|
||||
# Parse git describe output to get latest tag
|
||||
# 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')
|
||||
TAG=$(echo "$DESC" | cut -d- -f1)
|
||||
TAG=$(python3 ../python/tools/get_version_tag.py)
|
||||
HASH="g$(git rev-parse --short HEAD)"
|
||||
BUILD_DATE=$(date -u +%Y%m%d)
|
||||
|
||||
|
||||
@@ -34,12 +34,7 @@ jobs:
|
||||
- name: Generate PR wheel version
|
||||
id: gen_version
|
||||
run: |
|
||||
# Get base version from the latest v*.*.* git tag directly
|
||||
# Note: We cannot use setuptools_scm here because the [tool.setuptools_scm]
|
||||
# config (with custom git_describe_command) lives in python/pyproject.toml,
|
||||
# not at the repo root. Without that config, setuptools_scm falls back to
|
||||
# default git describe which finds gateway-* tags instead of v*.*.* release tags.
|
||||
LATEST_TAG=$(git tag --list --sort=-version:refname 'v*.*.*' | head -1)
|
||||
LATEST_TAG=$(python3 python/tools/get_version_tag.py)
|
||||
BASE_VERSION=${LATEST_TAG#v}
|
||||
echo "Latest release tag: ${LATEST_TAG}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user