Struct pyoxidizerlib::py_packaging::standalone_distribution::StandaloneDistribution[][src]

pub struct StandaloneDistribution {
Show 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, FileData>, 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>, // some fields omitted
}

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.

libpython_shared_library: Option<PathBuf>

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, FileData>

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

impl StandaloneDistribution[src]

pub fn from_location(
    logger: &Logger,
    location: &PythonDistributionLocation,
    distributions_dir: &Path
) -> Result<Self>
[src]

pub fn from_tar_zst_file(
    logger: &Logger,
    path: &Path,
    extract_dir: &Path
) -> Result<Self>
[src]

Create an instance from a .tar.zst file.

The distribution will be extracted to extract_dir if necessary.

pub fn from_tar_zst<R: Read>(source: R, extract_dir: &Path) -> Result<Self>[src]

Extract and analyze a standalone distribution from a zstd compressed tar stream.

pub fn from_tar<R: Read>(source: R, extract_dir: &Path) -> Result<Self>[src]

Extract and analyze a standalone distribution from a tar stream.

pub fn from_directory(dist_dir: &Path) -> Result<Self>[src]

Obtain an instance by scanning a directory containing an extracted distribution.

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.

pub fn create_hacked_base(&self, logger: &Logger) -> PythonPaths[src]

Duplicate the python distribution, with distutils hacked

pub fn create_venv(&self, logger: &Logger, path: &Path) -> PythonPaths[src]

Create a venv from the distribution at path.

pub fn prepare_venv(
    &self,
    logger: &Logger,
    venv_dir_path: &Path
) -> Result<(PythonPaths, HashMap<String, String>)>
[src]

Create or re-use an existing venv

pub fn is_extension_module_file_loadable(&self) -> bool[src]

Whether the distribution is capable of loading filed-based Python extension modules.

Trait Implementations

impl Clone for StandaloneDistribution[src]

fn clone(&self) -> StandaloneDistribution[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for StandaloneDistribution[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl PythonDistribution for StandaloneDistribution[src]

fn ensure_pip(&self, logger: &Logger) -> Result<PathBuf>[src]

Ensure pip is available to run in the distribution.

fn supports_in_memory_shared_library_loading(&self) -> bool[src]

Determines whether dynamically linked extension modules can be loaded from memory.

fn clone_trait(&self) -> Arc<dyn PythonDistribution>[src]

Clone self into a Box’ed trait object.

fn target_triple(&self) -> &str[src]

The Rust machine triple this distribution runs on.

fn compatible_host_triples(&self) -> Vec<String>[src]

Rust target triples on which this distribution’s binaries can run. Read more

fn python_exe_path(&self) -> &Path[src]

Obtain the filesystem path to a python executable for this distribution.

fn python_version(&self) -> &str[src]

Obtain the full Python version string.

fn python_major_minor_version(&self) -> String[src]

Obtain the X.Y Python version component. e.g. 3.7.

fn python_implementation(&self) -> &str[src]

Obtain the full Python implementation name. e.g. cpython.

fn python_implementation_short(&self) -> &str[src]

Obtain the short Python implementation name. e.g. cp

fn python_tag(&self) -> &str[src]

Obtain the PEP 425 Python tag. e.g. cp38.

fn python_abi_tag(&self) -> Option<&str>[src]

Obtain the PEP 425 Python ABI tag. e.g. cp38d.

fn python_platform_tag(&self) -> &str[src]

Obtain the Python platform tag.

fn python_platform_compatibility_tag(&self) -> &str[src]

Obtain the Python platform tag used to indicate compatibility. Read more

fn cache_tag(&self) -> &str[src]

Obtain the cache tag to apply to Python bytecode modules.

fn python_module_suffixes(&self) -> Result<PythonModuleSuffixes>[src]

Obtain file suffixes for various Python module flavors.

fn stdlib_test_packages(&self) -> Vec<String>[src]

Obtain Python packages in the standard library that provide tests.

fn apple_sdk_info(&self) -> Option<&AppleSdkInfo>[src]

Obtain Apple SDK settings for this distribution.

fn create_bytecode_compiler(&self) -> Result<Box<dyn PythonBytecodeCompiler>>[src]

Create a PythonBytecodeCompiler from this instance.

fn create_packaging_policy(&self) -> Result<PythonPackagingPolicy>[src]

Construct a PythonPackagingPolicy derived from this instance.

fn create_python_interpreter_config(
    &self
) -> Result<PyembedPythonInterpreterConfig>
[src]

Construct an EmbeddedPythonConfig derived from this instance.

fn as_python_executable_builder(
    &self,
    _logger: &Logger,
    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>>
[src]

Obtain a PythonBinaryBuilder for constructing an executable embedding Python. Read more

fn python_resources<'a>(&self) -> Vec<PythonResource<'a>>[src]

Obtain PythonResource instances for every resource in this distribution.

fn resolve_distutils(
    &self,
    logger: &Logger,
    libpython_link_mode: LibpythonLinkMode,
    dest_dir: &Path,
    extra_python_paths: &[&Path]
) -> Result<HashMap<String, String>>
[src]

Resolve a distutils installation used for building Python packages. Read more

fn tcl_files(&self) -> Result<Vec<(PathBuf, FileData)>>[src]

Obtain support files for tcl/tk. Read more

fn tcl_library_path_directory(&self) -> Option<String>[src]

The name of the directory to use for TCL_LIBRARY

fn is_stdlib_test_package(&self, name: &str) -> bool[src]

Determine whether a named module is in a known standard library test package.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T> Instrument for T[src]

fn instrument(self, span: Span) -> Instrumented<Self>[src]

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

fn in_current_span(self) -> Instrumented<Self>[src]

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Err = <U as TryFrom<T>>::Err

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Err>

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]