Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macros: rename crates for consistency #1317

Merged
merged 1 commit into from Dec 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -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: |
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Expand Up @@ -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 }

Expand All @@ -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.
Expand All @@ -55,7 +55,7 @@ extension-module = []

[workspace]
members = [
"pyo3cls",
"pyo3-derive-backend",
"pyo3-macros",
"pyo3-macros-backend",
"examples/*"
]
4 changes: 2 additions & 2 deletions Makefile
Expand Up @@ -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
2 changes: 1 addition & 1 deletion guide/src/class.md
Expand Up @@ -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.

Expand Down
@@ -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>"]
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions pyo3cls/Cargo.toml → pyo3-macros/Cargo.toml
@@ -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>"]
Expand All @@ -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" }
File renamed without changes.
2 changes: 1 addition & 1 deletion pyo3cls/src/lib.rs → pyo3-macros/src/lib.rs
Expand Up @@ -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,
};
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/prelude.rs
Expand Up @@ -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};