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