Skip to main content

Module impl_

Module impl_ 

Source

Re-exportsΒ§

use std::collections::HashMap; πŸ”’
use std::collections::HashSet; πŸ”’
use std::env; πŸ”’
use std::env; πŸ”’
use std::ffi::OsStr; πŸ”’
use std::ffi::OsString; πŸ”’
use std::fmt::Display; πŸ”’
use std::fs; πŸ”’
use std::fs::DirEntry; πŸ”’
use std::io::BufRead; πŸ”’
use std::io::BufReader; πŸ”’
use std::io::Read; πŸ”’
use std::io::Write; πŸ”’
use std::path::Path; πŸ”’
use std::path::PathBuf; πŸ”’
use std::process::Command; πŸ”’
use std::process::Stdio; πŸ”’
use std::str; πŸ”’
use std::str::FromStr; πŸ”’
use target_lexicon::Architecture; πŸ”’
use target_lexicon::Environment; πŸ”’
use target_lexicon::OperatingSystem; πŸ”’
use target_lexicon::Vendor; πŸ”’
use crate::bail; πŸ”’
use crate::ensure; πŸ”’
use crate::errors::Context; πŸ”’
use crate::errors::Error; πŸ”’
use crate::errors::Result; πŸ”’
use crate::warn; πŸ”’

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
A Python ABI, displayed as implementation-kind-version with an optional -debug suffix.
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Β§

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.
STABLE_ABI_MAX_MINOR πŸ”’
Maximum Python version that can be used as minimum required Python version with abi3.

FunctionsΒ§

applicable_stable_abi πŸ”’
Selects which stable ABI (kind and minimum version) from the abi3-py3* and abi3t-py3* features (if any) applies to the given interpreter.
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