From ded0decd17a494ef68692b68f62f6195a5d7f19a Mon Sep 17 00:00:00 2001 From: Andy Lee Date: Sun, 10 Aug 2025 17:31:46 -0700 Subject: [PATCH] fix: resolve wheel installation conflicts in CI matrix builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix issue where multiple Python versions' wheels in the same dist directory caused installation conflicts during CI testing. The problem occurred when matrix builds for different Python versions accumulated wheels in shared directories, and uv pip install would find incompatible wheels. Changes: - Add Python version detection using matrix.python variable - Convert Python version to wheel tag format (e.g., 3.11 -> cp311) - Use find with version-specific pattern matching to select correct wheels - Add explicit error handling if no matching wheel is found This ensures each CI job installs only wheels compatible with its specific Python version, preventing "A path dependency is incompatible with the current platform" errors. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- .github/workflows/build-reusable.yml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-reusable.yml b/.github/workflows/build-reusable.yml index dce01f7..611ea6c 100644 --- a/.github/workflows/build-reusable.yml +++ b/.github/workflows/build-reusable.yml @@ -249,9 +249,29 @@ jobs: uv pip install packages/leann/dist/*.whl || uv pip install packages/leann/dist/*.tar.gz fi - # Install backend wheels directly - uv pip install packages/leann-backend-hnsw/dist/*.whl - uv pip install packages/leann-backend-diskann/dist/*.whl + # Install backend wheels directly with Python version filtering + PYTHON_VERSION="${{ matrix.python }}" + PYTHON_TAG="cp${PYTHON_VERSION//./}" # Convert 3.11 to cp311 + + # Find and install the correct wheel for this Python version + HNSW_WHEEL=$(find packages/leann-backend-hnsw/dist -name "*${PYTHON_TAG}*.whl" | head -1) + DISKANN_WHEEL=$(find packages/leann-backend-diskann/dist -name "*${PYTHON_TAG}*.whl" | head -1) + + if [ -n "$HNSW_WHEEL" ]; then + echo "Installing HNSW wheel: $HNSW_WHEEL" + uv pip install "$HNSW_WHEEL" + else + echo "No HNSW wheel found for Python $PYTHON_VERSION" + exit 1 + fi + + if [ -n "$DISKANN_WHEEL" ]; then + echo "Installing DiskANN wheel: $DISKANN_WHEEL" + uv pip install "$DISKANN_WHEEL" + else + echo "No DiskANN wheel found for Python $PYTHON_VERSION" + exit 1 + fi # Install base dependencies needed for testing (without the local packages) uv pip install numpy torch tqdm flask flask_compress datasets evaluate colorama boto3 "protobuf==4.25.3"