Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build(bindings/python): add python 3.10 back and remove pypy #5347

Merged
merged 11 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment on what this feature control and why we need this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


[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"

[project.optional-dependencies]
benchmark = [
Expand Down
Loading