diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 844b51c1..100371db 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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" @@ -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" @@ -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" @@ -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 @@ -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 @@ -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 }} @@ -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 @@ -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/ @@ -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 @@ -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 @@ -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/ @@ -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 @@ -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 diff --git a/CHANGELOG.md b/CHANGELOG.md index 340d9b67..1de64c2f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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`. diff --git a/examples/namespace_package/Dockerfile b/examples/namespace_package/Dockerfile index b914bbeb..8521494d 100644 --- a/examples/namespace_package/Dockerfile +++ b/examples/namespace_package/Dockerfile @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 7dfb36e6..09c2409c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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"},