diff --git a/CHANGELOG.md b/CHANGELOG.md index 37c775d2790..b0d6e98b514 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 0.3.2 + +* Replaced `concat_idents` with mashup + ## 0.3.1 * Fixed scoping bug in pyobject_native_type that would break rust-numpy diff --git a/Cargo.toml b/Cargo.toml index 73768dc80f8..6610dffc7a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3" -version = "0.3.1" +version = "0.3.2" description = "Bindings to Python interpreter" authors = ["PyO3 Project and Contributors "] readme = "README.md" @@ -22,7 +22,7 @@ codecov = { repository = "PyO3/pyo3", branch = "master", service = "github" } libc = "0.2" spin = "0.4.6" num-traits = "0.2" -pyo3cls = { path = "pyo3cls", version = "0.3.1" } +pyo3cls = { path = "pyo3cls", version = "0.3.2" } mashup = "0.1.5" [dev-dependencies] @@ -46,6 +46,11 @@ python3 = [] # so that the module can also be used with statically linked python interpreters. extension-module = [] +# The stable cpython abi as defined in PEP 384. Currently broken with +# many compilation errors. Pull Requests working towards fixing that +# are welcome. +# abi3 = [] + [workspace] members = [ "pyo3cls", diff --git a/Makefile b/Makefile index aa18ab0b45a..4398ad2b0d1 100644 --- a/Makefile +++ b/Makefile @@ -9,10 +9,6 @@ FEATURES := python2 endif ifeq ($(PY),3) FEATURES := python3 -ifdef PEP384 -export PEP384=1 -FEATURES := $(FEATURES) pep-384 -endif endif CARGO_FLAGS := --features "$(FEATURES)" --no-default-features diff --git a/build.rs b/build.rs index 1fddad48864..999a40c9804 100644 --- a/build.rs +++ b/build.rs @@ -350,7 +350,7 @@ fn configure_from_path(expected_version: &PythonVersion) -> Result<(String, Stri minor: some_minor, } = interpreter_version { - if env::var_os("CARGO_FEATURE_PEP_384").is_some() { + if env::var_os("CARGO_FEATURE_ABI3").is_some() { println!("cargo:rustc-cfg=Py_LIMITED_API"); } if let Some(minor) = some_minor { diff --git a/examples/word-count-cls/Cargo.toml b/examples/word-count-cls/Cargo.toml index 287563fe87e..bd7724be03f 100644 --- a/examples/word-count-cls/Cargo.toml +++ b/examples/word-count-cls/Cargo.toml @@ -8,6 +8,7 @@ rayon = "0.8" [dependencies.pyo3] path = "../../" +features = ["extension-module"] [lib] name = "word_count_cls" diff --git a/pyo3-derive-backend/Cargo.toml b/pyo3-derive-backend/Cargo.toml index 8c905b06480..8466d992a7d 100644 --- a/pyo3-derive-backend/Cargo.toml +++ b/pyo3-derive-backend/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3-derive-backend" -version = "0.3.1" +version = "0.3.2" description = "Code generation for PyO3 package" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] diff --git a/pyo3cls/Cargo.toml b/pyo3cls/Cargo.toml index e88af8bb436..775689df5e9 100644 --- a/pyo3cls/Cargo.toml +++ b/pyo3cls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3cls" -version = "0.3.1" +version = "0.3.2" description = "Proc macros for PyO3 package" authors = ["PyO3 Project and Contributors "] keywords = ["pyo3", "python", "cpython", "ffi"] @@ -22,7 +22,7 @@ features=["full", "parsing", "printing", "extra-traits"] [dependencies.pyo3-derive-backend] path = "../pyo3-derive-backend" -version = "0.3.1" +version = "0.3.2" [dependencies.proc-macro2] version = "0.4" diff --git a/src/ffi3/object.rs b/src/ffi3/object.rs index 302563a5c6e..0d5bfd4a850 100644 --- a/src/ffi3/object.rs +++ b/src/ffi3/object.rs @@ -206,7 +206,9 @@ pub type allocfunc = unsafe extern "C" fn(arg1: *mut PyTypeObject, arg2: Py_ssize_t) -> *mut PyObject; #[cfg(Py_LIMITED_API)] -pub enum PyTypeObject { } +mod typeobject { + pub enum PyTypeObject {} +} #[cfg(not(Py_LIMITED_API))] mod typeobject { @@ -561,7 +563,8 @@ mod typeobject { ) as *mut ffi3::structmember::PyMemberDef } } -#[cfg(not(Py_LIMITED_API))] + +// The exported types depend on whether Py_LIMITED_API is set pub use self::typeobject::*; #[repr(C)] diff --git a/src/typeob.rs b/src/typeob.rs index 5465f7a15ec..6b7d3a9756e 100644 --- a/src/typeob.rs +++ b/src/typeob.rs @@ -350,8 +350,8 @@ impl PyTypeObject for T where T: PyObjectAlloc + PyTypeInfo { } } - /// Register new type in python object system. +#[cfg(not(Py_LIMITED_API))] pub fn initialize_type<'p, T>(py: Python<'p>, module_name: Option<&str>) -> PyResult<()> where T: PyObjectAlloc + PyTypeInfo {