-
Notifications
You must be signed in to change notification settings - Fork 856
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
Enable global configuration files #3049
Conversation
@@ -75,6 +75,7 @@ dashmap = { version = "5.5.3" } | |||
data-encoding = { version = "2.5.0" } | |||
derivative = { version = "2.2.0" } | |||
directories = { version = "5.0.1" } | |||
dirs-sys = { version = "0.4.1" } |
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.
This is already a dependency because it powers directories
under-the-hood, but exposes the low-level methods we need to use the custom XDG behavior.
31a5129
to
9d7a449
Compare
3e8f657
to
9fcddd4
Compare
9d7a449
to
d359ea8
Compare
crates/uv-workspace/src/workspace.rs
Outdated
/// Load the global [`Workspace`]. | ||
pub fn global() -> Result<Option<Self>, WorkspaceError> { |
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.
Can we call this "user" instead? It's not the "global" or "system" workspace, it sounds like it should always be scoped to a user e.g. XDG_CONFIG_HOME
is for user-specific configuration.
@@ -38,6 +51,27 @@ impl Workspace { | |||
} | |||
} | |||
|
|||
/// Returns the path to the global configuration directory. | |||
/// | |||
/// This is similar to the `config_dir()` returned by the `dirs` crate, but it uses the |
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.
I'm somewhat hesitant to diverge from the rust standard of using dirs
here, can we file an upstream issue and link to the github discussion for this?
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.
You should chime in here: astral-sh/ruff#10739
9fcddd4
to
84e48b3
Compare
d359ea8
to
986b745
Compare
84e48b3
to
50fa1a7
Compare
986b745
to
17b6acb
Compare
50fa1a7
to
c859405
Compare
17b6acb
to
ba0f96e
Compare
c859405
to
53ff358
Compare
ba0f96e
to
fd76507
Compare
53ff358
to
082c731
Compare
fd76507
to
a04df02
Compare
082c731
to
0395946
Compare
a04df02
to
78691ee
Compare
0395946
to
6776a14
Compare
78691ee
to
d510125
Compare
Summary
Enables
uv
to read configuration from (e.g.)/Users/crmarsh/.config/uv/uv.toml
on macOS and Linux, andC:\Users\Charlie\AppData\Roaming\uv\uv.toml
on Windows.This differs slightly from Ruff, which uses the
Application Support
directory on macOS. But I've deviated here. based on the preferences expressed in astral-sh/ruff#10739.