-
Notifications
You must be signed in to change notification settings - Fork 615
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
Read persistent configuration from non-workspace pyproject.toml
#4526
Conversation
ee55ce9
to
3e0a146
Compare
// Read a `uv.toml` file in the current directory. | ||
let path = ancestor.join("uv.toml"); | ||
match fs_err::read_to_string(&path) { | ||
Ok(content) => { | ||
let options: Options = toml::from_str(&content) | ||
.map_err(|err| Error::UvToml(path.user_display().to_string(), err))?; | ||
|
||
debug!("Found workspace configuration at `{}`", path.display()); | ||
return Ok(Some(Self(options))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean to drop this? Does this happen elsewhere now somehow?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah this is in from_directory
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think this behavior makes sense, though it's annoying.
I'll add a test too. |
3e0a146
to
a90a309
Compare
a90a309
to
d0fbf82
Compare
Summary
If the user puts their configuration in a
pyproject.toml
that isn't a valid workspace root (e.g., it's a Poetry file), we won't discover it, because we only look inuv.toml
files in that case. I think this is somewhat debatable... We could choose to requireuv.toml
there, but as a user I'd probably expect it to work?Closes #4521.