pub struct StandaloneDistribution {Show 27 fields
pub base_dir: PathBuf,
pub target_triple: String,
pub python_implementation: String,
pub python_tag: String,
pub python_abi_tag: Option<String>,
pub python_platform_tag: String,
pub version: String,
pub python_exe: PathBuf,
pub stdlib_path: PathBuf,
pub python_symbol_visibility: String,
pub core_license: Option<LicensedComponent>,
pub licenses: Option<Vec<String>>,
pub license_path: Option<PathBuf>,
pub objs_core: BTreeMap<PathBuf, PathBuf>,
pub links_core: Vec<LibraryDependency>,
pub libpython_shared_library: Option<PathBuf>,
pub extension_modules: BTreeMap<String, PythonExtensionModuleVariants>,
pub frozen_c: Vec<u8>,
pub includes: BTreeMap<String, PathBuf>,
pub libraries: BTreeMap<String, PathBuf>,
pub py_modules: BTreeMap<String, PathBuf>,
pub resources: BTreeMap<String, BTreeMap<String, PathBuf>>,
pub venv_base: PathBuf,
pub inittab_object: PathBuf,
pub inittab_cflags: Vec<String>,
pub cache_tag: String,
pub crt_features: Vec<String>,
/* private fields */
}Expand description
Represents a standalone Python distribution.
This is a Python distributed produced by the python-build-standalone
project. It is derived from a tarball containing a PYTHON.json file
describing the distribution.
Fields§
§base_dir: PathBufDirectory where distribution lives in the filesystem.
target_triple: StringRust target triple that this distribution runs on.
python_implementation: StringPython implementation name.
python_tag: StringPEP 425 Python tag value.
python_abi_tag: Option<String>PEP 425 Python ABI tag.
python_platform_tag: StringPEP 425 Python platform tag.
version: StringPython version string.
python_exe: PathBufPath to Python interpreter executable.
stdlib_path: PathBufPath to Python standard library.
python_symbol_visibility: StringSymbol visibility for Python symbols.
core_license: Option<LicensedComponent>Holds license information for the core distribution.
licenses: Option<Vec<String>>SPDX license shortnames that apply to this distribution.
Licenses only cover the core distribution. Licenses for libraries required by extensions are stored next to the extension’s linking info.
license_path: Option<PathBuf>Path to file holding license text for this distribution.
objs_core: BTreeMap<PathBuf, PathBuf>Object files providing the core Python implementation.
Keys are relative paths. Values are filesystem paths.
links_core: Vec<LibraryDependency>Linking information for the core Python implementation.
Filesystem location of pythonXY shared library for this distribution.
Only set if link_mode is StandaloneDistributionLinkMode::Dynamic.
extension_modules: BTreeMap<String, PythonExtensionModuleVariants>Extension modules available to this distribution.
frozen_c: Vec<u8>§includes: BTreeMap<String, PathBuf>Include files for Python.
Keys are relative paths. Values are filesystem paths.
libraries: BTreeMap<String, PathBuf>Static libraries available for linking.
Keys are library names, without the “lib” prefix or file extension. Values are filesystem paths where library is located.
py_modules: BTreeMap<String, PathBuf>§resources: BTreeMap<String, BTreeMap<String, PathBuf>>Non-module Python resource files.
Keys are package names. Values are maps of resource name to data for the resource within that package.
venv_base: PathBufPath to copy of hacked dist to use for packaging rules venvs
inittab_object: PathBufPath to object file defining _PyImport_Inittab.
inittab_cflags: Vec<String>Compiler flags to use to build object containing _PyImport_Inittab.
cache_tag: StringTag to apply to bytecode files.
e.g. cpython-39.
crt_features: Vec<String>List of strings denoting C Runtime requirements.
Implementations§
Source§impl StandaloneDistribution
impl StandaloneDistribution
pub fn from_location( location: &PythonDistributionLocation, distributions_dir: &Path, ) -> Result<Self>
Sourcepub fn from_tar_zst_file(path: &Path, extract_dir: &Path) -> Result<Self>
pub fn from_tar_zst_file(path: &Path, extract_dir: &Path) -> Result<Self>
Create an instance from a .tar.zst file.
The distribution will be extracted to extract_dir if necessary.
Sourcepub fn from_tar_zst<R: Read>(source: R, extract_dir: &Path) -> Result<Self>
pub fn from_tar_zst<R: Read>(source: R, extract_dir: &Path) -> Result<Self>
Extract and analyze a standalone distribution from a zstd compressed tar stream.
Sourcepub fn from_tar<R: Read>(source: R, extract_dir: &Path) -> Result<Self>
pub fn from_tar<R: Read>(source: R, extract_dir: &Path) -> Result<Self>
Extract and analyze a standalone distribution from a tar stream.
Sourcepub fn from_directory(dist_dir: &Path) -> Result<Self>
pub fn from_directory(dist_dir: &Path) -> Result<Self>
Obtain an instance by scanning a directory containing an extracted distribution.
Sourcepub fn libpython_link_support(&self) -> (bool, bool)
pub fn libpython_link_support(&self) -> (bool, bool)
Determines support for building a libpython from this distribution.
Returns a tuple of bools indicating whether this distribution can build a static libpython and a dynamically linked libpython.
Sourcepub fn is_extension_module_file_loadable(&self) -> bool
pub fn is_extension_module_file_loadable(&self) -> bool
Whether the distribution is capable of loading filed-based Python extension modules.
Trait Implementations§
Source§impl Clone for StandaloneDistribution
impl Clone for StandaloneDistribution
Source§fn clone(&self) -> StandaloneDistribution
fn clone(&self) -> StandaloneDistribution
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StandaloneDistribution
impl Debug for StandaloneDistribution
Source§impl PythonDistribution for StandaloneDistribution
impl PythonDistribution for StandaloneDistribution
Source§fn ensure_pip(&self) -> Result<PathBuf>
fn ensure_pip(&self) -> Result<PathBuf>
Ensure pip is available to run in the distribution.
Determines whether dynamically linked extension modules can be loaded from memory.
Source§fn clone_trait(&self) -> Arc<dyn PythonDistribution>
fn clone_trait(&self) -> Arc<dyn PythonDistribution>
Source§fn target_triple(&self) -> &str
fn target_triple(&self) -> &str
Source§fn compatible_host_triples(&self) -> Vec<String>
fn compatible_host_triples(&self) -> Vec<String>
Source§fn python_exe_path(&self) -> &Path
fn python_exe_path(&self) -> &Path
python executable for this distribution.Source§fn python_version(&self) -> &str
fn python_version(&self) -> &str
Source§fn python_major_minor_version(&self) -> String
fn python_major_minor_version(&self) -> String
3.7.Source§fn python_implementation(&self) -> &str
fn python_implementation(&self) -> &str
cpython.Source§fn python_implementation_short(&self) -> &str
fn python_implementation_short(&self) -> &str
cpSource§fn python_tag(&self) -> &str
fn python_tag(&self) -> &str
cp38.Source§fn python_abi_tag(&self) -> Option<&str>
fn python_abi_tag(&self) -> Option<&str>
cp38d.Source§fn python_platform_tag(&self) -> &str
fn python_platform_tag(&self) -> &str
Source§fn python_platform_compatibility_tag(&self) -> &str
fn python_platform_compatibility_tag(&self) -> &str
Source§fn python_module_suffixes(&self) -> Result<PythonModuleSuffixes>
fn python_module_suffixes(&self) -> Result<PythonModuleSuffixes>
Source§fn stdlib_test_packages(&self) -> Vec<String>
fn stdlib_test_packages(&self) -> Vec<String>
Source§fn apple_sdk_info(&self) -> Option<&AppleSdkInfo>
fn apple_sdk_info(&self) -> Option<&AppleSdkInfo>
Source§fn create_bytecode_compiler(
&self,
env: &Environment,
) -> Result<Box<dyn PythonBytecodeCompiler>>
fn create_bytecode_compiler( &self, env: &Environment, ) -> Result<Box<dyn PythonBytecodeCompiler>>
PythonBytecodeCompiler from this instance.Source§fn create_packaging_policy(&self) -> Result<PythonPackagingPolicy>
fn create_packaging_policy(&self) -> Result<PythonPackagingPolicy>
PythonPackagingPolicy derived from this instance.Source§fn create_python_interpreter_config(
&self,
) -> Result<PyembedPythonInterpreterConfig>
fn create_python_interpreter_config( &self, ) -> Result<PyembedPythonInterpreterConfig>
EmbeddedPythonConfig derived from this instance.Source§fn as_python_executable_builder(
&self,
host_triple: &str,
target_triple: &str,
name: &str,
libpython_link_mode: BinaryLibpythonLinkMode,
policy: &PythonPackagingPolicy,
config: &PyembedPythonInterpreterConfig,
host_distribution: Option<Arc<dyn PythonDistribution>>,
) -> Result<Box<dyn PythonBinaryBuilder>>
fn as_python_executable_builder( &self, host_triple: &str, target_triple: &str, name: &str, libpython_link_mode: BinaryLibpythonLinkMode, policy: &PythonPackagingPolicy, config: &PyembedPythonInterpreterConfig, host_distribution: Option<Arc<dyn PythonDistribution>>, ) -> Result<Box<dyn PythonBinaryBuilder>>
PythonBinaryBuilder for constructing an executable embedding Python. Read moreSource§fn python_resources<'a>(&self) -> Vec<PythonResource<'a>>
fn python_resources<'a>(&self) -> Vec<PythonResource<'a>>
PythonResource instances for every resource in this distribution.Source§fn resolve_distutils(
&self,
libpython_link_mode: LibpythonLinkMode,
dest_dir: &Path,
extra_python_paths: &[&Path],
) -> Result<HashMap<String, String>>
fn resolve_distutils( &self, libpython_link_mode: LibpythonLinkMode, dest_dir: &Path, extra_python_paths: &[&Path], ) -> Result<HashMap<String, String>>
distutils installation used for building Python packages. Read moreSource§fn tcl_files(&self) -> Result<Vec<(PathBuf, FileEntry)>>
fn tcl_files(&self) -> Result<Vec<(PathBuf, FileEntry)>>
Source§fn tcl_library_path_directory(&self) -> Option<String>
fn tcl_library_path_directory(&self) -> Option<String>
TCL_LIBRARYSource§fn is_stdlib_test_package(&self, name: &str) -> bool
fn is_stdlib_test_package(&self, name: &str) -> bool
Auto Trait Implementations§
impl Freeze for StandaloneDistribution
impl RefUnwindSafe for StandaloneDistribution
impl Send for StandaloneDistribution
impl Sync for StandaloneDistribution
impl Unpin for StandaloneDistribution
impl UnwindSafe for StandaloneDistribution
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.