fix: adjust configuration for Colab compatibility

- Remove Windows support as not needed
- Move Python finding hints to cibuildwheel environment variables
- Keep pyproject.toml clean to avoid breaking normal builds
- Target manylinux_2_28 for better Colab compatibility
This commit is contained in:
Andy Lee
2025-07-25 10:09:21 -07:00
parent 2957c8bf5a
commit 015f43733a
4 changed files with 7 additions and 19 deletions

View File

@@ -16,7 +16,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, macos-latest, windows-latest] os: [ubuntu-latest, macos-latest]
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@@ -58,9 +58,6 @@ jobs:
CIBW_BEFORE_ALL_MACOS: | CIBW_BEFORE_ALL_MACOS: |
brew install boost zeromq openblas cmake brew install boost zeromq openblas cmake
CIBW_BEFORE_ALL_WINDOWS: |
choco install cmake -y
# Test the wheel # Test the wheel
CIBW_TEST_COMMAND: | CIBW_TEST_COMMAND: |
python -c "import leann_backend_hnsw; print('HNSW backend imported successfully')" python -c "import leann_backend_hnsw; print('HNSW backend imported successfully')"
@@ -68,6 +65,8 @@ jobs:
# Environment variables for build # Environment variables for build
CIBW_ENVIRONMENT: | CIBW_ENVIRONMENT: |
CMAKE_BUILD_PARALLEL_LEVEL=8 CMAKE_BUILD_PARALLEL_LEVEL=8
Python_FIND_VIRTUALENV=ONLY
Python3_FIND_VIRTUALENV=ONLY
- name: Build leann-backend-diskann wheels - name: Build leann-backend-diskann wheels
uses: pypa/cibuildwheel@v2.20.0 uses: pypa/cibuildwheel@v2.20.0
@@ -88,14 +87,13 @@ jobs:
CIBW_BEFORE_ALL_MACOS: | CIBW_BEFORE_ALL_MACOS: |
brew install boost zeromq openblas cmake brew install boost zeromq openblas cmake
CIBW_BEFORE_ALL_WINDOWS: |
choco install cmake -y
CIBW_TEST_COMMAND: | CIBW_TEST_COMMAND: |
python -c "import leann_backend_diskann; print('DiskANN backend imported successfully')" python -c "import leann_backend_diskann; print('DiskANN backend imported successfully')"
CIBW_ENVIRONMENT: | CIBW_ENVIRONMENT: |
CMAKE_BUILD_PARALLEL_LEVEL=8 CMAKE_BUILD_PARALLEL_LEVEL=8
Python_FIND_VIRTUALENV=ONLY
Python3_FIND_VIRTUALENV=ONLY
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with:

View File

@@ -22,6 +22,3 @@ sdist.include = ["CMakeLists.txt", "src", "third_party", "leann_backend_diskann/
[tool.scikit-build.cmake.define] [tool.scikit-build.cmake.define]
CMAKE_BUILD_PARALLEL_LEVEL = "8" CMAKE_BUILD_PARALLEL_LEVEL = "8"
# Help CMake find Python in cibuildwheel environments
Python_FIND_VIRTUALENV = "ONLY"
Python3_FIND_VIRTUALENV = "ONLY"

View File

@@ -25,6 +25,3 @@ cmake.verbose = true
# CMake definitions to optimize compilation # CMake definitions to optimize compilation
[tool.scikit-build.cmake.define] [tool.scikit-build.cmake.define]
CMAKE_BUILD_PARALLEL_LEVEL = "8" CMAKE_BUILD_PARALLEL_LEVEL = "8"
# Help CMake find Python in cibuildwheel environments
Python_FIND_VIRTUALENV = "ONLY"
Python3_FIND_VIRTUALENV = "ONLY"

View File

@@ -79,7 +79,3 @@ before-all = """
# macOS系统依赖 # macOS系统依赖
[tool.cibuildwheel.macos] [tool.cibuildwheel.macos]
before-all = "brew install boost zeromq openblas cmake" before-all = "brew install boost zeromq openblas cmake"
# Windows系统依赖
[tool.cibuildwheel.windows]
before-all = "choco install cmake -y"