Skip to content

Commit

Permalink
build(bindings/python): add python 3.10 back and remove pypy (#5347)
Browse files Browse the repository at this point in the history
Co-authored-by: Xuanwo <[email protected]>
  • Loading branch information
trim21 and Xuanwo authored Nov 20, 2024
1 parent b0befb7 commit fc8f559
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 45 deletions.
63 changes: 21 additions & 42 deletions .github/workflows/release_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ name: Release Python
on:
push:
tags:
- '*'
- "*"
pull_request:
branches:
- main
Expand Down Expand Up @@ -51,60 +51,39 @@ jobs:
name: wheels
path: bindings/python/dist

linux:
runs-on: ubuntu-latest
wheels:
runs-on: "${{ matrix.os }}"
strategy:
matrix:
target: [ x86_64, aarch64, armv7l ]
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
manylinux: auto
working-directory: "bindings/python"
command: build
args: --release -o dist --find-interpreter --features=pyo3/extension-module,services-all
env:
# Workaround ring 0.17 build issue
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: bindings/python/dist

windows:
runs-on: windows-latest
include:
- { os: windows-latest }
- { os: macos-latest, target: "universal2-apple-darwin" }
- { os: ubuntu-latest, target: "x86_64" }
- { os: ubuntu-latest, target: "aarch64" }
- { os: ubuntu-latest, target: "armv7l" }
env:
# Workaround ring 0.17 build issue
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
target: "${{ matrix.target }}"
command: build
args: --release -o dist --find-interpreter --features=pyo3/extension-module,services-all
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: wheels
path: bindings/python/dist

macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Setup Rust toolchain
uses: ./.github/actions/setup
args: --release -o dist -i python3.11 --features=pyo3/extension-module,services-all,abi3
sccache: true
manylinux: auto
- uses: PyO3/maturin-action@v1
with:
working-directory: "bindings/python"
target: "${{ matrix.target }}"
command: build
target: universal2-apple-darwin
args: --release -o dist --find-interpreter --features=pyo3/extension-module,services-all
args: --release -o dist -i python3.10 --features=pyo3/extension-module,services-all
sccache: true
manylinux: auto
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
Expand All @@ -118,7 +97,7 @@ jobs:
permissions:
contents: read
id-token: write
needs: [ macos, linux, windows ]
needs: [sdist, wheels]
steps:
- uses: actions/download-artifact@v3
with:
Expand Down
4 changes: 3 additions & 1 deletion bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@ services-tikv = ["opendal/services-tikv"]
services-upyun = ["opendal/services-upyun"]
services-vercel-artifacts = ["opendal/services-vercel-artifacts"]
services-yandex-disk = ["opendal/services-yandex-disk"]
# we build cp311-abi3 and cp310 wheels now, move this to pyo3 after we drop cp310
abi3 = ["pyo3/abi3-py311"]

[lib]
crate-type = ["cdylib"]
Expand All @@ -161,7 +163,7 @@ futures = "0.3.28"
opendal = { version = ">=0", path = "../../core", features = [
"layers-blocking",
] }
pyo3 = { version = "0.22.5", features = ["abi3", "abi3-py311"] }
pyo3 = "0.22.5"
pyo3-async-runtimes = { version = "0.22.0", features = [
"tokio-runtime",
] }
Expand Down
3 changes: 1 addition & 2 deletions bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@ requires = ["maturin>=1.0,<2.0"]
classifiers = [
"Programming Language :: Rust",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
]
description = "Apache OpenDAL™ Python Binding"
license = { text = "Apache-2.0" }
name = "opendal"
readme = "README.md"
requires-python = ">=3.11"
requires-python = ">=3.10"

dynamic = ['version']

Expand Down

0 comments on commit fc8f559

Please sign in to comment.