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.

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.

Resolve Python extension modules that are compliant with the policy.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

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

recently added

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.