Skip to content

[Bug]: uv extension crashes on wheels without hash digests from private registries #790

@roundhd

Description

@roundhd

What happened?

The uv extension in uv/private/extension.bzl unconditionally accesses whl["hash"] in _whl_repo_name and _raw_whl_repos. When wheels come from private registries (e.g., Azure Artifacts, Artifactory) that don't serve PEP 503 hash fragments, the "hash" key is missing from the lock entry, causing a KeyError.

Version

aspect_rules_py 1.8.4

How to reproduce

Use a uv.lock that includes packages from a private PyPI registry that doesn't include hash fragments in download URLs.

Proposed fix

  • _whl_repo_name: Fall back to sha1(whl["url"])[:8] when "hash" key is missing
  • _raw_whl_repos: Use empty string for shasum when "hash" key is missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions