Skip to content

Commit 7528413

Browse files
authored
Merge pull request #479 from davidhewitt/drop-3.8
drop support for Python 3.8
2 parents 01d47e0 + 242b5c5 commit 7528413

File tree

4 files changed

+102
-46
lines changed

4 files changed

+102
-46
lines changed

.github/workflows/ci.yml

Lines changed: 90 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v4
1717

18-
- name: Set up Python ${{ matrix.python-version }}
18+
- name: Set up Python
1919
uses: actions/setup-python@v5
2020
with:
2121
python-version: "3.x"
@@ -29,7 +29,7 @@ jobs:
2929
steps:
3030
- uses: actions/checkout@v4
3131

32-
- name: Set up Python ${{ matrix.python-version }}
32+
- name: Set up Python
3333
uses: actions/setup-python@v5
3434
with:
3535
python-version: "3.x"
@@ -43,7 +43,7 @@ jobs:
4343
steps:
4444
- uses: actions/checkout@v4
4545

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

5858
build:
59-
name: ${{ matrix.python-version }} ${{ matrix.platform.os }}-${{ matrix.platform.python-architecture }}
59+
name: ${{ matrix.python-version }} ${{ matrix.platform.os }}-${{ matrix.platform.python-architecture }}
6060
runs-on: ${{ matrix.platform.os }}
6161
strategy:
6262
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
6363
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
6464
matrix:
65-
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.8, pypy-3.9, pypy-3.10]
66-
platform: [
67-
{ os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" },
68-
{ os: "ubuntu-latest", python-architecture: "x64", rust-target: "x86_64-unknown-linux-gnu" },
69-
{ os: "windows-latest", python-architecture: "x64", rust-target: "x86_64-pc-windows-msvc" },
70-
]
65+
python-version:
66+
["3.9", "3.10", "3.11", "3.12", "3.13", pypy-3.9, pypy-3.10]
67+
platform:
68+
[
69+
{
70+
os: "macos-latest",
71+
python-architecture: "arm64",
72+
rust-target: "aarch64-apple-darwin",
73+
},
74+
{
75+
os: "ubuntu-latest",
76+
python-architecture: "x64",
77+
rust-target: "x86_64-unknown-linux-gnu",
78+
},
79+
{
80+
os: "windows-latest",
81+
python-architecture: "x64",
82+
rust-target: "x86_64-pc-windows-msvc",
83+
},
84+
]
7185
include:
7286
# Just test one x86 Windows Python for simplicity
7387
- python-version: 3.12
74-
platform: { os: "windows-latest", python-architecture: "x86", rust-target: "i686-pc-windows-msvc" }
88+
platform:
89+
{
90+
os: "windows-latest",
91+
python-architecture: "x86",
92+
rust-target: "i686-pc-windows-msvc",
93+
}
7594
# Just test one x64 macOS Python for simplicity
7695
- python-version: 3.12
77-
platform: { os: "macos-13", python-architecture: "x64", rust-target: "x86_64-apple-darwin" }
96+
platform:
97+
{
98+
os: "macos-13",
99+
python-architecture: "x64",
100+
rust-target: "x86_64-apple-darwin",
101+
}
78102
# Just test one x64 macOS Python for simplicity
79103
exclude:
80104
# macOS arm doesn't have Python builds before 3.10
81105
- python-version: 3.9
82-
platform: { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
83-
- python-version: 3.8
84-
platform: { os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin" }
106+
platform:
107+
{
108+
os: "macos-latest",
109+
python-architecture: "arm64",
110+
rust-target: "aarch64-apple-darwin",
111+
}
85112

86113
steps:
87114
- uses: actions/checkout@v4
@@ -114,7 +141,7 @@ jobs:
114141
if: ${{ startsWith(matrix.platform.os, 'macos') && !startsWith(matrix.python-version, 'pypy') }}
115142
shell: bash
116143
env:
117-
MACOSX_DEPLOYMENT_TARGET: '10.9'
144+
MACOSX_DEPLOYMENT_TARGET: "10.9"
118145
ARCHFLAGS: -arch x86_64 -arch arm64
119146
run: |
120147
rustup target add aarch64-apple-darwin
@@ -199,12 +226,13 @@ jobs:
199226
# If one platform fails, allow the rest to keep testing if `CI-no-fail-fast` label is present
200227
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'CI-no-fail-fast') }}
201228
matrix:
202-
platform: [
203-
{ arch: "aarch64" },
204-
{ arch: "armv7" },
205-
]
229+
platform: [{ arch: "aarch64" }, { arch: "armv7" }]
206230
steps:
207231
- uses: actions/checkout@v4
232+
- name: Set up Python
233+
uses: actions/setup-python@v5
234+
with:
235+
python-version: "3.x"
208236
- uses: docker/setup-qemu-action@v3
209237
- run: pip install nox
210238
- run: nox -s test-crossenv -- ${{ matrix.platform.arch }}
@@ -216,7 +244,7 @@ jobs:
216244
- name: Setup python
217245
uses: actions/setup-python@v5
218246
with:
219-
python-version: 3.8
247+
python-version: "3.10" # must match the ubuntu version in the install, and also the STANDALONE_PYTHON_VERSION below
220248
- uses: dtolnay/rust-toolchain@stable
221249
- name: Install cross
222250
uses: taiki-e/install-action@v2
@@ -229,12 +257,16 @@ jobs:
229257
env:
230258
CARGO: cross
231259
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu
232-
PYO3_CROSS_LIB_DIR: /opt/python/cp38-cp38/lib
260+
PYO3_CROSS_LIB_DIR: /opt/python/cp310-cp310/lib
233261
DIST_EXTRA_CONFIG: /tmp/build-opts.cfg
234262
run: |
235263
cd examples/namespace_package
236-
docker build -t cross-pyo3:aarch64-unknown-linux-gnu .
237-
python -m pip install build
264+
docker build \
265+
--build-arg STANDALONE_PYTHON_VERSION=3.10.15 \
266+
--build-arg STANDALONE_PYTHON_RELEASE=20241016 \
267+
-t cross-pyo3:aarch64-unknown-linux-gnu \
268+
.
269+
python -m pip install build wheel
238270
echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG
239271
python -m build --no-isolation
240272
ls -la dist/
@@ -243,17 +275,19 @@ jobs:
243275
name: Install built wheel
244276
with:
245277
arch: aarch64
246-
distro: ubuntu20.04
278+
distro: ubuntu22.04
247279
dockerRunArgs: |
248280
--volume "${PWD}/examples/namespace_package:/io"
249281
install: |
250282
apt-get update
251-
apt-get install -y --no-install-recommends python3 python3-pip
283+
apt-get install -y --no-install-recommends python3 python3-venv python3-pip
252284
pip3 install -U pip
253285
run: |
254-
pip3 install namespace_package --no-index --find-links /io/dist/ --force-reinstall
255-
python3 -c "from namespace_package import rust; assert rust.rust_func() == 14"
256-
python3 -c "from namespace_package import python; assert python.python_func() == 15"
286+
python3 -m venv .venv
287+
source .venv/bin/activate
288+
pip install namespace_package --no-index --find-links /io/dist/ --force-reinstall
289+
python -c "from namespace_package import rust; assert rust.rust_func() == 14"
290+
python -c "from namespace_package import python; assert python.python_func() == 15"
257291
258292
test-zigbuild:
259293
runs-on: ubuntu-latest
@@ -262,7 +296,7 @@ jobs:
262296
- name: Setup python
263297
uses: actions/setup-python@v5
264298
with:
265-
python-version: 3.8
299+
python-version: "3.10" # must match the ubuntu version in the install, and also the version copied out of the docker image below
266300
- uses: dtolnay/rust-toolchain@stable
267301
with:
268302
targets: aarch64-unknown-linux-gnu
@@ -276,13 +310,13 @@ jobs:
276310
env:
277311
CARGO: cargo-zigbuild
278312
CARGO_BUILD_TARGET: aarch64-unknown-linux-gnu
279-
PYO3_CROSS_LIB_DIR: /opt/python/cp38-cp38/lib
313+
PYO3_CROSS_LIB_DIR: /opt/python/cp310-cp310/lib
280314
DIST_EXTRA_CONFIG: /tmp/build-opts.cfg
281315
run: |
282316
mkdir -p $PYO3_CROSS_LIB_DIR
283-
docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp38-cp38 /opt/python
317+
docker cp -L $(docker create --rm quay.io/pypa/manylinux2014_aarch64:latest):/opt/python/cp310-cp310 /opt/python
284318
cd examples/namespace_package
285-
python -m pip install build
319+
python -m pip install build wheel
286320
echo -e "[bdist_wheel]\nplat_name=manylinux2014_aarch64" > $DIST_EXTRA_CONFIG
287321
python -m build --no-isolation
288322
ls -la dist/
@@ -291,17 +325,18 @@ jobs:
291325
name: Install built wheel
292326
with:
293327
arch: aarch64
294-
distro: ubuntu20.04
328+
distro: ubuntu22.04
295329
dockerRunArgs: |
296330
--volume "${PWD}/examples/namespace_package:/io"
297331
install: |
298332
apt-get update
299-
apt-get install -y --no-install-recommends python3 python3-pip
300-
pip3 install -U pip
333+
apt-get install -y --no-install-recommends python3 python3-venv python3-pip
301334
run: |
302-
pip3 install namespace_package --no-index --find-links /io/dist/ --force-reinstall
303-
python3 -c "from namespace_package import rust; assert rust.rust_func() == 14"
304-
python3 -c "from namespace_package import python; assert python.python_func() == 15"
335+
python3 -m venv .venv
336+
source .venv/bin/activate
337+
pip install namespace_package --no-index --find-links /io/dist/ --force-reinstall
338+
python -c "from namespace_package import rust; assert rust.rust_func() == 14"
339+
python -c "from namespace_package import python; assert python.python_func() == 15"
305340
306341
test-cibuildwheel:
307342
runs-on: macos-latest
@@ -325,14 +360,25 @@ jobs:
325360

326361
test-mingw:
327362
runs-on: windows-latest
328-
name: ${{ matrix.python-version }} mingw-${{ matrix.arch }}
363+
name: ${{ matrix.python-version }} mingw-${{ matrix.arch }}
329364
strategy:
330365
fail-fast: false
331366
matrix:
332-
include: [
333-
{ msystem: MINGW64, arch: x86_64, path: mingw64, rust_target: x86_64-pc-windows-gnu },
334-
{ msystem: MINGW32, arch: i686, path: mingw32, rust_target: i686-pc-windows-gnu }
335-
]
367+
include:
368+
[
369+
{
370+
msystem: MINGW64,
371+
arch: x86_64,
372+
path: mingw64,
373+
rust_target: x86_64-pc-windows-gnu,
374+
},
375+
{
376+
msystem: MINGW32,
377+
arch: i686,
378+
path: mingw32,
379+
rust_target: i686-pc-windows-gnu,
380+
},
381+
]
336382
steps:
337383
- uses: actions/checkout@v4
338384
- name: Install MSys2 and dependencies

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## Unreleased
4+
### Packaging
5+
- Drop support for Python 3.8. [#479](https://github.com/PyO3/setuptools-rust/pull/479)
6+
37
## 1.10.2 (2024-10-02)
48
### Fixed
59
- Fix deprecation warning from use of `wheel.bdist_wheel`.

examples/namespace_package/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,13 @@ FROM quay.io/pypa/manylinux2014_aarch64 AS manylinux
22

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

5-
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
5+
ARG STANDALONE_PYTHON_RELEASE
6+
ARG STANDALONE_PYTHON_VERSION
7+
8+
RUN test -n "$STANDALONE_PYTHON_RELEASE" || (echo "STANDALONE_PYTHON_RELEASE not set" && false)
9+
RUN test -n "$STANDALONE_PYTHON_VERSION" || (echo "STANDALONE_PYTHON_VERSION not set" && false)
10+
11+
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
612

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

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "setuptools-rust"
33
version = "1.10.2"
44
description = "Setuptools Rust extension plugin"
55
readme = "README.md"
6-
requires-python = ">=3.8"
6+
requires-python = ">=3.9"
77
keywords = ["distutils", "setuptools", "rust"]
88
authors = [
99
{name = "Nikolay Kim", email = "[email protected]"},

0 commit comments

Comments
 (0)