Load configuration options from workspace root (#4295)

## Summary

In a workspace, we now read configuration from the workspace root.
Previously, we read configuration from the first `pyproject.toml` or
`uv.toml` file in path -- but in a workspace, that would often be the
_project_ rather than the workspace configuration.

We need to read configuration from the workspace root, rather than its
members, because we lock the workspace globally, so all configuration
applies to the workspace globally.

As part of this change, the `uv-workspace` crate has been renamed to
`uv-settings` and its purpose has been narrowed significantly (it no
longer discovers a workspace; instead, it just reads the settings from a
directory).

If a user has a `uv.toml` in their directory or in a parent directory
but is _not_ in a workspace, we will still respect that use-case as
before.

Closes #4249.
This commit is contained in:
Charlie Marsh 2024-06-13 18:26:20 -07:00 committed by GitHub
parent e0a389032f
commit cacd1a2b5a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 338 additions and 357 deletions

View file

@ -6,7 +6,7 @@ use pretty_assertions::StrComparison;
use schemars::{schema_for, JsonSchema};
use serde::Deserialize;
use uv_workspace::Options;
use uv_settings::Options;
use crate::ROOT_DIR;