Skip to content

Commit

Permalink
Merge pull request #479 from davidhewitt/drop-3.8
Browse files Browse the repository at this point in the history
drop support for Python 3.8
  • Loading branch information
davidhewitt authored Oct 18, 2024
2 parents 01d47e0 + 242b5c5 commit 7528413
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 46 deletions.
134 changes: 90 additions & 44 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand All @@ -29,7 +29,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand All @@ -43,7 +43,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
Expand All @@ -56,32 +56,59 @@ jobs:
- run: nox -s test

build:
name: ${{ matrix.python-version }} ${{ matrix.platform.os }}-${{ matrix.platform.python-architecture }}
name: ${{ matrix.python-version }} ${{ matrix.platform.os }}-${{ matrix.platform.python-architecture }}
runs-on: ${{ matrix.platform.os }}
strategy:
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.8, pypy-3.9, pypy-3.10]
platform: [
{ os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" },
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
]
python-version:
["3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.9, pypy-3.10]
platform:
[
{
os: "macos-latest",
python-architecture: "arm64",
rust-target: "aarch64-apple-darwin",
},
{
os: "ubuntu-latest",
python-architecture: "x64",
rust-target: "x86_64-unknown-linux-gnu",
},
{
os: "windows-latest",
python-architecture: "x64",
rust-target: "x86_64-pc-windows-msvc",
},
]
include:
# Just test one x86 Windows Python for simplicity
- python-version: 3.12
platform: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }
platform:
{
os: "windows-latest",
python-architecture: "x86",
rust-target: "i686-pc-windows-msvc",
}
# Just test one x64 macOS Python for simplicity
- python-version: 3.12
platform: { os: "macos-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }
platform:
{
os: "macos-13",
python-architecture: "x64",
rust-target: "x86_64-apple-darwin",
}
# Just test one x64 macOS Python for simplicity
exclude:
# macOS arm doesn't have Python builds before 3.10
- python-version: 3.9
platform: { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
- python-version: 3.8
platform: { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
platform:
{
os: "macos-latest",
python-architecture: "arm64",
rust-target: "aarch64-apple-darwin",
}

steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -114,7 +141,7 @@ jobs:
if: ${{ startsWith(matrix.platform.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
shell: bash
env:
MACOSX_DEPLOYMENT_TARGET: '10.9'
MACOSX_DEPLOYMENT_TARGET: "10.9"
ARCHFLAGS: -arch x86_64 -arch arm64
run: |
rustup target add aarch64-apple-darwin
Expand Down Expand Up @@ -199,12 +226,13 @@ jobs:
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
matrix:
platform: [
{ arch: "aarch64" },
{ arch: "armv7" },
]
platform: [{ arch: "aarch64" }, { arch: "armv7" }]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- uses: docker/setup-qemu-action@v3
- run: pip install nox
- run: nox -s test-crossenv -- ${{ matrix.platform.arch }}
Expand All @@ -216,7 +244,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10" # must match the ubuntu version in the install, and also the STANDALONE_PYTHON_VERSION below
- uses: dtolnay/rust-toolchain@stable
- name: Install cross
uses: taiki-e/install-action@v2
Expand All @@ -229,12 +257,16 @@ 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/cp310-cp310/lib
DIST_EXTRA_CONFIG: /tmp/build-opts.cfg
run: |
cd examples/namespace_package
docker build -t cross-pyo3:aarch64-unknown-linux-gnu .
python -m pip install build
docker build \
--build-arg STANDALONE_PYTHON_VERSION=3.10.15 \
--build-arg STANDALONE_PYTHON_RELEASE=20241016 \
-t cross-pyo3:aarch64-unknown-linux-gnu \
.
python -m pip install build wheel
echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG
python -m build --no-isolation
ls -la dist/
Expand All @@ -243,17 +275,19 @@ jobs:
name: Install built wheel
with:
arch: aarch64
distro: ubuntu20.04
distro: ubuntu22.04
dockerRunArgs: |
--volume "${PWD}/examples/namespace_package:/io"
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
apt-get install -y --no-install-recommends python3 python3-venv python3-pip
pip3 install -U pip
run: |
pip3 install namespace_package --no-index --find-links /io/dist/ --force-reinstall
python3 -c "from namespace_package import rust; assert rust.rust_func() == 14"
python3 -c "from namespace_package import python; assert python.python_func() == 15"
python3 -m venv .venv
source .venv/bin/activate
pip install namespace_package --no-index --find-links /io/dist/ --force-reinstall
python -c "from namespace_package import rust; assert rust.rust_func() == 14"
python -c "from namespace_package import python; assert python.python_func() == 15"
test-zigbuild:
runs-on: ubuntu-latest
Expand All @@ -262,7 +296,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: 3.8
python-version: "3.10" # must match the ubuntu version in the install, and also the version copied out of the docker image below
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-unknown-linux-gnu
Expand All @@ -276,13 +310,13 @@ jobs:
env:
CARGO: cargo-zigbuild
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu
PYO3_CROSS_LIB_DIR: /opt/python/cp38-cp38/lib
PYO3_CROSS_LIB_DIR: /opt/python/cp310-cp310/lib
DIST_EXTRA_CONFIG: /tmp/build-opts.cfg
run: |
mkdir -p $PYO3_CROSS_LIB_DIR
docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp38-cp38 /opt/python
docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp310-cp310 /opt/python
cd examples/namespace_package
python -m pip install build
python -m pip install build wheel
echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG
python -m build --no-isolation
ls -la dist/
Expand All @@ -291,17 +325,18 @@ jobs:
name: Install built wheel
with:
arch: aarch64
distro: ubuntu20.04
distro: ubuntu22.04
dockerRunArgs: |
--volume "${PWD}/examples/namespace_package:/io"
install: |
apt-get update
apt-get install -y --no-install-recommends python3 python3-pip
pip3 install -U pip
apt-get install -y --no-install-recommends python3 python3-venv python3-pip
run: |
pip3 install namespace_package --no-index --find-links /io/dist/ --force-reinstall
python3 -c "from namespace_package import rust; assert rust.rust_func() == 14"
python3 -c "from namespace_package import python; assert python.python_func() == 15"
python3 -m venv .venv
source .venv/bin/activate
pip install namespace_package --no-index --find-links /io/dist/ --force-reinstall
python -c "from namespace_package import rust; assert rust.rust_func() == 14"
python -c "from namespace_package import python; assert python.python_func() == 15"
test-cibuildwheel:
runs-on: macos-latest
Expand All @@ -325,14 +360,25 @@ jobs:

test-mingw:
runs-on: windows-latest
name: ${{ matrix.python-version }} mingw-${{ matrix.arch }}
name: ${{ matrix.python-version }} mingw-${{ matrix.arch }}
strategy:
fail-fast: false
matrix:
include: [
{ msystem: MINGW64, arch: x86_64, path: mingw64, rust_target: x86_64-pc-windows-gnu },
{ msystem: MINGW32, arch: i686, path: mingw32, rust_target: i686-pc-windows-gnu }
]
include:
[
{
msystem: MINGW64,
arch: x86_64,
path: mingw64,
rust_target: x86_64-pc-windows-gnu,
},
{
msystem: MINGW32,
arch: i686,
path: mingw32,
rust_target: i686-pc-windows-gnu,
},
]
steps:
- uses: actions/checkout@v4
- name: Install MSys2 and dependencies
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased
### Packaging
- Drop support for Python 3.8. [#479](https://github.com/PyO3/setuptools-rust/pull/479)

## 1.10.2 (2024-10-02)
### Fixed
- Fix deprecation warning from use of `wheel.bdist_wheel`.
Expand Down
8 changes: 7 additions & 1 deletion examples/namespace_package/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,13 @@ FROM quay.io/pypa/manylinux2014_aarch64 AS manylinux

FROM ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge

RUN curl -L https://github.com/indygreg/python-build-standalone/releases/download/20220318/cpython-3.8.13+20220318-x86_64-unknown-linux-gnu-install_only.tar.gz | tar -xz -C /usr/local
ARG STANDALONE_PYTHON_RELEASE
ARG STANDALONE_PYTHON_VERSION

RUN test -n "$STANDALONE_PYTHON_RELEASE" || (echo "STANDALONE_PYTHON_RELEASE not set" && false)
RUN test -n "$STANDALONE_PYTHON_VERSION" || (echo "STANDALONE_PYTHON_VERSION not set" && false)

RUN curl -L https://github.com/indygreg/python-build-standalone/releases/download/${STANDALONE_PYTHON_RELEASE}/cpython-${STANDALONE_PYTHON_VERSION}+${STANDALONE_PYTHON_RELEASE}-x86_64-unknown-linux-gnu-install_only.tar.gz | tar -xz -C /usr/local

ENV PATH=/usr/local/python/bin:$PATH

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "setuptools-rust"
version = "1.10.2"
description = "Setuptools Rust extension plugin"
readme = "README.md"
requires-python = ">=3.8"
requires-python = ">=3.9"
keywords = ["distutils", "setuptools", "rust"]
authors = [
{name = "Nikolay Kim", email = "fafhrd91@gmail.com"},
Expand Down

0 comments on commit 7528413

Please sign in to comment.