wheel

package
v0.0.0-...-800c319 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2026 License: BSD-3-Clause Imports: 18 Imported by: 0

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

View Source
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

func Pack(srcDir string, meta Metadata, outDir string) (string, error)

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

type Metadata struct {
	Name    string
	Version string
	Summary string
}

Metadata is the core package metadata recorded in the wheel. Empty fields fall back to pyproject.toml; non-empty fields override it.

func ResolveMetadata

func ResolveMetadata(srcDir string, override Metadata) (*Metadata, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL