Improve error message when version
is missing from pyproject.toml
#9910
Labels
error messages
Messaging when something goes wrong
The pyproject.toml spec says two fields under the
[project]
table are mandatory:name
andversion
(unlessversion
is declared as dynamic)If I run
uv sync
with apyproject.toml
that's missing thename
field:...then I get a concise error message like:
However, if instead the
version
field is missing, like so:...then I get a Python stack trace rather than a TOML validation error:
...which isn't as concise/readable as the
name
error message and comes across as though it's an unhandled internal error rather than being an intentional user facing error.This
pyproject.toml
doesn't have a[build-system]
section, so it seems as though uv shouldn't be getting setuptools to build it? (version
isn't declared as dynamic either, which is the only other reason I can think of why uv might be trying to build the project?)This was using:
The text was updated successfully, but these errors were encountered: