Struct python_packaging::policy::PythonPackagingPolicy [−][src]
pub struct PythonPackagingPolicy { /* fields omitted */ }
Expand description
Defines how Python resources should be packaged.
Implementations
Obtain the active extension module filter for this instance.
Set the extension module filter to use.
Obtain the preferred extension module variants for this policy.
The returned object is a mapping of extension name to its variant name.
Denote the preferred variant for an extension module.
If set, the named variant will be chosen if it is present.
Obtain the primary location for added resources.
Set the primary location for added resources.
Obtain the fallback location for added resources.
Set the fallback location for added resources.
Whether to allow untyped File
resources.
Set whether to allow untyped File
resources.
Whether file scanning should emit PythonResource::File
variants.
Set whether file scanning should emit PythonResource::File
variants.
Whether file scanning should classify files into PythonResource::*
variants.
Set whether file scanning should classify files into PythonResource::*
variants.
Whether to allow in-memory shared library loading.
Set the value for whether to allow in-memory shared library loading.
Get setting for whether to include source modules from the distribution.
Set whether we should include a Python distribution’s module source code.
Get setting for whether to include Python package resources from the distribution.
Set whether to include package resources from the Python distribution.
Whether to include Python sources for modules not in the standard library.
Set whether to include Python sources for modules not in the standard library.
Get setting for whether to include test files.
Set whether we should include Python modules that define tests.
Get whether to classify File
resources as include by default.
Set whether to classify File
resources as include by default.
Get whether to classify non-File
resources as include by default.
Set whether to classify non-File
resources as include by default.
Whether to write bytecode at optimization level 0.
Set whether to write bytecode at optimization level 0.
Whether to write bytecode at optimization level 1.
Set whether to write bytecode at optimization level 1.
Whether to write bytecode at optimization level 2.
Set whether to write bytecode at optimization level 2.
Set the resource handling mode of the policy.
This is a convenience function for mapping a ResourceHandlingMode
to corresponding field values.
Obtain broken extensions for a target triple.
Mark an extension as broken on a target platform, preventing it from being used.
Register a Python module as one that should not generate bytecode.
When source modules matching names registered with this function are added, their default settings for adding bytecode will always be false.
It is still possible to force bytecode generation by setting the add context fields to true or explicitly adding a bytecode resource.
pub fn derive_add_collection_context(
&self,
resource: &PythonResource<'_>
) -> PythonResourceAddCollectionContext
pub fn derive_add_collection_context(
&self,
resource: &PythonResource<'_>
) -> PythonResourceAddCollectionContext
Derive a PythonResourceAddCollectionContext
for a resource using current settings.
The returned object essentially says how the resource should be added
to a PythonResourceCollector
given this policy.
pub fn resolve_python_extension_modules<'a>(
&self,
extensions_variants: impl Iterator<Item = &'a PythonExtensionModuleVariants>,
target_triple: &str
) -> Result<Vec<PythonExtensionModule>>
pub fn resolve_python_extension_modules<'a>(
&self,
extensions_variants: impl Iterator<Item = &'a PythonExtensionModuleVariants>,
target_triple: &str
) -> Result<Vec<PythonExtensionModule>>
Resolve Python extension modules that are compliant with the policy.
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl RefUnwindSafe for PythonPackagingPolicy
impl Send for PythonPackagingPolicy
impl Sync for PythonPackagingPolicy
impl Unpin for PythonPackagingPolicy
impl UnwindSafe for PythonPackagingPolicy
Blanket Implementations
Mutably borrows from an owned value. Read more