{"modulePath":"github.com/ActiveState/cli","version":"v0.0.0-20261102212658-cc320b4639f3","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package wheel\n\nPackage 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).\n\n## Variables\n\n```go\nvar (\n\t// ErrNoPythonFiles indicates the source tree has no .py files to pack.\n\tErrNoPythonFiles = errs.New(\"source tree contains no Python files\")\n\t// ErrNativeContent indicates the source tree contains compiled, platform-specific files.\n\tErrNativeContent = errs.New(\"source tree contains non-pure-Python (compiled) files\")\n\t// ErrMissingMetadata indicates the package name or version could not be determined.\n\tErrMissingMetadata = errs.New(\"package name and version are required\")\n)\n```\n\n## Functions\n\n```go\nfunc Pack(srcDir string, meta Metadata, outDir string) (string, error)\n```\nPack 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.\n\nThe 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.\n\nOutput is byte-reproducible: identical input trees produce identical wheels regardless of file timestamps. On any failure no wheel is left at the path.\n\n## Types\n\n```go\ntype Metadata struct {\n\tName    string\n\tVersion string\n\tSummary string\n\t// Requires holds PEP 508 requirement strings, recorded as Requires-Dist.\n\tRequires []string\n}\n```\nMetadata is the core package metadata recorded in the wheel. Empty fields fall back to pyproject.toml; non-empty fields override it.\n\n```go\nfunc ResolveMetadata(srcDir string, override Metadata) (*Metadata, error)\n```\nResolveMetadata reads srcDir's pyproject.toml \\[project] table and applies the non-empty fields of override on top, producing the metadata to pack with. It returns a \\*MissingMetadataError when neither source supplies a name or version. Requires always comes from pyproject.toml's dependencies.\n\n```go\ntype MissingMetadataError struct {\n\tFields []string\n\t// Pyproject is the pyproject.toml that was read, or empty when there is none.\n\tPyproject string\n\t// Dynamic holds the missing fields pyproject.toml lists in [project].dynamic,\n\t// which a build backend computes and so cannot be read from the file.\n\tDynamic []string\n}\n```\nMissingMetadataError reports which of name and version neither the caller nor pyproject.toml supplied, and what pyproject.toml said about them, so the user can be told how to provide them.\n\n```go\nfunc (e *MissingMetadataError) Error() string\n```\n\n```go\nfunc (e *MissingMetadataError) Is(target error) bool\n```\n\n","path":"github.com/ActiveState/cli/internal/python/wheel","name":"wheel","synopsis":"Package wheel builds spec-compliant, byte-reproducible pure-Python wheels from a local source tree.","isRedistributable":true}
