ci: fix ci build wheel issue for python
diff --git a/.github/workflows/release_python.yml b/.github/workflows/release_python.yml index d7bd04c..7be7171 100644 --- a/.github/workflows/release_python.yml +++ b/.github/workflows/release_python.yml
@@ -94,9 +94,10 @@ - name: Install protoc (Windows) if: runner.os == 'Windows' - run: choco install protobuf -y + run: choco install protoc -y shell: pwsh + # Install protoc in manylinux container (x86_64/aarch64); script shared via YAML anchor - uses: PyO3/maturin-action@v1 with: working-directory: bindings/python @@ -104,6 +105,21 @@ command: build args: --release -o dist -i python3.9 manylinux: ${{ matrix.manylinux || 'auto' }} + container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' && 'off' || '' }} + before-script-linux: &protoc-install | + set -e + ARCH=$(uname -m) + case "$ARCH" in + x86_64) ZIP=protoc-27.1-linux-x86_64.zip ;; + aarch64) ZIP=protoc-27.1-linux-aarch_64.zip ;; + *) echo "Unsupported arch $ARCH"; exit 1 ;; + esac + curl -sLO "https://github.com/protocolbuffers/protobuf/releases/download/v27.1/${ZIP}" + python3 -c "import zipfile; zipfile.ZipFile('${ZIP}').extractall('/tmp/protoc_install')" + chmod +x /tmp/protoc_install/bin/protoc + rm -f "${ZIP}" + export PATH="/tmp/protoc_install/bin:$PATH" + export PROTOC=/tmp/protoc_install/bin/protoc - uses: PyO3/maturin-action@v1 with: working-directory: bindings/python @@ -111,6 +127,8 @@ command: build args: --release -o dist -i python3.10 manylinux: ${{ matrix.manylinux || 'auto' }} + container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' && 'off' || '' }} + before-script-linux: *protoc-install - uses: PyO3/maturin-action@v1 with: working-directory: bindings/python @@ -118,6 +136,8 @@ command: build args: --release -o dist -i python3.11 manylinux: ${{ matrix.manylinux || 'auto' }} + container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' && 'off' || '' }} + before-script-linux: *protoc-install - uses: PyO3/maturin-action@v1 with: working-directory: bindings/python @@ -125,6 +145,8 @@ command: build args: --release -o dist -i python3.12 manylinux: ${{ matrix.manylinux || 'auto' }} + container: ${{ matrix.os == 'ubuntu-latest' && matrix.target == 'x86_64' && 'off' || '' }} + before-script-linux: *protoc-install - name: Upload wheels uses: actions/upload-artifact@v4
diff --git a/bindings/python/Cargo.toml b/bindings/python/Cargo.toml index 9cf20e3..30ac046 100644 --- a/bindings/python/Cargo.toml +++ b/bindings/python/Cargo.toml
@@ -27,7 +27,7 @@ crate-type = ["cdylib"] [dependencies] -pyo3 = { version = "0.26.0", features = ["extension-module"] } +pyo3 = { version = "0.26.0", features = ["extension-module", "generate-import-lib"] } fluss = { workspace = true, features = ["storage-all"] } tokio = { workspace = true } arrow = { workspace = true }