Expand description
Main implementation module included in both the pyo3-build-config
library crate
and its build script.
StructsΒ§
- Build
Flags - A list of python interpreter compile-time preprocessor defines.
- Cross
Compile Config - Configuration needed by PyO3 to cross-compile for a target platform.
- Cross
Compile πEnvVars - PyO3-specific cross compile environment variable values
- Interpreter
Config - Configuration needed by PyO3 to build for the correct Python implementation.
- Python
Version - Sysconfigdata
- Parsed data from Python sysconfigdata file
- Triple
- An LLVM target βtripleβ. Historically such things had three fields, though theyβve added additional fields over time.
EnumsΒ§
ConstantsΒ§
- ABI3_
MAX_ πMINOR - Maximum Python version that can be used as minimum required Python version with abi3.
- MINIMUM_
SUPPORTED_ πVERSION - Minimum Python version PyO3 supports.
- MINIMUM_
SUPPORTED_ πVERSION_ GRAALPY - GraalPy may implement the same CPython version over multiple releases.
- WINDOWS_
ABI3_ πDEBUG_ LIB_ NAME - WINDOWS_
ABI3_ πLIB_ NAME
FunctionsΒ§
- cargo_
env_ var - Gets an environment variable owned by cargo.
- conda_
env_ πinterpreter - cross_
compile_ πfrom_ sysconfigdata - Find cross compilation information from sysconfigdata file
- cross_
compiling_ from_ cargo_ env - Detect whether we are cross compiling from Cargo and
PYO3_CROSS_*
environment variables and return an assembledCrossCompileConfig
if so. - cross_
compiling_ from_ to - Detect whether we are cross compiling and return an assembled CrossCompileConfig if so.
- default_
abi3_ πconfig - Generates βdefaultβ interpreter configuration when compiling βabi3β extensions without a working Python interpreter.
- default_
cross_ πcompile - Generates βdefaultβ cross compilation information for the target.
- default_
lib_ πname_ for_ target - default_
lib_ πname_ unix - default_
lib_ πname_ windows - ends_
with π - env_var
- Gets an external environment variable, and registers the build script to rerun if the variable changes.
- escape π
- find_
all_ sysconfigdata - Finds
_sysconfigdata*.py
files for detected Python interpreters. - find_
interpreter - Attempts to locate a python interpreter.
- find_
sysconfigdata π - Finds the sysconfigdata file when the target Python library directory is set.
- get_
abi3_ version - Gets the minimum supported Python version from PyO3
abi3-py*
features. - get_
env_ πinterpreter - get_
host_ πinterpreter - Locates and extracts the build host Python interpreter configuration.
- have_
python_ πinterpreter - Checks if we should look for a Python interpreter installation to get the target interpreter configuration.
- is_abi3 π
- Checks if
abi3
or any of theabi3-py3*
features is enabled for the PyO3 crate. - is_
cpython_ πlib_ dir - is_
extension_ module - Checks if the
extension-module
feature is enabled for the PyO3 crate. - is_
graalpy_ πlib_ dir - is_
linking_ libpython - Checks if we need to link to
libpython
for the current build target. - is_
linking_ πlibpython_ for_ target - Checks if we need to link to
libpython
for the target. - is_
pypy_ πlib_ dir - load_
cross_ πcompile_ config - Detects the cross compilation target interpreter configuration from all available sources (PyO3 environment variables, Python sysconfigdata, etc.).
- make_
cross_ compile_ config - Generates an interpreter config suitable for cross-compilation.
- make_
interpreter_ config - Generates an interpreter config which will be hard-coded into the pyo3-build-config crate.
Only used by
pyo3-build-config
build script. - parse_
script_ πoutput - parse_
sysconfigdata - Parse sysconfigdata file
- require_
libdir_ πfor_ target - Checks if we need to discover the Python library directory to link the extension module binary.
- run_
python_ πscript - Run a python script using the specified interpreter binary.
- run_
python_ πscript_ with_ envs - Run a python script using the specified interpreter binary with additional environment variables (e.g. PYTHONPATH) set.
- search_
lib_ πdir - recursive search for _sysconfigdata, returns all possibilities of sysconfigdata paths
- starts_
with π - target_
triple_ from_ env - Gets the compilation target triple from environment variables set by Cargo.
- unescape π
- venv_
interpreter π