Skip to content

Commit 478d08e

Browse files
added abi3-py313 feature (#4969)
* add abi3-py313 feature * add check for missing abi3 features --------- Co-authored-by: David Hewitt <mail@davidhewitt.dev>
1 parent f08cc60 commit 478d08e

File tree

6 files changed

+20
-4
lines changed

6 files changed

+20
-4
lines changed

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ abi3-py38 = ["abi3-py39", "pyo3-build-config/abi3-py38", "pyo3-ffi/abi3-py38"]
100100
abi3-py39 = ["abi3-py310", "pyo3-build-config/abi3-py39", "pyo3-ffi/abi3-py39"]
101101
abi3-py310 = ["abi3-py311", "pyo3-build-config/abi3-py310", "pyo3-ffi/abi3-py310"]
102102
abi3-py311 = ["abi3-py312", "pyo3-build-config/abi3-py311", "pyo3-ffi/abi3-py311"]
103-
abi3-py312 = ["abi3", "pyo3-build-config/abi3-py312", "pyo3-ffi/abi3-py312"]
103+
abi3-py312 = ["abi3-py313", "pyo3-build-config/abi3-py312", "pyo3-ffi/abi3-py312"]
104+
abi3-py313 = ["abi3", "pyo3-build-config/abi3-py313", "pyo3-ffi/abi3-py313"]
104105

105106
# Automatically generates `python3.dll` import libraries for Windows targets.
106107
generate-import-lib = ["pyo3-ffi/generate-import-lib"]

newsfragments/4969.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `abi3-py313` feature

noxfile.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -724,6 +724,8 @@ def check_feature_powerset(session: nox.Session):
724724

725725
cargo_toml = toml.loads((PYO3_DIR / "Cargo.toml").read_text())
726726

727+
EXPECTED_ABI3_FEATURES = {f"abi3-py3{ver.split('.')[1]}" for ver in PY_VERSIONS}
728+
727729
EXCLUDED_FROM_FULL = {
728730
"nightly",
729731
"extension-module",
@@ -740,6 +742,16 @@ def check_feature_powerset(session: nox.Session):
740742
abi3_features = {feature for feature in features if feature.startswith("abi3")}
741743
abi3_version_features = abi3_features - {"abi3"}
742744

745+
unexpected_abi3_features = abi3_version_features - EXPECTED_ABI3_FEATURES
746+
if unexpected_abi3_features:
747+
session.error(
748+
f"unexpected `abi3` features found in Cargo.toml: {unexpected_abi3_features}"
749+
)
750+
751+
missing_abi3_features = EXPECTED_ABI3_FEATURES - abi3_version_features
752+
if missing_abi3_features:
753+
session.error(f"missing `abi3` features in Cargo.toml: {missing_abi3_features}")
754+
743755
expected_full_feature = features.keys() - EXCLUDED_FROM_FULL - abi3_features
744756

745757
uncovered_features = expected_full_feature - full_feature

pyo3-build-config/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ abi3-py38 = ["abi3-py39"]
3737
abi3-py39 = ["abi3-py310"]
3838
abi3-py310 = ["abi3-py311"]
3939
abi3-py311 = ["abi3-py312"]
40-
abi3-py312 = ["abi3"]
40+
abi3-py312 = ["abi3-py313"]
41+
abi3-py313 = ["abi3"]
4142

4243
[package.metadata.docs.rs]
4344
features = ["resolve-config"]

pyo3-build-config/src/impl_.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ const MINIMUM_SUPPORTED_VERSION_GRAALPY: PythonVersion = PythonVersion {
4040
};
4141

4242
/// Maximum Python version that can be used as minimum required Python version with abi3.
43-
pub(crate) const ABI3_MAX_MINOR: u8 = 12;
43+
pub(crate) const ABI3_MAX_MINOR: u8 = 13;
4444

4545
#[cfg(test)]
4646
thread_local! {

pyo3-ffi/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ abi3-py38 = ["abi3-py39", "pyo3-build-config/abi3-py38"]
3333
abi3-py39 = ["abi3-py310", "pyo3-build-config/abi3-py39"]
3434
abi3-py310 = ["abi3-py311", "pyo3-build-config/abi3-py310"]
3535
abi3-py311 = ["abi3-py312", "pyo3-build-config/abi3-py311"]
36-
abi3-py312 = ["abi3", "pyo3-build-config/abi3-py312"]
36+
abi3-py312 = ["abi3-py313", "pyo3-build-config/abi3-py312"]
37+
abi3-py313 = ["abi3", "pyo3-build-config/abi3-py313"]
3738

3839
# Automatically generates `python3.dll` import libraries for Windows targets.
3940
generate-import-lib = ["pyo3-build-config/python3-dll-a"]

0 commit comments

Comments
 (0)