From 2684ee71dcfcd335a86b6f725b91f0197e8602b4 Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Thu, 24 Jul 2025 13:44:02 -0700 Subject: [PATCH] fix: ensure uv build uses correct Python version in CI - Add --python python flag to uv build commands - This ensures wheels are built with the correct Python version (cp313 for Python 3.13, etc) - Fixes issue where Python 3.13 CI was building cp311 wheels - Also adds Python version verification before build --- .github/workflows/build-and-publish.yml | 4 ++-- .github/workflows/ci.yml | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish.yml b/.github/workflows/build-and-publish.yml index d0a74a0..dd1a5d7 100644 --- a/.github/workflows/build-and-publish.yml +++ b/.github/workflows/build-and-publish.yml @@ -90,7 +90,7 @@ jobs: - name: Build wheel run: | cd packages/leann-backend-hnsw - uv build --wheel + uv build --wheel --python python - name: Repair wheel (Linux) if: runner.os == 'Linux' @@ -167,7 +167,7 @@ jobs: - name: Build wheel run: | cd packages/leann-backend-diskann - uv build --wheel + uv build --wheel --python python - name: Repair wheel (Linux) if: runner.os == 'Linux' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a5436ff..9aa4b72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -55,12 +55,17 @@ jobs: echo "🔨 Building on ${{ matrix.os }} with Python ${{ matrix.python-version }}..." export UV_SYSTEM_PYTHON=1 + # Verify Python version + python --version + which python + # Build each package for pkg in leann-core leann-backend-hnsw leann-backend-diskann leann; do echo "Building $pkg..." cd packages/$pkg rm -rf dist/ build/ _skbuild/ - uv build --wheel + # Use explicit python interpreter + uv build --wheel --python python if [ ! -f dist/*.whl ]; then echo "❌ Failed to build $pkg!" exit 1