Skip to content

Commit c01d17f

Browse files
authored
drop support for PyPy 3.9 and 3.10 (#5516)
* drop support for PyPy 3.9 and 3.10 * test fixup * fixup another build config test
1 parent 99aa9bd commit c01d17f

File tree

18 files changed

+54
-43
lines changed

18 files changed

+54
-43
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ jobs:
122122
- '.github/workflows/build.yml'
123123
124124
- name: Run pyo3-ffi-check
125-
# pypy 3.9 on windows is not PEP 3123 compliant, nor is graalpy
126-
if: ${{ endsWith(inputs.python-version, '-dev') || (steps.ffi-changes.outputs.changed == 'true' && inputs.rust == 'stable' && !startsWith(inputs.python-version, 'graalpy') && !(inputs.python-version == 'pypy3.9' && contains(inputs.os, 'windows'))) }}
125+
# TODO: investigate graalpy failures
126+
if: ${{ endsWith(inputs.python-version, '-dev') || (steps.ffi-changes.outputs.changed == 'true' && inputs.rust == 'stable' && !startsWith(inputs.python-version, 'graalpy')) }}
127127
run: nox -s ffi-check
128128

129129
- name: Install cargo-llvm-cov

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ jobs:
232232
"3.13t",
233233
"3.14",
234234
"3.14t",
235-
"pypy3.9",
236-
"pypy3.10",
237235
"pypy3.11",
238236
"graalpy24.2",
239237
]

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Requires Rust 1.74 or greater.
2020

2121
PyO3 supports the following Python distributions:
2222
- CPython 3.7 or greater
23-
- PyPy 7.3 (Python 3.9+)
23+
- PyPy 7.3 (Python 3.11+)
2424
- GraalPy 24.2 or greater (Python 3.11+)
2525

2626
You can use PyO3 to write a native Python module in Rust, or to embed Python in a Rust binary. The following sections explain each of these in turn.

newsfragments/5516.packaging.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop support for PyPy 3.9 and 3.10.

noxfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -953,8 +953,8 @@ def test_version_limits(session: nox.Session):
953953
env["PYO3_USE_ABI3_FORWARD_COMPATIBILITY"] = "1"
954954
_run_cargo(session, "check", env=env)
955955

956-
assert "3.8" not in PYPY_VERSIONS
957-
config_file.set("PyPy", "3.8")
956+
assert "3.10" not in PYPY_VERSIONS
957+
config_file.set("PyPy", "3.10")
958958
_run_cargo(session, "check", env=env, expect_error=True)
959959

960960
# attempt to build with latest version and check that abi3 version

pyo3-build-config/src/impl_.rs

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2462,7 +2462,7 @@ mod tests {
24622462
pyo3_cross: None,
24632463
pyo3_cross_lib_dir: None,
24642464
pyo3_cross_python_implementation: Some("PyPy".into()),
2465-
pyo3_cross_python_version: Some("3.10".into()),
2465+
pyo3_cross_python_version: Some("3.11".into()),
24662466
};
24672467

24682468
let triple = triple!("x86_64-unknown-linux-gnu");
@@ -2477,11 +2477,11 @@ mod tests {
24772477
implementation: PythonImplementation::PyPy,
24782478
version: PythonVersion {
24792479
major: 3,
2480-
minor: 10
2480+
minor: 11
24812481
},
24822482
shared: true,
24832483
abi3: false,
2484-
lib_name: Some("pypy3.10-c".into()),
2484+
lib_name: Some("pypy3.11-c".into()),
24852485
lib_dir: None,
24862486
executable: None,
24872487
pointer_width: None,
@@ -2726,22 +2726,30 @@ mod tests {
27262726
"python3.7md",
27272727
);
27282728

2729-
// PyPy 3.9 includes ldversion
2729+
// PyPy 3.11 includes ldversion
27302730
assert_eq!(
2731-
super::default_lib_name_unix(PythonVersion { major: 3, minor: 9 }, PyPy, None, false)
2732-
.unwrap(),
2733-
"pypy3.9-c",
2731+
super::default_lib_name_unix(
2732+
PythonVersion {
2733+
major: 3,
2734+
minor: 11
2735+
},
2736+
PyPy,
2737+
None,
2738+
false
2739+
)
2740+
.unwrap(),
2741+
"pypy3.11-c",
27342742
);
27352743

27362744
assert_eq!(
27372745
super::default_lib_name_unix(
27382746
PythonVersion { major: 3, minor: 9 },
27392747
PyPy,
2740-
Some("3.9d"),
2748+
Some("3.11d"),
27412749
false
27422750
)
27432751
.unwrap(),
2744-
"pypy3.9d-c",
2752+
"pypy3.11d-c",
27452753
);
27462754

27472755
// free-threading adds a t suffix
@@ -3046,7 +3054,10 @@ mod tests {
30463054
fn test_build_script_outputs_base() {
30473055
let interpreter_config = InterpreterConfig {
30483056
implementation: PythonImplementation::CPython,
3049-
version: PythonVersion { major: 3, minor: 9 },
3057+
version: PythonVersion {
3058+
major: 3,
3059+
minor: 11,
3060+
},
30503061
shared: true,
30513062
abi3: false,
30523063
lib_name: Some("python3".into()),
@@ -3064,6 +3075,8 @@ mod tests {
30643075
"cargo:rustc-cfg=Py_3_7".to_owned(),
30653076
"cargo:rustc-cfg=Py_3_8".to_owned(),
30663077
"cargo:rustc-cfg=Py_3_9".to_owned(),
3078+
"cargo:rustc-cfg=Py_3_10".to_owned(),
3079+
"cargo:rustc-cfg=Py_3_11".to_owned(),
30673080
]
30683081
);
30693082

@@ -3077,6 +3090,8 @@ mod tests {
30773090
"cargo:rustc-cfg=Py_3_7".to_owned(),
30783091
"cargo:rustc-cfg=Py_3_8".to_owned(),
30793092
"cargo:rustc-cfg=Py_3_9".to_owned(),
3093+
"cargo:rustc-cfg=Py_3_10".to_owned(),
3094+
"cargo:rustc-cfg=Py_3_11".to_owned(),
30803095
"cargo:rustc-cfg=PyPy".to_owned(),
30813096
]
30823097
);
@@ -3253,9 +3268,13 @@ mod tests {
32533268

32543269
// PyPy
32553270
config.implementation = PythonImplementation::PyPy;
3271+
config.version = PythonVersion {
3272+
major: 3,
3273+
minor: 11,
3274+
};
32563275
config.lib_name = None;
32573276
config.apply_default_lib_name_to_config_file(&unix);
3258-
assert_eq!(config.lib_name, Some("pypy3.9-c".into()));
3277+
assert_eq!(config.lib_name, Some("pypy3.11-c".into()));
32593278

32603279
config.implementation = PythonImplementation::CPython;
32613280

pyo3-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,5 @@ min-version = "3.7"
5454
max-version = "3.14" # inclusive
5555

5656
[package.metadata.pypy]
57-
min-version = "3.9"
57+
min-version = "3.11"
5858
max-version = "3.11" # inclusive

pyo3-ffi/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ const SUPPORTED_VERSIONS_CPYTHON: SupportedVersions = SupportedVersions {
2222
};
2323

2424
const SUPPORTED_VERSIONS_PYPY: SupportedVersions = SupportedVersions {
25-
min: PythonVersion { major: 3, minor: 9 },
25+
min: PythonVersion {
26+
major: 3,
27+
minor: 11,
28+
},
2629
max: SUPPORTED_VERSIONS_CPYTHON.max,
2730
};
2831

pyo3-ffi/src/cpython/object.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,10 +268,8 @@ pub struct PyTypeObject {
268268
pub tp_vectorcall: Option<vectorcallfunc>,
269269
#[cfg(Py_3_12)]
270270
pub tp_watched: c_char,
271-
#[cfg(any(all(PyPy, Py_3_8, not(Py_3_10)), all(not(PyPy), Py_3_8, not(Py_3_9))))]
271+
#[cfg(all(not(PyPy), Py_3_8, not(Py_3_9)))]
272272
pub tp_print: Option<printfunc>,
273-
#[cfg(all(PyPy, not(Py_3_10)))]
274-
pub tp_pypy_flags: std::ffi::c_long,
275273
#[cfg(py_sys_config = "COUNT_ALLOCS")]
276274
pub tp_allocs: Py_ssize_t,
277275
#[cfg(py_sys_config = "COUNT_ALLOCS")]

pyo3-ffi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
//!
8282
//! `pyo3-ffi` supports the following Python distributions:
8383
//! - CPython 3.7 or greater
84-
//! - PyPy 7.3 (Python 3.9+)
84+
//! - PyPy 7.3 (Python 3.11+)
8585
//! - GraalPy 24.0 or greater (Python 3.10+)
8686
//!
8787
//! # Example: Building Python Native modules

0 commit comments

Comments
 (0)