Skip to content

uv venv "Failed to parse: pyproject.toml" warning without the root cause + why the project version in pyproject.toml #10522

@pabepadu

Description

@pabepadu

Hi, first uv is a really great tool, thanks!

I'm using version 0.5.18 and I found two issues with this pyproject.toml:

[project]
name = "dummy-name"
requires-python = ">=3.12, <3.13"
  1. uv venv returns no explanation why as to why it could not parse the pyproject.toml (same with verbose mode):

    $ uv venv
    warning: Failed to parse: `pyproject.toml`
    Using CPython 3.13.1
    Creating virtual environment at: .venv
    Activate with: source .venv/Scripts/activate

    And in this case the wrong version of python is selected.

    By luck I found the root cause with another command:

    $ uv tree
    error: Failed to parse: `pyproject.toml`
      Caused by: TOML parse error at line 1, column 1
      |
    1 | [project]
      | ^^^^^^^^^^
    `pyproject.toml` is using the `[project]` table, but the required `project.version` field is neither set nor present in the `project.dynamic` list

    Is it possible to improve the warning message with the root cause or change the warning to an error like in uv tree ?

  2. Why a project version is mandatory to be able to parse the pyproject.toml ?
    In this case I don't expect to publish the project, so the version is meaningless

Thanks in advance

Metadata

Metadata

Assignees

Labels

error messagesMessaging when something goes wrong

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions