mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-29 03:02:55 +00:00
Search beyond workspace root when discovering configuration (#5931)
## Summary Previously, we wouldn't respect configuration files in directories _above_ a workspace root. But this is somewhat problematic, because any `pyproject.toml` will define a workspace root... Instead, I think we should _start_ the search at the workspace root, but go above it if necessary. Closes: #5929. See: https://github.com/astral-sh/uv/pull/4295.
This commit is contained in:
parent
cbc3274848
commit
88ece8b791
4 changed files with 284 additions and 10 deletions
|
|
@ -40,9 +40,12 @@ impl FilesystemOptions {
|
|||
let root = dir.join("uv");
|
||||
let file = root.join("uv.toml");
|
||||
|
||||
debug!("Loading user configuration from: `{}`", file.display());
|
||||
debug!("Searching for user configuration in: `{}`", file.display());
|
||||
match read_file(&file) {
|
||||
Ok(options) => Ok(Some(Self(options))),
|
||||
Ok(options) => {
|
||||
debug!("Found user configuration in: `{}`", file.display());
|
||||
Ok(Some(Self(options)))
|
||||
}
|
||||
Err(Error::Io(err)) if err.kind() == std::io::ErrorKind::NotFound => Ok(None),
|
||||
Err(_) if !dir.is_dir() => {
|
||||
// Ex) `XDG_CONFIG_HOME=/dev/null`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue