Documentation
¶
Overview ¶
Package wheel builds spec-compliant, byte-reproducible pure-Python wheels from a local source tree. It only relocates and zips files; it never executes the source it packs (no setup.py, no PEP 517 backend, no subprocess of any kind).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoPythonFiles indicates the source tree has no .py files to pack. ErrNoPythonFiles = errs.New("source tree contains no Python files") // ErrNativeContent indicates the source tree contains compiled, platform-specific files. ErrNativeContent = errs.New("source tree contains non-pure-Python (compiled) files") // ErrMissingMetadata indicates the package name or version could not be determined. ErrMissingMetadata = errs.New("package name and version are required") )
Functions ¶
func Pack ¶
Pack builds a pure-Python wheel from the already-resolved meta (use ResolveMetadata to derive it from pyproject.toml), writes it into outDir as {normalized_name}-{version}-py3-none-any.whl, and returns the wheel path.
The wheel root mirrors srcDir: the caller points srcDir at the directory whose children are the importable packages. The top-level pyproject.toml, __pycache__ directories, *.pyc/*.pyo files, and version-control directories are not packed. Compiled files (.so/.pyd/.dll/.dylib) are rejected.
Output is byte-reproducible: identical input trees produce identical wheels regardless of file timestamps. On any failure no wheel is left at the path.
Types ¶
type Metadata ¶
Metadata is the core package metadata recorded in the wheel. Empty fields fall back to pyproject.toml; non-empty fields override it.
func ResolveMetadata ¶
ResolveMetadata reads srcDir's pyproject.toml [project] table and applies the non-empty fields of override on top, producing the metadata to pack with. It errors when neither source supplies a name or version.