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_::cross_compiling_from_to;
pub use impl_::find_all_sysconfigdata;
pub use impl_::parse_sysconfigdata;
pub use impl_::BuildFlag;
pub use impl_::BuildFlags;
pub use impl_::CrossCompileConfig;
pub use impl_::InterpreterConfig;
pub use impl_::PythonImplementation;
pub use impl_::PythonVersion;

ModulesΒ§

errors πŸ”’
impl_ πŸ”’
Main implementation module included in both the pyo3-build-config library crate and its build script.
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.

ConstantsΒ§

CONFIG_FILE πŸ”’πŸ‘»
Build configuration provided by PYO3_CONFIG_FILE. May be empty if env var not set.
HOST_CONFIG πŸ”’πŸ‘»
Build configuration discovered by pyo3-build-config build script. Not aware of cross-compilation settings.

FunctionsΒ§

_add_extension_module_link_args πŸ”’
_add_python_framework_link_args πŸ”’
add_extension_module_link_args
Adds linker arguments suitable for PyO3’s extension-module feature.
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.
print_expected_cfgs πŸ‘»
Registers pyo3s config names as reachable cfg expressions
print_feature_cfg πŸ”’
Helper to print a feature cfg with a minimum rust version required.
print_feature_cfgs πŸ‘»
Use certain features if we detect the compiler being used supports them.
resolve_cross_compile_config_path πŸ”’πŸ‘»
Returns the path where PyO3’s build.rs writes its cross compile configuration.
rustc_minor_version πŸ”’
use_pyo3_cfgs
Adds all the #[cfg] flags to the current compilation.
⚠️ Internal Docs ⚠️ Not Public API πŸ‘‰ Official Docs Here