Skip to content

Commit

Permalink
Update minimal Python minor version for pyo3 0.23 (#2350)
Browse files Browse the repository at this point in the history
Part of #2349
  • Loading branch information
messense authored Dec 1, 2024
1 parent 0c151a4 commit 52dc85d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ const PYO3_BINDING_CRATES: [&str; 2] = ["pyo3-ffi", "pyo3"];
fn pyo3_minimum_python_minor_version(major_version: u64, minor_version: u64) -> Option<usize> {
if (major_version, minor_version) >= (0, 16) {
Some(7)
} else {
None
}
}

fn pyo3_ffi_minimum_python_minor_version(major_version: u64, minor_version: u64) -> Option<usize> {
if (major_version, minor_version) >= (0, 16) {
pyo3_minimum_python_minor_version(major_version, minor_version)
} else if (major_version, minor_version) >= (0, 23) {
Some(8)
} else {
None
}
Expand Down Expand Up @@ -1025,8 +1019,8 @@ fn find_bindings(
Some(("pyo3".to_string(), minor))
} else if deps.get("pyo3-ffi").is_some() {
let ver = &packages["pyo3-ffi"].version;
let minor = pyo3_ffi_minimum_python_minor_version(ver.major, ver.minor)
.unwrap_or(MINIMUM_PYTHON_MINOR);
let minor =
pyo3_minimum_python_minor_version(ver.major, ver.minor).unwrap_or(MINIMUM_PYTHON_MINOR);
Some(("pyo3-ffi".to_string(), minor))
} else if deps.contains_key("uniffi") {
Some(("uniffi".to_string(), MINIMUM_PYTHON_MINOR))
Expand Down

0 comments on commit 52dc85d

Please sign in to comment.