This commit is contained in:
konstin 2018-07-22 21:35:54 +02:00
parent 897716cf5b
commit 2627fa8a08
9 changed files with 22 additions and 13 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 0.3.2
* Replaced `concat_idents` with mashup
## 0.3.1 ## 0.3.1
* Fixed scoping bug in pyobject_native_type that would break rust-numpy * Fixed scoping bug in pyobject_native_type that would break rust-numpy

View File

@ -1,6 +1,6 @@
[package] [package]
name = "pyo3" name = "pyo3"
version = "0.3.1" version = "0.3.2"
description = "Bindings to Python interpreter" description = "Bindings to Python interpreter"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"] authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
readme = "README.md" readme = "README.md"
@ -22,7 +22,7 @@ codecov = { repository = "PyO3/pyo3", branch = "master", service = "github" }
libc = "0.2" libc = "0.2"
spin = "0.4.6" spin = "0.4.6"
num-traits = "0.2" num-traits = "0.2"
pyo3cls = { path = "pyo3cls", version = "0.3.1" } pyo3cls = { path = "pyo3cls", version = "0.3.2" }
mashup = "0.1.5" mashup = "0.1.5"
[dev-dependencies] [dev-dependencies]
@ -46,6 +46,11 @@ python3 = []
# so that the module can also be used with statically linked python interpreters. # so that the module can also be used with statically linked python interpreters.
extension-module = [] 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] [workspace]
members = [ members = [
"pyo3cls", "pyo3cls",

View File

@ -9,10 +9,6 @@ FEATURES := python2
endif endif
ifeq ($(PY),3) ifeq ($(PY),3)
FEATURES := python3 FEATURES := python3
ifdef PEP384
export PEP384=1
FEATURES := $(FEATURES) pep-384
endif
endif endif
CARGO_FLAGS := --features "$(FEATURES)" --no-default-features CARGO_FLAGS := --features "$(FEATURES)" --no-default-features

View File

@ -350,7 +350,7 @@ fn configure_from_path(expected_version: &PythonVersion) -> Result<(String, Stri
minor: some_minor, minor: some_minor,
} = interpreter_version } = 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"); println!("cargo:rustc-cfg=Py_LIMITED_API");
} }
if let Some(minor) = some_minor { if let Some(minor) = some_minor {

View File

@ -8,6 +8,7 @@ rayon = "0.8"
[dependencies.pyo3] [dependencies.pyo3]
path = "../../" path = "../../"
features = ["extension-module"]
[lib] [lib]
name = "word_count_cls" name = "word_count_cls"

View File

@ -1,6 +1,6 @@
[package] [package]
name = "pyo3-derive-backend" name = "pyo3-derive-backend"
version = "0.3.1" version = "0.3.2"
description = "Code generation for PyO3 package" description = "Code generation for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"] authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
keywords = ["pyo3", "python", "cpython", "ffi"] keywords = ["pyo3", "python", "cpython", "ffi"]

View File

@ -1,6 +1,6 @@
[package] [package]
name = "pyo3cls" name = "pyo3cls"
version = "0.3.1" version = "0.3.2"
description = "Proc macros for PyO3 package" description = "Proc macros for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"] authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
keywords = ["pyo3", "python", "cpython", "ffi"] keywords = ["pyo3", "python", "cpython", "ffi"]
@ -22,7 +22,7 @@ features=["full", "parsing", "printing", "extra-traits"]
[dependencies.pyo3-derive-backend] [dependencies.pyo3-derive-backend]
path = "../pyo3-derive-backend" path = "../pyo3-derive-backend"
version = "0.3.1" version = "0.3.2"
[dependencies.proc-macro2] [dependencies.proc-macro2]
version = "0.4" version = "0.4"

View File

@ -206,7 +206,9 @@ pub type allocfunc =
unsafe extern "C" fn(arg1: *mut PyTypeObject, arg2: Py_ssize_t) -> *mut PyObject; unsafe extern "C" fn(arg1: *mut PyTypeObject, arg2: Py_ssize_t) -> *mut PyObject;
#[cfg(Py_LIMITED_API)] #[cfg(Py_LIMITED_API)]
pub enum PyTypeObject { } mod typeobject {
pub enum PyTypeObject {}
}
#[cfg(not(Py_LIMITED_API))] #[cfg(not(Py_LIMITED_API))]
mod typeobject { mod typeobject {
@ -561,7 +563,8 @@ mod typeobject {
) as *mut ffi3::structmember::PyMemberDef ) 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::*; pub use self::typeobject::*;
#[repr(C)] #[repr(C)]

View File

@ -350,8 +350,8 @@ impl<T> PyTypeObject for T where T: PyObjectAlloc<T> + PyTypeInfo {
} }
} }
/// Register new type in python object system. /// 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<()> pub fn initialize_type<'p, T>(py: Python<'p>, module_name: Option<&str>) -> PyResult<()>
where T: PyObjectAlloc<T> + PyTypeInfo where T: PyObjectAlloc<T> + PyTypeInfo
{ {