Skip to content

Better error message for invalid [project] table #6419

@soof-golan

Description

@soof-golan

Hey Astral team!

I found an interesting behavior around installing a git based project that is managed by poetry (as opposed to any other build system).
Since the name of the project is defined under the tool.poetry section uv fails to pick it up when reading the pyproject.toml file.
I'm not sure if this is considered Poetry's fault, but pip definitely succeeds in installing this exact package. I have not checked whether this issue can be also replicated locally with a relative path package.

Many thanks 🙏

What Happens

uv fails to install a (seemingly) valid python dependency. pip successfully installs this project.

Expected Behavior

uv should install the package

Reproduction

cd $(mktemp -d)
uv venv
uv pip install -v git+https://github.com/elevenlabs/elevenlabs-python.git@6db2fdd7458ce5c7f1bbdc2c3936784f995acd44

outputs:

Using Python 3.12.5
Creating virtualenv at: .venv
Activate with: source .venv/bin/activate
DEBUG uv 0.3.1
DEBUG Searching for Python interpreter in system path
DEBUG Found `cpython-3.12.5-macos-aarch64-none` at `/private/var/folders/f0/m68x433x79n628trx7zp0x3h0000gn/T/tmp.BZTiKhI3Af/.venv/bin/python3` (virtual environment)
DEBUG Using Python 3.12.5 environment at .venv/bin/python3
DEBUG Acquired lock for `.venv`
DEBUG At least one requirement is not satisfied: git+https://github.com/elevenlabs/elevenlabs-python.git@6db2fdd7458ce5c7f1bbdc2c3936784f995acd44
DEBUG Using request timeout of 30s
DEBUG Fetching source distribution from Git: https://github.com/elevenlabs/elevenlabs-python.git
DEBUG Acquired lock for `https://github.com/elevenlabs/elevenlabs-python`
DEBUG Using existing git source `Url { scheme: "https", cannot_be_a_base: false, username: "", password: None, host: Some(Domain("github.com")), port: None, path: "/elevenlabs/elevenlabs-python.git", query: None, fragment: None }`
DEBUG Acquired lock for `/Users/soof/Library/Caches/uv/built-wheels-v3/git/8be1b43a58e07c63/6db2fdd7458ce5c7`
DEBUG No static `PKG-INFO` available for: git+https://github.com/elevenlabs/elevenlabs-python.git@6db2fdd7458ce5c7f1bbdc2c3936784f995acd44 (MissingPkgInfo)
error: Failed to extract static metadata from `pyproject.toml`
  Caused by: TOML parse error at line 31, column 2
   |
31 | [project.urls]
   |  ^^^^^^^
missing field `name`
image

uv --version

uv 0.3.1 (be17d132a 2024-08-21)

Platform

macOS Sonoma

Metadata

Metadata

Assignees

No one assigned

    Labels

    error messagesMessaging when something goes wrongexternalThe problem is with another package or dependency (not uv)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions