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

pub struct StandaloneDistribution {
    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]

impl Debug for StandaloneDistribution[src]

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.

Auto Trait Implementations

Blanket Implementations

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

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

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

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

impl<T> Instrument for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

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

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

type Owned = T

The resulting type after obtaining ownership.

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.

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.

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