diff --git a/Cargo.toml b/Cargo.toml index 800ea95f..a565374a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ log = "0.4" libc = "0.2" spin = "0.4.6" num-traits = "0.2" -pyo3cls = { path = "pyo3cls", version = "^0.2.1" } +pyo3cls = { path = "pyo3cls", version = "0.2.5" } [dev-dependencies] docmatic = "^0.1.2" diff --git a/pyo3-derive-backend/Cargo.toml b/pyo3-derive-backend/Cargo.toml new file mode 100644 index 00000000..130b19df --- /dev/null +++ b/pyo3-derive-backend/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "pyo3-derive-backend" +version = "0.2.5" +description = "Code generation for PyO3 package" +authors = ["PyO3 Project and Contributors Tokens { #[no_mangle] #[allow(non_snake_case, unused_imports)] pub unsafe extern "C" fn #cb_name() -> *mut ::pyo3::ffi::PyObject { - extern crate pyo3; use std; use pyo3::{IntoPyPointer, ObjectProtocol}; @@ -121,7 +120,6 @@ pub fn py2_init(fnname: &syn::Ident, name: &String, doc: syn::Lit) -> Tokens { #[no_mangle] #[allow(non_snake_case, unused_imports)] pub unsafe extern "C" fn #cb_name() { - extern crate pyo3; use std; // initialize python diff --git a/pyo3cls/src/py_class.rs b/pyo3-derive-backend/src/py_class.rs similarity index 99% rename from pyo3cls/src/py_class.rs rename to pyo3-derive-backend/src/py_class.rs index 487229d4..16f2812b 100644 --- a/pyo3cls/src/py_class.rs +++ b/pyo3-derive-backend/src/py_class.rs @@ -41,7 +41,7 @@ pub fn build_py_class(ast: &mut syn::DeriveInput, attr: String) -> Tokens { unused_qualifications, unused_variables, non_camel_case_types)] const #dummy_const: () = { use std; - extern crate pyo3 as _pyo3; + use pyo3 as _pyo3; #tokens }; @@ -372,7 +372,7 @@ fn impl_descriptors(cls: &syn::Ty, descriptors: Vec<(syn::Field, Vec)>) #[allow(non_upper_case_globals, unused_attributes, unused_qualifications, unused_variables, unused_imports)] const #dummy_const: () = { - extern crate pyo3 as _pyo3; + use pyo3 as _pyo3; #tokens }; diff --git a/pyo3cls/src/py_impl.rs b/pyo3-derive-backend/src/py_impl.rs similarity index 97% rename from pyo3cls/src/py_impl.rs rename to pyo3-derive-backend/src/py_impl.rs index 025a0f7a..c53ac69b 100644 --- a/pyo3cls/src/py_impl.rs +++ b/pyo3-derive-backend/src/py_impl.rs @@ -57,7 +57,7 @@ fn impl_methods(ty: &Box, impls: &mut Vec) -> Tokens { #[allow(non_upper_case_globals, unused_attributes, unused_qualifications, unused_variables, unused_imports)] const #dummy_const: () = { - extern crate pyo3 as _pyo3; + use pyo3 as _pyo3; #tokens }; diff --git a/pyo3cls/src/py_method.rs b/pyo3-derive-backend/src/py_method.rs similarity index 100% rename from pyo3cls/src/py_method.rs rename to pyo3-derive-backend/src/py_method.rs diff --git a/pyo3cls/src/py_proto.rs b/pyo3-derive-backend/src/py_proto.rs similarity index 99% rename from pyo3cls/src/py_proto.rs rename to pyo3-derive-backend/src/py_proto.rs index b012606e..b18b8709 100644 --- a/pyo3cls/src/py_proto.rs +++ b/pyo3-derive-backend/src/py_proto.rs @@ -128,7 +128,7 @@ fn impl_proto_impl(ty: &Box, #[allow(non_upper_case_globals, unused_attributes, unused_qualifications, unused_variables)] const #dummy_const: () = { - extern crate pyo3 as _pyo3; + use pyo3 as _pyo3; #tokens diff --git a/pyo3cls/src/utils.rs b/pyo3-derive-backend/src/utils.rs similarity index 100% rename from pyo3cls/src/utils.rs rename to pyo3-derive-backend/src/utils.rs diff --git a/pyo3cls/Cargo.toml b/pyo3cls/Cargo.toml index b022b06f..b9c7c780 100644 --- a/pyo3cls/Cargo.toml +++ b/pyo3cls/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pyo3cls" -version = "0.2.1" +version = "0.2.5" description = "Proc macros for PyO3 package" authors = ["PyO3 Project and Contributors