Skip to content

Commit

Permalink
examples: update to PyO3 0.16.1
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Mar 6, 2022
1 parent 472aabd commit a710915
Show file tree
Hide file tree
Showing 12 changed files with 216 additions and 284 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
strategy:
fail-fast: false # If one platform fails, allow the rest to keep testing.
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, "3.10", pypy-3.6, pypy-3.7]
python-version: ["3.6", "3.7", "3.8", "3.9", "3.10", pypy-3.6, pypy-3.7]
platform: [
{ os: "macos-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin" },
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
Expand Down Expand Up @@ -96,10 +96,6 @@ jobs:
- name: Install test dependencies
run: pip install --upgrade tox nox setuptools

- name: Install wheel (workaround python 3.10 CI issue)
if: matrix.python-version == '3.10-dev'
run: pip install --upgrade wheel

- name: Build package
run: pip install -e .

Expand All @@ -110,7 +106,7 @@ jobs:
run: nox -s test-examples

- name: Test macOS universal2
if: matrix.platform.os == 'macos-latest' && !startsWith(matrix.python-version, 'pypy')
if: matrix.platform.os == 'macos-latest' && !startsWith(matrix.python-version, 'pypy') && matrix.python-version != '3.6'
shell: bash
env:
DEVELOPER_DIR: /Applications/Xcode.app/Contents/Developer
Expand All @@ -128,6 +124,7 @@ jobs:
python -c "from namespace_package import python; assert python.python_func() == 15"
- name: Test sdist vendor Rust crates
if: matrix.python-version != '3.6' && matrix.python-version != 'pypy-3.6'
shell: bash
run: |
cd examples/namespace_package
Expand Down Expand Up @@ -207,14 +204,14 @@ jobs:
source ~/.cargo/env
rustup target add ${{ matrix.platform.target }}
cd examples/rust_with_cffi/
python3.6 -m pip install crossenv
python3.6 -m crossenv "/opt/python/cp36-cp36m/bin/python3" --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= --manylinux manylinux1 venv
python3.9 -m pip install crossenv
python3.9 -m crossenv "/opt/python/cp39-cp39/bin/python3" --cc $TARGET_CC --cxx $TARGET_CXX --sysroot $TARGET_SYSROOT --env LIBRARY_PATH= --manylinux manylinux1 venv
. venv/bin/activate
build-pip install cffi wheel
cross-expose cffi
pip install wheel
pip install -e ../../
python setup.py bdist_wheel --py-limited-api=cp36
python setup.py bdist_wheel --py-limited-api=cp37
ls -la dist/
' > build-wheels.sh
Expand Down Expand Up @@ -258,14 +255,14 @@ jobs:
env:
CARGO: cross
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu
PYO3_CROSS_LIB_DIR: /opt/python/cp38-cp38/lib
PYO3_CROSS_LIB_DIR: /opt/python/cp39-cp39/lib
run: |
cd examples/namespace_package
docker build -t cross-pyo3:aarch64-unknown-linux-gnu .
python -m pip install wheel
python setup.py bdist_wheel --plat-name manylinux2014_aarch64
ls -la dist/
- uses: uraimo/run-on-arch-action@v2.0.5
- uses: uraimo/run-on-arch-action@v2.1.1
name: Install built wheel
with:
arch: aarch64
Expand Down
1 change: 0 additions & 1 deletion docs/building_wheels.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ This will create wheels in the `dist` directory:

```bash
$ ls dist
hello_rust-0.1.0-cp36-cp36m-linux_x86_64.whl hello_rust-0.1.0-cp36-cp36m-manylinux2014_x86_64.whl
hello_rust-0.1.0-cp37-cp37m-linux_x86_64.whl hello_rust-0.1.0-cp37-cp37m-manylinux2014_x86_64.whl
hello_rust-0.1.0-cp38-cp38-linux_x86_64.whl hello_rust-0.1.0-cp38-cp38-manylinux2014_x86_64.whl
hello_rust-0.1.0-cp39-cp39-linux_x86_64.whl hello_rust-0.1.0-cp39-cp39-manylinux2014_x86_64.whl
Expand Down
Loading

0 comments on commit a710915

Please sign in to comment.