Skip to content

Commit

Permalink
restore dependency of pyo3-macros-backend on pyo3-build-config
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Feb 12, 2024
1 parent fe28d3f commit 93affec
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ multiple-pymethods = ["inventory", "pyo3-macros/multiple-pymethods"]
extension-module = ["pyo3-ffi/extension-module"]

# Use the Python limited API. See https://www.python.org/dev/peps/pep-0384/ for more.
abi3 = ["pyo3-build-config/abi3", "pyo3-ffi/abi3", "pyo3-macros/abi3"]
abi3 = ["pyo3-build-config/abi3", "pyo3-ffi/abi3"]

# With abi3, we can manually set the minimum Python version.
abi3-py37 = ["abi3-py38", "pyo3-build-config/abi3-py37", "pyo3-ffi/abi3-py37"]
Expand Down
8 changes: 3 additions & 5 deletions pyo3-macros-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ edition = "2021"
# not to depend on proc-macro itself.
# See https://github.com/PyO3/pyo3/pull/810 for more.
[dependencies]
quote = { version = "1", default-features = false }
proc-macro2 = { version = "1", default-features = false }
heck = "0.4"
proc-macro2 = { version = "1", default-features = false }
pyo3-build-config = { path = "../pyo3-build-config", version = "0.21.0-dev", features = ["resolve-config"] }
quote = { version = "1", default-features = false }

[dependencies.syn]
version = "2"
default-features = false
features = ["derive", "parsing", "printing", "clone-impls", "full", "extra-traits"]

[features]
abi3 = []

[lints]
workspace = true
4 changes: 1 addition & 3 deletions pyo3-macros-backend/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,5 @@ pub fn apply_renaming_rule(rule: RenamingRule, name: &str) -> String {
}

pub(crate) fn is_abi3() -> bool {
cfg!(feature = "abi3")
|| std::env::var_os("PYO3_USE_ABI3_FORWARD_COMPATIBILITY")
.map_or(false, |os_str| os_str == "1")
pyo3_build_config::get().abi3
}
2 changes: 0 additions & 2 deletions pyo3-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ proc-macro = true
[features]
multiple-pymethods = []

abi3 = ["pyo3-macros-backend/abi3"]

[dependencies]
proc-macro2 = { version = "1", default-features = false }
quote = "1"
Expand Down

0 comments on commit 93affec

Please sign in to comment.