Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide pyproject.toml path for parse errors in uv venv #10553

Merged
merged 1 commit into from
Jan 13, 2025

Conversation

charliermarsh
Copy link
Member

Summary

Closes #10522.

Test Plan

❯ cargo run venv
warning: Failed to parse `pyproject.toml` during environment creation:
  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

Using CPython 3.13.0
Creating virtual environment at: .venv
Activate with: source .venv/bin/activate

@charliermarsh charliermarsh requested a review from zanieb January 13, 2025 02:58
@charliermarsh charliermarsh added the error messages Messaging when something goes wrong label Jan 13, 2025
"Failed to parse `{}` during environment creation:\n{}",
path.user_display().cyan(),
textwrap::indent(&err.to_string(), " ")
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This matches the general style and structure of the comparable error we show in settings discovery:

"Failed to parse `{}` during settings discovery:\n{}",

@charliermarsh charliermarsh enabled auto-merge (squash) January 13, 2025 18:54
@charliermarsh charliermarsh merged commit 53d3d5e into main Jan 13, 2025
64 checks passed
@charliermarsh charliermarsh deleted the charlie/err branch January 13, 2025 19:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
error messages Messaging when something goes wrong
Projects
None yet
3 participants