Skip to main content

Module impl_

Module impl_ 

Source

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.
InterpreterConfigBuilder
PythonAbi
PythonAbiBuilder
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
GilUsed
Whether the ABI is for the GIL-enabled or free-threaded build.
PythonAbiKind
The β€œkind” of ABI.
PythonImplementation
StableAbi
The variety of stable ABI
StableAbiVersion
The target stable ABI version.

ConstantsΒ§

MAXIMUM_SUPPORTED_VERSION_PYPY πŸ”’
MINIMUM_SUPPORTED_VERSION πŸ”’
Minimum Python version PyO3 supports.
MINIMUM_SUPPORTED_VERSION_ABI3T πŸ”’
MINIMUM_SUPPORTED_VERSION_GRAALPY πŸ”’
GraalPy may implement the same CPython version over multiple releases.
MINIMUM_SUPPORTED_VERSION_PYPY πŸ”’
STABLE_ABI_MAX_MINOR πŸ”’
Maximum Python version that can be used as minimum required Python version with abi3.
WINDOWS_STABLE_ABI_DEBUG_LIB_NAME πŸ”’
WINDOWS_STABLE_ABI_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_to
Detect whether we are cross compiling and return an assembled CrossCompileConfig if so.
default_cross_compile πŸ”’
Generates β€œdefault” cross compilation information for the target.
default_lib_name_for_target πŸ”’
Generates the default library name for the target platform.
default_lib_name_unix πŸ”’
default_lib_name_windows πŸ”’
default_stable_abi_config πŸ”’
Generates β€œdefault” interpreter configuration when compiling stable ABI extensions without a working Python interpreter.
ends_with πŸ”’
env_var
Gets an external environment variable, and registers the build script to rerun if the variable changes.
escape πŸ”’
exact_stable_abi_version πŸ”’
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_abi3t_version
Gets the minimum supported Python version from PyO3 abi3t-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_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_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 suitable for the build host.
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.
sanitize_stable_abi_version πŸ”’
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