Skip to content

Commit 1ac9328

Browse files
fix: use git tag instead of package spec for griffe comparison
Griffe's --against parameter expects a git ref, not a package spec. Changed from 'setuptools-scm==X.Y.Z' to git tag format 'vX.Y.Z'. Falls back to v9.2.1 if no tag is found.
1 parent 5968fba commit 1ac9328

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

.github/workflows/api-check.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,18 @@ jobs:
3131
- name: Install the latest version of uv
3232
uses: astral-sh/setup-uv@v6
3333

34-
- name: Get latest PyPI version
35-
id: pypi-version
34+
- name: Get latest release tag
35+
id: latest-tag
3636
run: |
37-
# Query PyPI for the latest stable version before building current code
38-
LATEST_VERSION=$(curl -s https://pypi.org/pypi/setuptools-scm/json | python -c "import sys, json; print(json.load(sys.stdin)['info']['version'])")
39-
echo "Latest PyPI version: $LATEST_VERSION"
40-
echo "version=$LATEST_VERSION" >> $GITHUB_OUTPUT
37+
# Get the latest git tag (griffe needs a git ref)
38+
LATEST_TAG=$(git describe --tags --abbrev=0 origin/main 2>/dev/null || echo "v9.2.1")
39+
echo "Latest release tag: $LATEST_TAG"
40+
echo "tag=$LATEST_TAG" >> $GITHUB_OUTPUT
4141
4242
- name: Install dependencies
4343
run: uv sync --group test
4444

45-
- name: Check API stability against PyPI
45+
- name: Check API stability against latest release
4646
run: |
47-
echo "Comparing current code against PyPI version: ${{ steps.pypi-version.outputs.version }}"
48-
uv run griffe check setuptools_scm -ssrc --verbose --against "setuptools-scm==${{ steps.pypi-version.outputs.version }}"
47+
echo "Comparing current code against tag: ${{ steps.latest-tag.outputs.tag }}"
48+
uv run griffe check setuptools_scm -ssrc --verbose --against ${{ steps.latest-tag.outputs.tag }}

0 commit comments

Comments
 (0)