-
Notifications
You must be signed in to change notification settings - Fork 772
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
Add support for configuring python-downloads
with UV_PYTHON_DOWNLOADS
#6436
Conversation
UV_PYTHON_DOWNLOADS
to be configured via environment variablepython-downloads with
UV_PYTHON_DOWNLOADS`
python-downloads with
UV_PYTHON_DOWNLOADS`python-downloads
with UV_PYTHON_DOWNLOADS
@@ -120,11 +120,13 @@ pub struct GlobalArgs { | |||
)] | |||
pub python_preference: Option<PythonPreference>, | |||
|
|||
/// Allow automatically downloading Python when required. | |||
#[allow(clippy::doc_markdown)] | |||
/// Allow automatically downloading Python when required. [env: "UV_PYTHON_DOWNLOADS=auto"] |
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.
Copying Clap's format here, but the value is fixed.
python_downloads: flag(args.allow_python_downloads, args.no_python_downloads) | ||
.map(PythonDownloads::from) | ||
.combine(env(env::UV_PYTHON_DOWNLOADS)) | ||
.combine(workspace.and_then(|workspace| workspace.globals.python_downloads)) | ||
.unwrap_or_default(), |
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.
Precedence goes CLI -> ENV -> CONFIG -> DEFAULT
cc @blueraft — sorry there's a little bit of nuance to this option. |
c1738e3
to
b571808
Compare
All good ❤️ |
cd6e29e
to
b35b9a6
Compare
b571808
to
49556fe
Compare
49556fe
to
a5a33fb
Compare
docs/reference/cli.md
Outdated
@@ -406,7 +406,7 @@ uv init [OPTIONS] [PATH] | |||
|
|||
<p>For example, spinners or progress bars.</p> | |||
|
|||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python</p> | |||
</dd><dt><code>--no-python-downloads</code></dt><dd><p>Disable automatic downloads of Python. [env: "UV<em>PYTHON</em>DOWNLOADS=never"]</p> |
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 this doesn't show for any other options.
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.
Eek, yeah. Ugh. Will figure out a solution...
a5a33fb
to
999ec14
Compare
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.3.1` -> `0.3.2` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (astral-sh/uv)</summary> ### [`v0.3.2`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#032) [Compare Source](astral-sh/uv@0.3.1...0.3.2) ##### Configuration - Add support for configuring `python-downloads` with `UV_PYTHON_DOWNLOADS` ([#​6436](astral-sh/uv#6436)) - Add support for configuring the `python-preference` with `UV_PYTHON_PREFERENCE` ([#​6432](astral-sh/uv#6432)) - Deny invalid members in workspace schema ([#​6450](astral-sh/uv#6450)) ##### Performance - Stop streaming wheels when `METADATA` is discovered (if range requests aren't supported) ([#​6470](astral-sh/uv#6470)) ##### Bug fixes - Remove URI type from JSON Schema ([#​6449](astral-sh/uv#6449)) - Fix retrieval of credentials for URLs from cache ([#​6452](astral-sh/uv#6452)) - Restore `cache` suffix on Windows cache path ([#​6482](astral-sh/uv#6482)) - Treat `.pyw` files as scripts in `uv run` on Windows ([#​6453](astral-sh/uv#6453)) - Treat invalid extras as `false` in marker evaluation ([#​6395](astral-sh/uv#6395)) - Avoid overwriting symlinks in `pip compile` output ([#​6487](astral-sh/uv#6487)) ##### Documentation - Add `uv run` hint to the `uvx` guide ([#​6454](astral-sh/uv#6454)) - Add a guide for using uv with FastAPI ([#​6401](astral-sh/uv#6401)) - Add tip for using `managed = false` to disable project management ([#​6465](astral-sh/uv#6465)) - Clarify the `uv tool run`, `uvx`, and `uv run` relationships ([#​6455](astral-sh/uv#6455)) - Fix references to `--python-downloads` (it is `--no-python-downloads`) ([#​6439](astral-sh/uv#6439)) - Further clarifications to the tools documentation ([#​6474](astral-sh/uv#6474)) - Update docs dockerfile (bullseye -> bookworm) ([#​6441](astral-sh/uv#6441)) - Update the installation documentation page ([#​6468](astral-sh/uv#6468)) - Update pip compatibility pages to mention configuration files support ([#​6410](astral-sh/uv#6410)) - Add `uv run` docs for gui scripts ([#​6478](astral-sh/uv#6478)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Part of #6406
Replaces #6416