Open-Source Wikis

/

uv

/

Crates

/

uv-distribution-filename

astral-sh/uv

uv-distribution-filename

crates/uv-distribution-filename/ parses wheel and source-distribution filenames.

Purpose

PyPA filenames carry a lot of information: package name, version, Python tag, ABI tag, platform tag, build tag, optional source extension. uv parses them in many places — index ingestion, lockfile reading, install planning. Putting the parsing in its own crate keeps it fast and keeps the consumers decoupled from the rest of the distribution model.

Key abstractions

  • WheelFilename{name}-{version}-{python_tag}-{abi_tag}-{platform_tag}.whl.
  • SourceDistFilename{name}-{version}{ext}.
  • SourceDistExtension.tar.gz, .zip, .tar.bz2, .tar.xz, .tar.zst, .zip.zst.
  • DistFilename — sum of the two.

How it works

The parser is deliberately strict: filenames that don't conform are rejected, so an upstream index that serves malformed filenames produces a clear error rather than a confusing downstream parse failure.

See also

Built by Factory AutoWiki from public repository content. It is a generated preview for codebase exploration, not source-maintained documentation.

uv-distribution-filename – uv wiki | Factory