Skip to content

Commit

Permalink
Update pyo3 abi3 preview
Browse files Browse the repository at this point in the history
  • Loading branch information
konstin committed Oct 4, 2020
1 parent 1271922 commit 845637f
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 41 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
authors = ["konstin <[email protected]>"]
name = "maturin"
version = "0.8.3"
version = "0.9.0-alpha.1"
description = "Build and publish crates with pyo3, rust-cpython and cffi bindings as well as rust binaries as python packages"
exclude = ["test-crates/**/*", "sysconfig/*", "test-data/*", "ci/*", "tests/*"]
readme = "Readme.md"
Expand Down
2 changes: 1 addition & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html) (for the cli, not for the crate).

## Unreleased
## 0.9.0 - Unreleased

### Added

Expand Down
12 changes: 6 additions & 6 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -205,10 +205,8 @@ fn has_abi3(cargo_metadata: &Metadata) -> Result<bool> {
.and_then(|resolve| resolve.root.as_ref())
.context("Expected cargo to return a root package")?;
// Check that we have a pyo3 version with abi3 and that abi3 is selected
Ok(pyo3_crate.features.contains_key("unstable-api")
&& !cargo_metadata[&root_id]
.features
.contains_key("unstable-api"))
Ok(pyo3_crate.features.contains_key("abi3")
&& !cargo_metadata[&root_id].features.contains_key("abi3"))
}
_ => bail!(format!(
"Expected exactly one pyo3 dependency, found {}",
Expand Down Expand Up @@ -246,7 +244,6 @@ pub fn find_bridge(cargo_metadata: &Metadata, bridge: Option<&str>) -> Result<Br
BridgeModel::Bindings(bindings.to_string())
}
} else if deps.get("pyo3").is_some() {
println!("🔗 Found pyo3 bindings");
BridgeModel::Bindings("pyo3".to_string())
} else if deps.contains_key("cpython") {
println!("🔗 Found rust-cpython bindings");
Expand Down Expand Up @@ -283,8 +280,11 @@ pub fn find_bridge(cargo_metadata: &Metadata, bridge: Option<&str>) -> Result<Br
}

if has_abi3(&cargo_metadata)? {
println!("🔗 Building an abi3 wheel, which is compatible if all cpython versions. TODO: Minimum python version");
println!("🔗 Found pyo3 bindings with abi3 support");
return Ok(BridgeModel::BindingsAbi3);
} else {
println!("🔗 Found pyo3 bindings");
return Ok(bridge);
}
}

Expand Down
65 changes: 34 additions & 31 deletions test-crates/pyo3-pure/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test-crates/pyo3-pure/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ get_42 = "pyo3_pure:DummyClass.get_42"

[dependencies]
# This is temporary until https://github.com/PyO3/pyo3/pull/1152 is merged
pyo3 = { git = "https://github.com/PyO3/pyo3", branch = "abi3", deafult-features = false, features = ["extension-module", "macros"] }
pyo3 = { git = "https://github.com/PyO3/pyo3", branch = "abi3", features = ["extension-module", "abi3"] }

[lib]
name = "pyo3_pure"
Expand Down

0 comments on commit 845637f

Please sign in to comment.