Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
18 changes: 11 additions & 7 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pyo3-build-config/src/impl_.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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! {
Expand Down
3 changes: 2 additions & 1 deletion pyo3-ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion pyo3-ffi/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const SUPPORTED_VERSIONS_CPYTHON: SupportedVersions = SupportedVersions {
min: PythonVersion { major: 3, minor: 8 },
max: PythonVersion {
major: 3,
minor: 14,
minor: 15,
},
};

Expand Down
7 changes: 5 additions & 2 deletions pyo3-ffi/src/critical_section.rs
Original file line number Diff line number Diff line change
@@ -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,))]
Expand Down
Loading