Skip to content

Conversation

@charliermarsh
Copy link
Member

Summary

Closes #16582.

@charliermarsh charliermarsh marked this pull request as ready for review December 3, 2025 14:50
@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Dec 3, 2025
@charliermarsh charliermarsh requested a review from konstin December 3, 2025 14:50
@charliermarsh
Copy link
Member Author

It looks like missing_editable_file regressed a bit.

@charliermarsh charliermarsh marked this pull request as draft December 3, 2025 15:02
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 3, 2025

CodSpeed Performance Report

Merging #16967 will not alter performance

Comparing charlie/err (2688a12) with main (2abe56a)

Summary

✅ 5 untouched

@charliermarsh charliermarsh marked this pull request as ready for review December 4, 2025 01:15
let verbatim = VerbatimUrl::from_path(&path, &working_dir)?;
let verbatim_path = verbatim.as_path()?;
let is_dir = if let Ok(metadata) = verbatim_path.metadata() {
metadata.is_dir()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates an unintuitive error message downstream: If I have a directory my.project.whl and

-e my.project.whl

I get:

$ uv  pip install -r requirements.txt
error: The wheel filename "my.project.whl" is invalid: Must have a version

If I use a valid wheel filename as the directory name, it accepts it, build the directory, but expects the output to conform to the wheel filename:

-e my_project-0.1-py3-none-any.whl

my_project-0.1-py3-none-any.whl/pyproject.toml:

[project]
name = "foo"
version = "0.1.0"
$ uv pip install -r requirements.txt 
  × Failed to build `my-project @ file:///home/konsti/projects/uv/debug/my_project-0.1-py3-none-any.whl`
  ╰─▶ Package metadata name `foo` does not match given name `my-project`

I could see that kind of directory name be created by using some unzipping tool on a wheel.

On a sidenote, it only checks the package name, while ignoring version mismatches, so the following installs successfully:

[project]
name = "my_project"
version = "1.2.3"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

error messages Messaging when something goes wrong

Projects

None yet

Development

Successfully merging this pull request may close these issues.

poor error message with uv add -r on a requirements.txt with a -e entry that has a bad path

3 participants