Skip to content

Default prune-cache: true causes unnecessary PyPI downloads for pre-built wheels #745

@ei-grad

Description

@ei-grad

Summary

The default prune-cache: true removes pre-built wheels from cache, causing them to be re-downloaded from PyPI on every CI run. This generates unnecessary load on PyPI infrastructure.

What gets pruned vs retained

Cache content Pruned? Effect
sdists ❌ Retained No re-download
Locally-built wheels ❌ Retained No rebuild
Pre-built wheels ✅ Pruned Re-downloaded every run

Most popular packages (numpy, pandas, requests, etc.) distribute pre-built wheels and are affected.

Evidence

Reproduction: https://github.com/ei-grad/uv-cache-issue

Pre-built wheels re-downloaded despite cache hit

Second run, prune-cache: truejob log:

Cache hit for: setup-uv-1-...-with-prune
Cache Size: ~434 MB

Downloading numpy (15.8MiB)
Downloading pandas (10.4MiB)

Locally-built wheels served from cache

First runrun 21582159578:

Building pyspark==4.1.1
Built pyspark==4.1.1

Second runjob log:

 + pyspark==4.1.1

No rebuild — locally-built wheel served from cache.

With prune-cache: false — no PyPI downloads

Job log:

Cache hit for: setup-uv-1-...-without-prune
Cache Size: ~1758 MB

Installed 15 packages in 74ms

Impact

Given setup-uv's popularity, the default causes significant unnecessary traffic to PyPI across thousands of CI pipelines.

Suggestion

Not sure I have a good solution. Maybe it would help to make prune-cache keep wheels?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions