Trait pyoxidizerlib::py_packaging::distribution::PythonDistribution [−][src]
pub trait PythonDistribution {}Show methods
fn clone_trait(&self) -> Arc<dyn PythonDistribution>; fn target_triple(&self) -> &str; fn compatible_host_triples(&self) -> Vec<String>; fn python_exe_path(&self) -> &Path; fn python_version(&self) -> &str; fn python_major_minor_version(&self) -> String; fn python_implementation(&self) -> &str; fn python_implementation_short(&self) -> &str; fn python_tag(&self) -> &str; fn python_abi_tag(&self) -> Option<&str>; fn python_platform_tag(&self) -> &str; fn python_platform_compatibility_tag(&self) -> &str; fn cache_tag(&self) -> &str; fn python_module_suffixes(&self) -> Result<PythonModuleSuffixes>; fn stdlib_test_packages(&self) -> Vec<String>; fn apple_sdk_info(&self) -> Option<&AppleSdkInfo>; fn create_bytecode_compiler(
&self
) -> Result<Box<dyn PythonBytecodeCompiler>>; fn create_packaging_policy(&self) -> Result<PythonPackagingPolicy>; fn create_python_interpreter_config(
&self
) -> Result<PyembedPythonInterpreterConfig>; 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>>; fn python_resources<'a>(&self) -> Vec<PythonResource<'a>>; fn ensure_pip(&self, logger: &Logger) -> Result<PathBuf>; fn resolve_distutils(
&self,
logger: &Logger,
libpython_link_mode: LibpythonLinkMode,
dest_dir: &Path,
extra_python_paths: &[&Path]
) -> Result<HashMap<String, String>>; fn supports_in_memory_shared_library_loading(&self) -> bool; fn tcl_files(&self) -> Result<Vec<(PathBuf, FileData)>>; fn tcl_library_path_directory(&self) -> Option<String>; fn is_stdlib_test_package(&self, name: &str) -> bool { ... }
Describes a generic Python distribution.
Required methods
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.
For example, an x86 distribution might advertise that it can run on 64-bit host triples.
target_triple()
is always in the result.
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.
This is similar to the platform tag. But where python_platform_tag()
exposes the raw value like linux-x86_64
, this is the normalized
value that can be used by tools like pip
. e.g. manylinux2014_x86_64
.
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]
&self
) -> Result<PyembedPythonInterpreterConfig>
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]
&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>>
Obtain a PythonBinaryBuilder
for constructing an executable embedding Python.
This method is how you start the process of creating a new executable file
from a Python distribution. Using the returned PythonBinaryBuilder
instance,
you can manipulate resources, etc and then eventually build a new executable
with it.
fn python_resources<'a>(&self) -> Vec<PythonResource<'a>>
[src]
Obtain PythonResource
instances for every resource in this distribution.
fn ensure_pip(&self, logger: &Logger) -> Result<PathBuf>
[src]
Ensure pip is available to run in the distribution.
Returns the path to a pip
executable.
fn resolve_distutils(
&self,
logger: &Logger,
libpython_link_mode: LibpythonLinkMode,
dest_dir: &Path,
extra_python_paths: &[&Path]
) -> Result<HashMap<String, String>>
[src]
&self,
logger: &Logger,
libpython_link_mode: LibpythonLinkMode,
dest_dir: &Path,
extra_python_paths: &[&Path]
) -> Result<HashMap<String, String>>
Resolve a distutils
installation used for building Python packages.
Some distributions may need to use a modified distutils
to coerce builds to work
as PyOxidizer desires. This method is used to realize such a distutils
installation.
Note that we pass in an explicit libpython link mode because the link mode we care about may differ from the link mode of the distribution itself (as some distributions support multiple link modes).
The return is a map of environment variables to set in the build environment.
fn supports_in_memory_shared_library_loading(&self) -> bool
[src]
Whether this distribution supports loading shared libraries from memory.
This effectively answers whether we can embed a shared library into an executable and load it without having to materialize it on a filesystem.
fn tcl_files(&self) -> Result<Vec<(PathBuf, FileData)>>
[src]
Obtain support files for tcl/tk.
The returned list of files contains relative file names and the locations
of file content. If the files are installed in a new directory, it should
be possible to use that directory joined with tcl_library_path_directory
as the value of TCL_LIBRARY
.
fn tcl_library_path_directory(&self) -> Option<String>
[src]
The name of the directory to use for TCL_LIBRARY
Provided methods
fn is_stdlib_test_package(&self, name: &str) -> bool
[src]
Determine whether a named module is in a known standard library test package.
Implementors
impl PythonDistribution for StandaloneDistribution
[src]
impl PythonDistribution for StandaloneDistribution
[src]fn ensure_pip(&self, logger: &Logger) -> Result<PathBuf>
[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]
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]
fn target_triple(&self) -> &str
[src]
fn compatible_host_triples(&self) -> Vec<String>
[src]
fn python_exe_path(&self) -> &Path
[src]
fn python_version(&self) -> &str
[src]
fn python_major_minor_version(&self) -> String
[src]
fn python_implementation(&self) -> &str
[src]
fn python_implementation_short(&self) -> &str
[src]
fn python_tag(&self) -> &str
[src]
fn python_abi_tag(&self) -> Option<&str>
[src]
fn python_platform_tag(&self) -> &str
[src]
fn python_platform_compatibility_tag(&self) -> &str
[src]
fn cache_tag(&self) -> &str
[src]
fn python_module_suffixes(&self) -> Result<PythonModuleSuffixes>
[src]
fn stdlib_test_packages(&self) -> Vec<String>
[src]
fn apple_sdk_info(&self) -> Option<&AppleSdkInfo>
[src]
fn create_bytecode_compiler(&self) -> Result<Box<dyn PythonBytecodeCompiler>>
[src]
fn create_packaging_policy(&self) -> Result<PythonPackagingPolicy>
[src]
fn create_python_interpreter_config(
&self
) -> Result<PyembedPythonInterpreterConfig>
[src]
&self
) -> Result<PyembedPythonInterpreterConfig>
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]
&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>>
fn python_resources<'a>(&self) -> Vec<PythonResource<'a>>
[src]
fn resolve_distutils(
&self,
logger: &Logger,
libpython_link_mode: LibpythonLinkMode,
dest_dir: &Path,
extra_python_paths: &[&Path]
) -> Result<HashMap<String, String>>
[src]
&self,
logger: &Logger,
libpython_link_mode: LibpythonLinkMode,
dest_dir: &Path,
extra_python_paths: &[&Path]
) -> Result<HashMap<String, String>>