From 07bdc1f663e2408b835b6f99dfdd360a614ffefa Mon Sep 17 00:00:00 2001 From: Wing Lian Date: Wed, 3 Jun 2026 08:28:21 +0000 Subject: [PATCH] fix(ci): build pypi release via `uv build` instead of removed setup.py The pyproject migration removed setup.py, so the publish workflow failed at `python setup.py sdist` (No such file). Build the sdist+wheel with `uv build` (PEP 517; setuptools backend reads the version from VERSION). Also make the GitHub release step idempotent so a re-run/re-tag of an existing release doesn't fail, and drop the unused dependency-install step. --- .github/workflows/pypi.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/pypi.yml b/.github/workflows/pypi.yml index c2fc1c9d87..c03c209c72 100644 --- a/.github/workflows/pypi.yml +++ b/.github/workflows/pypi.yml @@ -8,9 +8,6 @@ on: permissions: {} -env: - UV_SYSTEM_PYTHON: "1" - jobs: setup_release: name: Create Release @@ -24,7 +21,10 @@ jobs: - name: Create release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: gh release create "$GITHUB_REF_NAME" --generate-notes + # idempotent: don't fail a re-run if the release already exists + run: | + gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1 \ + || gh release create "$GITHUB_REF_NAME" --generate-notes pypi-publish: name: Upload release to PyPI runs-on: ubuntu-latest @@ -47,13 +47,6 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v7 - - name: Install dependencies - run: | - uv pip install wheel packaging - uv pip install --no-build-isolation -e . - uv pip install black mypy pre-commit types-requests quartodoc jupyter blobfile tiktoken \ - codecov codecov-cli pytest pytest-cov pytest-retry pytest-sugar pytest-xdist tbparse - - name: Extract tag name id: tag run: echo "TAG_NAME=$(echo $GITHUB_REF | cut -d / -f 3)" >> "$GITHUB_OUTPUT" @@ -62,9 +55,10 @@ jobs: run: | echo "${{ steps.tag.outputs.TAG_NAME }}" | sed 's/^v//' > VERSION - - name: Build a source dist - run: | - python setup.py sdist + - name: Build sdist and wheel + # PEP 517 build via uv (setuptools backend reads the version from VERSION); + # replaces the removed `python setup.py sdist` after the pyproject migration. + run: uv build - name: Publish package distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1