-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Provide system-level configuration files #6742
Comments
This comment was marked as resolved.
This comment was marked as resolved.
This makes sense to me. |
Is there an obvious home for this, e.g., following XDG? |
I think a top-level file ( |
Actually... I take that back. Looking at what platformdirs does today... XDG is an obvious home for this. https://github.com/platformdirs/platformdirs/blob/4.2.2/src/platformdirs/unix.py#L79-L83 So... the location would be |
I honestly believe that system-level configuration is an anti-pattern (but common!), and if I were prioritising I would say that executable-level configuration is actually more useful for shared machines. To clarify my meaning: executable-level / prefix config is config that lives in the prefix root of the executable being run. So if I have my By extension, if I have my uv in My rationale for making the opening statement ("executable-level configuration is actually more useful for shared machines") is that if a sys admin is providing On the contrary, if a sys admin wants to provide multiple versions of As a final remark, if |
Hi folks! Is there anything I can do to help move this forward? Would a PR adding support be the best way forward here or are there any higher level concerns around implementing this? |
I think I'm fine with this (\cc @zanieb in case you disagree), in which case a PR adding support would be the best path forward! |
I can also do it @pradyunsg if you haven't started on it yet. |
I'm fine with this if we have a clear standard we can follow regarding the location. I don't really know what to do about toggling this behavior based on where the uv binary is. That seems quite complicated, though I share your concerns about the configuration not being valid for your version. Are we going to have a separate way to opt-out of this? e.g. |
This should be the same way pip does it. I manage a fleet of systems and we configure all of then by creating an |
Are you objecting to something specific? We have an open PR (#7851) that supports |
Yeah I just literally saw the PR. It does solve this problem 💪 That would allow for easy configuration via |
## Summary Look for a system level uv.toml config file under `/etc/uv/uv.toml` or `C:\ProgramData`. This PR is to address #6742 and start a conversation. ## Test Plan This was tested locally manually on MacOS. I am happy to contribute tests once we settle on the approach. cc @thatch --------- Co-authored-by: Charlie Marsh <[email protected]>
Given that #7851 has landed, I guess we should close this out? Or do the maintainers wanna wait until they've cut a release with this. 😅 |
Yes thank you! |
What
This is an ask for a "Global" layer of configuration to be provided, living in
/etc
. Unlike pip, I think uv should have only one file under that hierarchy.Why
This would enable system administrators of shared machines to configure uv to use the correct index-url and link-mode without needing to affect the runtime shell environments used by developers.
My specific use case is for being able to configure the index-url to point to the internal index on shared machines, which helps reduce workflow friction for newcomers which in turn reduces the number of users using workarounds to hit the "wrong" package indexes.
For context, this is the current configuration I've got for pip with the URLs redacted:
How
uv already has logic for handling merging of project-level and user-level configuration. This would add another layer to that configuration merging -- with the preference order being project overrides user (current) which in turn overrides global.
The text was updated successfully, but these errors were encountered: