Module impl_

Source
Expand description

Main implementation module included in both the pyo3-build-config library crate and its build script.

StructsΒ§

BuildFlags
A list of python interpreter compile-time preprocessor defines.
CrossCompileConfig
Configuration needed by PyO3 to cross-compile for a target platform.
CrossCompileEnvVars πŸ”’
PyO3-specific cross compile environment variable values
InterpreterConfig
Configuration needed by PyO3 to build for the correct Python implementation.
PythonVersion
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Β§

BuildFlag
PythonImplementation

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 assembled CrossCompileConfig 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 the abi3-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 πŸ”’
⚠️ Internal Docs ⚠️ Not Public API πŸ‘‰ Official Docs Here