fix: handle pure Python packages in cibuildwheel workflow

- Build pure Python packages (leann-core, leann) with standard build tool
- Only use cibuildwheel for C extension packages (leann-backend-hnsw, leann-backend-diskann)
- Build pure Python packages only once on ubuntu-latest
- Add Python setup for building pure packages
- Add package listing step for debugging
This commit is contained in:
Andy Lee
2025-07-25 00:26:15 -07:00
parent 5c836ad08e
commit c4a0a68581

View File

@@ -24,16 +24,21 @@ jobs:
ref: ${{ inputs.ref }} ref: ${{ inputs.ref }}
submodules: recursive submodules: recursive
# Build each package separately in our monorepo - name: Setup Python
- name: Build leann-core wheels uses: actions/setup-python@v5
uses: pypa/cibuildwheel@v2.16.2
with: with:
package-dir: packages/leann-core python-version: '3.11' # Version for building pure Python packages
output-dir: wheelhouse
env: # Build each package separately in our monorepo
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* - name: Build pure Python packages (leann-core, leann)
CIBW_SKIP: "*-win32 *-manylinux_i686 pp*" if: matrix.os == 'ubuntu-latest' # Only build once, they're platform-independent
# Pure Python package, no special requirements run: |
# Install build tools
python -m pip install --upgrade pip build
# Build pure Python packages
python -m build packages/leann-core --outdir wheelhouse/
python -m build packages/leann --outdir wheelhouse/
- name: Build leann-backend-hnsw wheels - name: Build leann-backend-hnsw wheels
uses: pypa/cibuildwheel@v2.16.2 uses: pypa/cibuildwheel@v2.16.2
@@ -85,15 +90,10 @@ jobs:
CIBW_TEST_REQUIRES: leann-core numpy CIBW_TEST_REQUIRES: leann-core numpy
CIBW_TEST_COMMAND: python -c "import leann_backend_diskann" CIBW_TEST_COMMAND: python -c "import leann_backend_diskann"
- name: Build leann meta-package - name: List built packages
uses: pypa/cibuildwheel@v2.16.2 run: |
with: echo "📦 Built packages:"
package-dir: packages/leann ls -la wheelhouse/
output-dir: wheelhouse
env:
CIBW_BUILD: cp39-* cp310-* cp311-* cp312-*
CIBW_SKIP: "*-win32 *-manylinux_i686 pp*"
# Pure Python meta-package
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v4
with: with: