Skip to main content

Crate pyo3_build_config

Crate pyo3_build_config 

Source
Expand description

Configuration used by PyO3 for conditional support of varying Python versions.

This crate exposes functionality to be called from build scripts to simplify building crates which depend on PyO3.

It used internally by the PyO3 crate’s build script to apply the same configuration.

Re-exportsΒ§

pub use impl_::BuildFlag;
pub use impl_::BuildFlags;
pub use impl_::CrossCompileConfig;
pub use impl_::GilUsed;
pub use impl_::InterpreterConfig;
pub use impl_::InterpreterConfigBuilder;
pub use impl_::PythonAbi;
pub use impl_::PythonAbiBuilder;
pub use impl_::PythonAbiKind;
pub use impl_::PythonImplementation;
pub use impl_::PythonVersion;
pub use impl_::StableAbi;
pub use impl_::cross_compiling_from_to;
pub use impl_::find_all_sysconfigdata;
pub use impl_::parse_sysconfigdata;
pub(crate) use env; πŸ”’
pub(crate) use env; πŸ”’
pub(crate) use process::Command; πŸ”’
pub(crate) use str::FromStr; πŸ”’
pub(crate) use sync::LazyLock; πŸ”’
pub(crate) use Architecture; πŸ”’
pub(crate) use OperatingSystem; πŸ”’

ModulesΒ§

errors πŸ”’
impl_ πŸ”’
pyo3_build_script_impl πŸ‘»
Private exports used in PyO3’s build.rs

MacrosΒ§

bail πŸ‘»
A simple macro for returning an error. Resembles anyhow::bail.
ensure πŸ‘»
A simple macro for checking a condition. Resembles anyhow::ensure.
format_warn πŸ‘»
Format warning into string.
warn πŸ‘»
Show warning.

StructsΒ§

Triple
An LLVM target β€œtriple”. Historically such things had three fields, though they’ve added additional fields over time.

FunctionsΒ§

_add_extension_module_link_args πŸ”’
_add_python_framework_link_args πŸ”’
add_extension_module_link_args
Adds linker arguments suitable for linking an extension module.
add_libpython_rpath_link_args
Adds linker arguments to set rpath when embedding Python within a Rust binary.
add_python_framework_link_args
Adds linker arguments suitable for linking against the Python framework on macOS.
get
Loads the configuration determined from the build environment.
get_inner πŸ”’
print_expected_cfgs πŸ‘»
Registers pyo3s config names as reachable cfg expressions.
rustc_minor_version πŸ”’
use_pyo3_cfgs
Adds all the #[cfg] flags to the current compilation.
⚠️ Internal Docs ⚠️ Not Public API πŸ‘‰ Official Docs Here