uv icon indicating copy to clipboard operation
uv copied to clipboard

`pyproject.toml` TOML parse error/warning shown twice

Open edmorley opened this issue 1 year ago • 2 comments

If pyproject.toml contains invalid TOML, eg:

[project]
name "testcase"
version = "0.0.0"
requires-python = ">=3.13"
dependencies = []

(Which is missing the = for the name field)

Then the resultant error message is duplicated - first as a warning then an error - rather than only being shown once:

$ uv sync
warning: Failed to parse `pyproject.toml` during settings discovery:
  TOML parse error at line 2, column 6
    |
  2 | name "testcase"
    |      ^
  expected `.`, `=`

error: Failed to parse: `pyproject.toml`
  Caused by: TOML parse error at line 2, column 6
  |
2 | name "testcase"
  |      ^
expected `.`, `=`

This is not high priority (and I imagine probably one of those awkward things to fix without refactoring a bunch), so feel free to wontfix if preferred.

$ uv --version
uv 0.5.9 (Homebrew 2024-12-13)

edmorley avatar Dec 15 '24 13:12 edmorley