-
Notifications
You must be signed in to change notification settings - Fork 732
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
Make Python and PyPy install mirrors configurable in uv.toml #8695
base: main
Are you sure you want to change the base?
Conversation
crates/uv-python/src/installation.rs
Outdated
@@ -129,10 +130,20 @@ impl PythonInstallation { | |||
|
|||
let download = ManagedPythonDownload::from_request(&request)?; | |||
let client = client_builder.build(); | |||
let python_install_mirror = std::env::var(EnvVars::UV_PYTHON_INSTALL_MIRROR).ok(); | |||
let pypy_install_mirror = std::env::var(EnvVars::UV_PYPY_INSTALL_MIRROR).ok(); |
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.
Do we need to thread the values through here too?
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.
That would keep it consistent. Do we want the cli args? Looks like that fetch function ends up being called by quite a few commands.
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 don't think we want to add the CLI args everywhere. I'd propagate the settings to here instead.
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 guess we also have to resolve the settings with the environment variable at some point then?
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.
Adding to this. I worked on this a bit before this pr was made. I tried doing this a bit differently.
- I added the python and pypy install mirros to
GloablOptions
inuv-settings
- the env vars for the same were also added to
env
(vars not exposed as cli args) inside of theuv
crate. - the setting from uv.toml and the environment variables are combined in
GlobalSettings::resolve
- There were quite a few functions that had to be changed to include the mirrors as parameters.
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.
@zanieb -- Should these just be globals, like --allow-insecure-host
? (Do they even need to be exposed on the command-line at all?)
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 think it's reasonable to expose them in uv python install
, but I wouldn't expose them elsewhere.
9c84690
to
61c55fe
Compare
Not sure if this change has happened or will happen or once at all but I am all for it |
61617c7
to
6fabe9a
Compare
c5e52d4
to
4e5e9f6
Compare
4e5e9f6
to
b6e87e6
Compare
Config has been threaded through the other relevant commands. The CLI args take precedence over env vars which take precedence over config values. CLI args are present only for |
Summary
Adds python-install-mirror and pypy-install-mirror as keys for uv.toml, and cli args for
uv python install
.Could leave the cli args out if we think the env vars and configs are sufficient.
Fixes #8186