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: PathBuf
Directory where distribution lives in the filesystem.
target_triple: String
Rust target triple that this distribution runs on.
python_implementation: String
Python implementation name.
python_tag: String
PEP 425 Python tag value.
python_abi_tag: Option<String>
PEP 425 Python ABI tag.
python_platform_tag: String
PEP 425 Python platform tag.
version: String
Python version string.
python_exe: PathBuf
Path to Python interpreter executable.
stdlib_path: PathBuf
Path to Python standard library.
python_symbol_visibility: String
Symbol 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: PathBuf
Path to copy of hacked dist to use for packaging rules venvs
inittab_object: PathBuf
Path to object file defining _PyImport_Inittab.
inittab_cflags: Vec<String>
Compiler flags to use to build object containing _PyImport_Inittab.
cache_tag: String
Tag 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
cp
source§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_LIBRARY
source§fn is_stdlib_test_package(&self, name: &str) -> bool
fn is_stdlib_test_package(&self, name: &str) -> bool
Auto Trait Implementations§
impl RefUnwindSafe for StandaloneDistribution
impl Send for StandaloneDistribution
impl Sync for StandaloneDistribution
impl Unpin for StandaloneDistribution
impl UnwindSafe for StandaloneDistribution
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§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.§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.§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.§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.§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.§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.§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.§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.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
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>
§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§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 more§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 more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> Rwhere
Self: BorrowMut<B>,
B: 'a + ?Sized,
R: 'a,
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere
Self: AsRef<U>,
U: 'a + ?Sized,
R: 'a,
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere
Self: AsMut<U>,
U: 'a + ?Sized,
R: 'a,
self
, then passes self.as_mut()
into the pipe
function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere
Self: Deref<Target = T>,
T: ?Sized,
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
Deref::Target
of a value. Read more§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.§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.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere
Self: Borrow<B>,
B: ?Sized,
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere
Self: BorrowMut<B>,
B: ?Sized,
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere
Self: AsRef<R>,
R: ?Sized,
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere
Self: AsMut<R>,
R: ?Sized,
.tap_ref_mut()
only in debug builds, and is erased in release
builds.