Skip to content

Commit

Permalink
Improve python source path normalization error message
Browse files Browse the repository at this point in the history
Closes #2363
  • Loading branch information
messense committed Dec 3, 2024
1 parent fffd863 commit cde210b
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/project_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,16 @@ impl ProjectResolver {
.unwrap_or_default()
.to_vec();
let py_root = match pyproject.and_then(|x| x.python_source()) {
Some(py_src) => project_root.join(py_src).normalize()?.into_path_buf(),
Some(py_src) => project_root
.join(py_src)
.normalize()
.with_context(|| {
format!(
"Failed to normalize python source path `{}`",
py_src.display()
)
})?
.into_path_buf(),
None => match pyproject.and_then(|x| x.project_name()) {
Some(project_name) => {
// Detect src layout
Expand Down

0 comments on commit cde210b

Please sign in to comment.