Open-Source Wikis

/

uv

/

Crates

/

uv-normalize

astral-sh/uv

uv-normalize

crates/uv-normalize/ defines PackageName, ExtraName, GroupName, DefaultGroups, and the normalization functions that PEP 503 and PEP 685 require.

Purpose

Package and extra names need to be normalized (Foo_Barfoo-bar) before comparison. Doing this in one crate guarantees that every == everywhere agrees on equality.

Key abstractions

  • PackageName — a normalized package name (smart pointer over Box<str>).
  • ExtraName — a normalized extra name.
  • GroupName — a dependency-group name.
  • InvalidNameError — produced when the input violates PEP 503 / PEP 685.
  • DefaultGroups — the typed [tool.uv.default-groups] value.

The types hash and compare by their normalized form but Display preserves the input casing when we want to echo it back to the user.

See also

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

uv-normalize – uv wiki | Factory