File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11use std:: ops:: Deref ;
22use std:: path:: { Path , PathBuf } ;
33
4- use tracing:: { debug, warn } ;
4+ use tracing:: debug;
55
66use uv_fs:: Simplified ;
7- use uv_warnings:: owo_colors :: OwoColorize ;
7+ use uv_warnings:: warn_user ;
88
99pub use crate :: combine:: * ;
1010pub use crate :: settings:: * ;
@@ -74,7 +74,7 @@ impl FilesystemOptions {
7474 }
7575 Err ( Error :: PyprojectToml ( file, err) ) => {
7676 // If we see an invalid `pyproject.toml`, warn but continue.
77- warn ! (
77+ warn_user ! (
7878 "Failed to parse `{}` during settings discovery:\n {}" ,
7979 file. cyan( ) ,
8080 textwrap:: indent( & err. to_string( ) , " " )
@@ -107,7 +107,7 @@ impl FilesystemOptions {
107107 . and_then ( |content| toml:: from_str :: < PyProjectToml > ( & content) . ok ( ) )
108108 {
109109 if pyproject. tool . is_some_and ( |tool| tool. uv . is_some ( ) ) {
110- warn ! (
110+ warn_user ! (
111111 "Found both a `uv.toml` file and a `[tool.uv]` section in an adjacent `pyproject.toml`. The `[tool.uv]` section will be ignored in favor of the `uv.toml` file."
112112 ) ;
113113 }
Original file line number Diff line number Diff line change @@ -13005,6 +13005,13 @@ fn lock_duplicate_sources() -> Result<()> {
1300513005 ----- stdout -----
1300613006
1300713007 ----- stderr -----
13008+ warning: Failed to parse `pyproject.toml` during settings discovery:
13009+ TOML parse error at line 9, column 9
13010+ |
13011+ 9 | python-multipart = { url = "https://files.pythonhosted.org/packages/c0/3e/9fbfd74e7f5b54f653f7ca99d44ceb56e718846920162165061c4c22b71a/python_multipart-0.0.8-py3-none-any.whl" }
13012+ | ^
13013+ duplicate key `python-multipart` in table `tool.uv.sources`
13014+
1300813015 error: Failed to parse: `pyproject.toml`
1300913016 Caused by: TOML parse error at line 9, column 9
1301013017 |
Original file line number Diff line number Diff line change @@ -3285,6 +3285,15 @@ fn override_dependency_from_workspace_invalid_syntax() -> Result<()> {
32853285 ----- stdout -----
32863286
32873287 ----- stderr -----
3288+ warning: Failed to parse `pyproject.toml` during settings discovery:
3289+ TOML parse error at line 9, column 29
3290+ |
3291+ 9 | override-dependencies = [
3292+ | ^
3293+ no such comparison operator "=", must be one of ~= == != <= >= < > ===
3294+ werkzeug=2.3.0
3295+ ^^^^^^
3296+
32883297 error: Failed to parse: `pyproject.toml`
32893298 Caused by: TOML parse error at line 9, column 29
32903299 |
Original file line number Diff line number Diff line change @@ -92,6 +92,13 @@ fn invalid_pyproject_toml_syntax() -> Result<()> {
9292 ----- stdout -----
9393
9494 ----- stderr -----
95+ warning: Failed to parse `pyproject.toml` during settings discovery:
96+ TOML parse error at line 1, column 5
97+ |
98+ 1 | 123 - 456
99+ | ^
100+ expected `.`, `=`
101+
95102 error: Failed to parse: `pyproject.toml`
96103 Caused by: TOML parse error at line 1, column 5
97104 |
Original file line number Diff line number Diff line change @@ -2950,6 +2950,7 @@ fn resolve_both() -> anyhow::Result<()> {
29502950 }
29512951
29522952 ----- stderr -----
2953+ warning: Found both a `uv.toml` file and a `[tool.uv]` section in an adjacent `pyproject.toml`. The `[tool.uv]` section will be ignored in favor of the `uv.toml` file.
29532954 "###
29542955 ) ;
29552956
Original file line number Diff line number Diff line change @@ -495,6 +495,13 @@ fn create_venv_warns_user_on_requires_python_discovery_error() -> Result<()> {
495495 ----- stdout -----
496496
497497 ----- stderr -----
498+ warning: Failed to parse `pyproject.toml` during settings discovery:
499+ TOML parse error at line 1, column 9
500+ |
501+ 1 | invalid toml
502+ | ^
503+ expected `.`, `=`
504+
498505 warning: Failed to parse: `pyproject.toml`
499506 Using Python 3.12.[X] interpreter at: [PYTHON-3.12]
500507 Creating virtual environment at: .venv
You can’t perform that action at this time.
0 commit comments