-
-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Maturin directly for building distributions (#755)
- Loading branch information
Showing
139 changed files
with
556 additions
and
379 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,91 +7,99 @@ on: | |
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build_wheels: | ||
name: Build wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }}-latest | ||
build: | ||
name: Build on ${{ matrix.platform || matrix.os }} (${{ matrix.target }} - ${{ matrix.manylinux || 'auto' }}) | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu, windows, macos ] | ||
os: [ubuntu, macos, windows] | ||
target: [x86_64, aarch64] | ||
manylinux: [auto] | ||
include: | ||
- os: ubuntu | ||
platform: linux | ||
- os: windows | ||
ls: dir | ||
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10 | ||
- os: windows | ||
ls: dir | ||
target: aarch64 | ||
interpreter: 3.11 3.12 | ||
- os: macos | ||
target: aarch64 | ||
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9 pypy3.10 | ||
- os: ubuntu | ||
platform: linux | ||
target: aarch64 | ||
# mimalloc not supported on manylinux2014 cross-compile container | ||
extra-build-args: --no-default-features | ||
# musllinux | ||
- os: ubuntu | ||
platform: linux | ||
target: x86_64 | ||
manylinux: musllinux_1_1 | ||
- os: ubuntu | ||
platform: linux | ||
target: aarch64 | ||
manylinux: musllinux_1_1 | ||
- os: ubuntu | ||
platform: linux | ||
target: ppc64le | ||
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 | ||
# mimalloc not supported on manylinux2014 cross-compile container | ||
extra-build-args: --no-default-features | ||
- os: ubuntu | ||
platform: linux | ||
target: s390x | ||
interpreter: 3.7 3.8 3.9 3.10 3.11 3.12 | ||
# mimalloc not supported on manylinux2014 cross-compile container | ||
extra-build-args: --no-default-features | ||
|
||
runs-on: ${{ matrix.os }}-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up rust | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: set up python | ||
uses: actions/setup-python@v4 | ||
with: | ||
toolchain: stable | ||
python-version: '3.11' | ||
architecture: ${{ matrix.python-architecture || 'x64' }} | ||
|
||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
- name: build wheels | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
key: ${{ matrix.os }} | ||
target: ${{ matrix.target }} | ||
manylinux: ${{ matrix.manylinux || 'auto' }} | ||
container: ${{ matrix.container }} | ||
args: --release --out dist --interpreter ${{ matrix.interpreter || '3.7 3.8 3.9 3.10 3.11 3.12 pypy3.7 pypy3.8 pypy3.9 pypy3.10' }} ${{ matrix.extra-build-args }} | ||
rust-toolchain: stable | ||
docker-options: -e CI | ||
|
||
- name: Set up QEMU | ||
if: runner.os == 'Linux' | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: all | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_LINUX: auto aarch64 | ||
CIBW_ARCHS_MACOS: x86_64 | ||
CIBW_ARCHS_WINDOWS: AMD64 | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" | ||
with: | ||
package-dir: . | ||
output-dir: dist | ||
- run: ${{ matrix.ls || 'ls -lh' }} dist/ | ||
|
||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: ./dist/* | ||
|
||
build_wheels_macos_arm: | ||
name: Build arm64 wheels on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ macos-12 ] | ||
path: dist | ||
|
||
build_sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up rust | ||
uses: dtolnay/rust-toolchain@stable | ||
- name: Build sdist | ||
uses: PyO3/maturin-action@v1 | ||
with: | ||
toolchain: stable | ||
|
||
- name: Setup Rust cache | ||
uses: Swatinem/rust-cache@v2 | ||
with: | ||
key: ${{ matrix.os }} | ||
|
||
- name: Build wheels | ||
uses: pypa/[email protected] | ||
env: | ||
CIBW_ARCHS_MACOS: arm64 | ||
CIBW_PROJECT_REQUIRES_PYTHON: ">=3.8" | ||
with: | ||
package-dir: . | ||
output-dir: dist | ||
|
||
- name: Fix wheel tags | ||
run: | | ||
python3 -m pip install wheel | ||
python3 -m wheel tags --platform-tag macosx_12_0_arm64 dist/*-macosx*.whl --remove | ||
- uses: actions/upload-artifact@v3 | ||
command: sdist | ||
args: --out dist | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: dist | ||
path: ./dist/* | ||
path: dist | ||
|
||
|
||
Release: | ||
needs: [ build_wheels, build_wheels_macos_arm ] | ||
needs: [ build, build_sdist ] | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
|
||
|
@@ -112,9 +120,6 @@ jobs: | |
- name: Update PATH | ||
run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
|
||
- name: Build sdist | ||
run: poetry build --format sdist | ||
|
||
- name: Check distributions | ||
run: | | ||
ls -la dist | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,4 @@ setup.py | |
|
||
.vscode | ||
/target | ||
/rust/target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.