astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
20.02k stars 594 forks source link

uv run fails if project table is missing #6838

Closed jooon closed 17 hours ago

jooon commented 2 weeks ago

I often interact with repositories with python code that has a pyproject.toml for tool configuration only. Unlike https://github.com/astral-sh/uv/issues/6419, I can't really tell if this is compliant or not, but it became common when black was released. It was one of the first really popular tools that required configuration to be in pyproject.toml.

Steps to reproduce.

$ uv --version
uv 0.4.0
$ mkdir /tmp/test-pyproject
$ cd /tmp/test-pyproject
$ touch pyproject.toml
$ uv run python
error: No `project` table found in: `/tmp/test-pyproject/pyproject.toml`
charliermarsh commented 2 weeks ago

I think we're unlikely to support projects with a name. It just simplifies a lot of things and enables us to have better error messages, etc. We should give a better error message here though!

charliermarsh commented 17 hours ago

I think #7399 is sufficient to close; we have a dedicated error now!