diff --git a/Cargo.toml b/Cargo.toml index bb707bf06f5..4cc7f4245d0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -122,7 +122,8 @@ abi3-py310 = ["abi3-py311", "pyo3-ffi/abi3-py310"] abi3-py311 = ["abi3-py312", "pyo3-ffi/abi3-py311"] abi3-py312 = ["abi3-py313", "pyo3-ffi/abi3-py312"] abi3-py313 = ["abi3-py314", "pyo3-ffi/abi3-py313"] -abi3-py314 = ["abi3", "pyo3-ffi/abi3-py314"] +abi3-py314 = ["abi3-py315", "pyo3-ffi/abi3-py314"] +abi3-py315 = ["abi3", "pyo3-ffi/abi3-py315"] # deprecated: no longer needed, raw-dylib is used instead generate-import-lib = ["pyo3-ffi/generate-import-lib"] diff --git a/noxfile.py b/noxfile.py index 1e1a7920c29..e2e83d0d9af 100644 --- a/noxfile.py +++ b/noxfile.py @@ -85,10 +85,7 @@ def _supported_interpreter_versions( PY_VERSIONS = _supported_interpreter_versions("cpython") -# We don't yet support abi3-py315 but do support cp315 and cp315t -# version-specific builds ABI3_PY_VERSIONS = [p for p in PY_VERSIONS if not p.endswith("t")] -ABI3_PY_VERSIONS.remove("3.15") PYPY_VERSIONS = _supported_interpreter_versions("pypy") @@ -1201,19 +1198,26 @@ def test_version_limits(session: nox.Session): config_file.set("CPython", "3.6") _run_cargo(session, "check", env=env, expect_error=True) + # We allow building with our max version + 1, to support + # development work assert "3.16" not in PY_VERSIONS config_file.set("CPython", "3.16") + _run_cargo(session, "check", env=env) + + # We do not allow allow building with max version + 2 + assert "3.17" not in PY_VERSIONS + config_file.set("CPython", "3.17") _run_cargo(session, "check", env=env, expect_error=True) - # 3.16 CPython should build if abi3 is explicitly requested + # max version + 2 should build if abi3 is explicitly requested _run_cargo(session, "check", "--features=pyo3/abi3", env=env) - # 3.15 CPython should build with forward compatibility - # TODO: check on 3.16 when adding abi3-py315 support - config_file.set("CPython", "3.15") + # ... and also should build with forward compatibility + config_file.set("CPython", "3.16") env["PYO3_USE_ABI3_FORWARD_COMPATIBILITY"] = "1" _run_cargo(session, "check", env=env) + # we only support 3.11 PyPy assert "3.10" not in PYPY_VERSIONS config_file.set("PyPy", "3.10") _run_cargo(session, "check", env=env, expect_error=True) diff --git a/pyo3-build-config/src/impl_.rs b/pyo3-build-config/src/impl_.rs index ea6653d145c..067cff94e29 100644 --- a/pyo3-build-config/src/impl_.rs +++ b/pyo3-build-config/src/impl_.rs @@ -41,7 +41,7 @@ const MINIMUM_SUPPORTED_VERSION_GRAALPY: PythonVersion = PythonVersion { }; /// Maximum Python version that can be used as minimum required Python version with abi3. -pub(crate) const ABI3_MAX_MINOR: u8 = 14; +pub(crate) const ABI3_MAX_MINOR: u8 = 15; #[cfg(test)] thread_local! { diff --git a/pyo3-ffi/Cargo.toml b/pyo3-ffi/Cargo.toml index 2144fbfa61c..6d6b0949d46 100644 --- a/pyo3-ffi/Cargo.toml +++ b/pyo3-ffi/Cargo.toml @@ -32,7 +32,8 @@ abi3-py310 = ["abi3-py311"] abi3-py311 = ["abi3-py312"] abi3-py312 = ["abi3-py313"] abi3-py313 = ["abi3-py314"] -abi3-py314 = ["abi3"] +abi3-py314 = ["abi3-py315"] +abi3-py315 = ["abi3"] # deprecated: no longer needed, raw-dylib is used instead generate-import-lib = ["pyo3-build-config/generate-import-lib"] diff --git a/pyo3-ffi/build.rs b/pyo3-ffi/build.rs index e59b7ba5eeb..8802736e835 100644 --- a/pyo3-ffi/build.rs +++ b/pyo3-ffi/build.rs @@ -18,7 +18,7 @@ const SUPPORTED_VERSIONS_CPYTHON: SupportedVersions = SupportedVersions { min: PythonVersion { major: 3, minor: 8 }, max: PythonVersion { major: 3, - minor: 14, + minor: 15, }, }; diff --git a/pyo3-ffi/src/critical_section.rs b/pyo3-ffi/src/critical_section.rs index 9249df7aad4..ca585287d43 100644 --- a/pyo3-ffi/src/critical_section.rs +++ b/pyo3-ffi/src/critical_section.rs @@ -1,9 +1,12 @@ -#[cfg(any(all(Py_GIL_DISABLED, Py_3_13, not(Py_LIMITED_API)), Py_3_15,))] +#[cfg(any( + all(Py_GIL_DISABLED, Py_3_13, not(Py_LIMITED_API)), + all(Py_3_15, not(Py_LIMITED_API)) +))] use crate::PyMutex; #[cfg(any(all(Py_GIL_DISABLED, Py_3_13), Py_3_15))] use crate::PyObject; -#[cfg(all(Py_LIMITED_API, Py_3_13, not(Py_3_15)))] +#[cfg(all(Py_LIMITED_API, Py_3_13))] opaque_struct!(pub PyMutex); #[cfg(any(all(Py_GIL_DISABLED, Py_3_13, not(Py_LIMITED_API)), Py_3_15,))]