friendly_dist_manager.package_formats.wheel.wheel_file module

Primitives for manipulating Python wheel files

class friendly_dist_manager.package_formats.wheel.wheel_file.WheelFile(dist_name, version)[source]

Bases: object

Abstraction around a Python wheel file

References

Parameters
  • dist_name (str) – name of the distribution package being built

  • version (str) – version number associated with the new distribution package

add_file(src_file, target_path)[source]

Adds a new file to the package

Parameters
  • src_file (pathlib.Path) – reference to the source file to be packaged

  • target_path (pathlib.Path) – location, relative to the root of the wheel file, where this new file should be deployed

build(output_path)[source]

Constructs a wheel file from the metadata stored in this class

Parameters

output_path (pathlib.Path) – folder where the wheel file should be generated

Returns

Reference to the newly generated wheel file

Return type

pathlib.Path

property filename

gets the fully qualified file name of the wheel file to be generated

Type

str

classmethod from_pyproject(pyproject_config)[source]

Factory method that instantiates an instance of this class from data stored in a pyproject.toml configuration file

Parameters

pyproject_config (PyProjectParser) – config file for a PEP518 compliant Python package

Returns

Instance of the class pre-initialized from data provided by the given config file

Return type

WheelFile

property metadata

properties describing this distribution package

Type

MetadataFile