Merge pull request #1317 from davidhewitt/macros-crates

macros: rename crates for consistency
This commit is contained in:
David Hewitt 2020-12-20 09:54:46 +00:00 committed by GitHub
commit a0588aa6fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
25 changed files with 16 additions and 15 deletions

View File

@ -103,7 +103,7 @@ jobs:
run: cargo test --no-default-features --features "abi3,macros" --target ${{ matrix.platform.rust-target }}
- name: Test proc-macro code
run: cargo test --manifest-path=pyo3-derive-backend/Cargo.toml --target ${{ matrix.platform.rust-target }}
run: cargo test --manifest-path=pyo3-macros-backend/Cargo.toml --target ${{ matrix.platform.rust-target }}
- name: Install python test dependencies
run: |

View File

@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
- Bump minimum supported Rust version to 1.45. [#1272](https://github.com/PyO3/pyo3/pull/1272)
- Bump indoc dependency to 1.0. [#1272](https://github.com/PyO3/pyo3/pull/1272)
- Bump paste dependency to 1.0. [#1272](https://github.com/PyO3/pyo3/pull/1272)
- Rename internal crates `pyo3cls` and `pyo3-derive-backend` to `pyo3-macros` and `pyo3-macros-backend` respectively. [#1317](https://github.com/PyO3/pyo3/pull/1317)
### Added
- Add support for building for CPython limited API. This required a few minor changes to runtime behaviour of of pyo3 `#[pyclass]` types. See the migration guide for full details. [#1152](https://github.com/PyO3/pyo3/pull/1152)

View File

@ -24,7 +24,7 @@ parking_lot = "0.11.0"
num-bigint = { version = "0.3", optional = true }
num-complex = { version = "0.3", optional = true }
paste = { version = "1.0.3", optional = true }
pyo3cls = { path = "pyo3cls", version = "=0.12.4", optional = true }
pyo3-macros = { path = "pyo3-macros", version = "=0.12.4", optional = true }
unindent = { version = "0.1.4", optional = true }
hashbrown = { version = "0.9", optional = true }
@ -36,7 +36,7 @@ proptest = { version = "0.10.1", default-features = false, features = ["std"] }
[features]
default = ["macros"]
macros = ["ctor", "indoc", "inventory", "paste", "pyo3cls", "unindent"]
macros = ["ctor", "indoc", "inventory", "paste", "pyo3-macros", "unindent"]
# Use the Python limited API. See https://www.python.org/dev/peps/pep-0384/ for more.
abi3 = []
# With abi3, we can manually set the minimum Python version.
@ -55,7 +55,7 @@ extension-module = []
[workspace]
members = [
"pyo3cls",
"pyo3-derive-backend",
"pyo3-macros",
"pyo3-macros-backend",
"examples/*"
]

View File

@ -19,8 +19,8 @@ lint: fmt clippy
@true
publish: test
cargo publish --manifest-path pyo3-derive-backend/Cargo.toml
cargo publish --manifest-path pyo3-macros-backend/Cargo.toml
sleep 10 # wait for crates.io to update
cargo publish --manifest-path pyo3cls/Cargo.toml
cargo publish --manifest-path pyo3-macros/Cargo.toml
sleep 10 # wait for crates.io to update
cargo publish

View File

@ -706,7 +706,7 @@ pyclass dependent on whether there is an impl block, we'd need to implement the
`#[pyclass]` and override the implementation in `#[pymethods]`.
To enable this, we use a static registry type provided by [inventory](https://github.com/dtolnay/inventory),
which allows us to collect `impl`s from arbitrary source code by exploiting some binary trick.
See [inventory: how it works](https://github.com/dtolnay/inventory#how-it-works) and `pyo3_derive_backend::py_class` for more details.
See [inventory: how it works](https://github.com/dtolnay/inventory#how-it-works) and `pyo3_macros_backend::py_class` for more details.
Also for `#[pyproto]`, we use a similar, but more task-specific registry and
initialize it using the [ctor](https://github.com/mmastrac/rust-ctor) crate.

View File

@ -1,5 +1,5 @@
[package]
name = "pyo3-derive-backend"
name = "pyo3-macros-backend"
version = "0.12.4"
description = "Code generation for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]

View File

@ -1,5 +1,5 @@
[package]
name = "pyo3cls"
name = "pyo3-macros"
version = "0.12.4"
description = "Proc macros for PyO3 package"
authors = ["PyO3 Project and Contributors <https://github.com/PyO3>"]
@ -16,4 +16,4 @@ proc-macro = true
[dependencies]
quote = "1"
syn = { version = "1", features = ["full", "extra-traits"] }
pyo3-derive-backend = { path = "../pyo3-derive-backend", version = "=0.12.4" }
pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.12.4" }

View File

@ -3,7 +3,7 @@
//! must not contain any other public items.
use proc_macro::TokenStream;
use pyo3_derive_backend::{
use pyo3_macros_backend::{
build_derive_from_pyobject, build_py_class, build_py_function, build_py_methods,
build_py_proto, get_doc, process_functions_in_module, py_init, PyClassArgs, PyFunctionAttr,
};

View File

@ -201,9 +201,9 @@ pub mod types;
/// The proc macros, which are also part of the prelude.
#[cfg(feature = "macros")]
pub mod proc_macro {
pub use pyo3cls::pymodule;
pub use pyo3_macros::pymodule;
/// The proc macro attributes
pub use pyo3cls::{pyclass, pyfunction, pymethods, pyproto};
pub use pyo3_macros::{pyclass, pyfunction, pymethods, pyproto};
}
/// Returns a function that takes a [Python] instance and returns a Python function.

View File

@ -20,4 +20,4 @@ pub use crate::{FromPyObject, IntoPy, IntoPyPointer, PyTryFrom, PyTryInto, ToPyO
// PyModule is only part of the prelude because we need it for the pymodule function
pub use crate::types::{PyAny, PyModule};
#[cfg(feature = "macros")]
pub use pyo3cls::{pyclass, pyfunction, pymethods, pymodule, pyproto, FromPyObject};
pub use pyo3_macros::{pyclass, pyfunction, pymethods, pymodule, pyproto, FromPyObject};