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

Make missing project table a tracing warning #5194

Merged
merged 1 commit into from
Jul 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 13 additions & 16 deletions crates/uv-distribution/src/workspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use std::path::{Path, PathBuf};
use either::Either;
use glob::{glob, GlobError, PatternError};
use rustc_hash::FxHashSet;
use tracing::{debug, trace};
use tracing::{debug, trace, warn};

use pep508_rs::{RequirementOrigin, VerbatimUrl};
use pypi_types::{Requirement, RequirementSource};
Expand Down Expand Up @@ -833,7 +833,7 @@ async fn find_workspace(
Ok(None)
} else {
// We require that a `project.toml` file either declares a workspace or a project.
warn_user!(
warn!(
"pyproject.toml does not contain `project` table: `{}`",
pyproject_path.simplified_display()
);
Expand Down Expand Up @@ -863,21 +863,19 @@ fn check_nested_workspaces(inner_workspace_root: &Path, stop_discovery_at: Optio
let contents = match fs_err::read_to_string(&pyproject_toml_path) {
Ok(contents) => contents,
Err(err) => {
warn_user!(
"Unreadable pyproject.toml `{}`: {}",
pyproject_toml_path.user_display(),
err
warn!(
"Unreadable pyproject.toml `{}`: {err}",
pyproject_toml_path.simplified_display()
);
return;
}
};
let pyproject_toml: PyProjectToml = match toml::from_str(&contents) {
Ok(contents) => contents,
Err(err) => {
warn_user!(
"Invalid pyproject.toml `{}`: {}",
pyproject_toml_path.user_display(),
err
warn!(
"Invalid pyproject.toml `{}`: {err}",
pyproject_toml_path.simplified_display()
Copy link
Member

Choose a reason for hiding this comment

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

Just wondering, why not user display?

);
return;
}
Expand All @@ -896,18 +894,17 @@ fn check_nested_workspaces(inner_workspace_root: &Path, stop_discovery_at: Optio
) {
Ok(contents) => contents,
Err(err) => {
warn_user!(
"Invalid pyproject.toml `{}`: {}",
pyproject_toml_path.user_display(),
err
warn!(
"Invalid pyproject.toml `{}`: {err}",
pyproject_toml_path.simplified_display()
);
return;
}
};
if !is_excluded {
warn_user!(
"Outer workspace including existing workspace, nested workspaces are not supported: `{}`",
pyproject_toml_path.user_display(),
"Nested workspaces are not supported, but outer workspace includes existing workspace: `{}`",
pyproject_toml_path.user_display().cyan(),
);
}
}
Expand Down
Loading