Skip to content

[BUG] uv fails with "Metadata field Name not found" if it tries to use setuptools==80.9.0 #5099

@EternityForest

Description

@EternityForest

setuptools version

setuptools==80.9.0

Python version

3.11

OS

Raspberry Pi OS

Additional environment information

No response

Description

Title explains most of the issue. Deleting the cache for setuptools appears to resolve the issue, I'm not sure if this is
a setuptools issue, or a "UV reacting badly to low disk space and producing invalid cache entries" issue.

The original log causing the error, not reproducible in the future due to pointing at a mutable github:

 uv tool install --force --from git+https://github.com/EternityForest/KaithemAutomation kaithem
  × Failed to download and build `evdev==1.9.2`
  ├─▶ Failed to install requirements from `build-system.requires`
  ├─▶ Failed to install build dependencies
  ├─▶ Failed to install: setuptools-80.9.0-py3-none-any.whl (setuptools==80.9.0)
  ╰─▶ The wheel is invalid: Metadata field Name not found
  help: `evdev` (v1.9.2) was included because `kaithem` (v0.92.1) depends on `evdev`

This actually led me to notice evdev is no longer used and should be removed, and when I did, I got the same issue, but for recurrent instead, so it is not evdev specific, but it does appear to be specific to this one setuptools version.

It also appears to only happen on Raspberry Pi OS.

The wheel downloaded from PyPi appears to be correct, but UV seems to have a bunch of empty files in the cache.

pi@raspberrypi:~ $ ls -al .cache/uv/wheels-v5/pypi/setuptools/80.9.0-py3-none-any/setuptools-80.9.0.dist-info
total 12
drwxr-xr-x 3 pi pi 4096 Sep 23 16:36 .
drwxr-xr-x 6 pi pi 4096 Sep 23 16:36 ..
-rw-r--r-- 2 pi pi    0 Sep 23 16:36 entry_points.txt
drwxr-xr-x 2 pi pi 4096 Sep 23 16:36 licenses
-rw-r--r-- 2 pi pi    0 Sep 23 16:36 METADATA
-rw-r--r-- 1 pi pi    0 Sep 23 16:36 RECORD
-rw-r--r-- 2 pi pi    0 Sep 23 16:36 top_level.txt
-rw-r--r-- 2 pi pi    0 Sep 23 16:36 WHEEL

Expected behavior

UV should be able to correctly install things that depend on setuptools.

How to Reproduce

Quick reproduction by (mis)using uv tool:

pi@raspberrypi:~ $ uv tool install setuptools==80.9.0
Resolved 1 package in 3ms
error: Failed to install: setuptools-80.9.0-py3-none-any.whl (setuptools==80.9.0)
  Caused by: The wheel is invalid: Metadata field Name not found

Confirm working with other versions:

pi@raspberrypi:~ $ uv tool install setuptools==80.8.0
Resolved 1 package in 166ms
Prepared 1 package in 372ms
Installed 1 package in 10ms
 + setuptools==80.8.0
No executables are provided by package `setuptools`; removing tool
error: Failed to install entrypoints for `setuptools`

Confirm issue is UV specific:

# Create and activate a virtual env, then:

pi@raspberrypi:~ $     pip install setuptools==80.9.0
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting setuptools==80.9.0
  Using cached https://www.piwheels.org/simple/setuptools/setuptools-80.9.0-py3-none-any.whl (1.2 MB)
Installing collected packages: setuptools
  Attempting uninstall: setuptools
    Found existing installation: setuptools 66.1.1
    Uninstalling setuptools-66.1.1:
      Successfully uninstalled setuptools-66.1.1
Successfully installed setuptools-80.9.0

Output

Resolved 1 package in 3ms
error: Failed to install: setuptools-80.9.0-py3-none-any.whl (setuptools==80.9.0)
  Caused by: The wheel is invalid: Metadata field Name not found

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs TriageIssues that need to be evaluated for severity and status.bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions