-
Notifications
You must be signed in to change notification settings - Fork 803
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 environment variable authentication for named indexes #7741
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
charliermarsh
force-pushed
the
charlie/index-api
branch
from
September 27, 2024 17:28
e331d72
to
2a8d89e
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
September 27, 2024 17:28
6a745ea
to
3c4c842
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
from
September 28, 2024 19:03
2a8d89e
to
e5c0b1e
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
September 28, 2024 19:03
3c4c842
to
cd3ae91
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
2 times, most recently
from
September 28, 2024 23:12
f5aa096
to
c2f8019
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
September 28, 2024 23:12
cd3ae91
to
e90683c
Compare
zanieb
reviewed
Sep 30, 2024
zanieb
approved these changes
Sep 30, 2024
charliermarsh
force-pushed
the
charlie/index-api
branch
3 times, most recently
from
September 30, 2024 21:20
1cab0d9
to
1ba4caa
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
September 30, 2024 21:21
e90683c
to
af08eb0
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
from
September 30, 2024 22:24
1ba4caa
to
256a17b
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
September 30, 2024 22:24
af08eb0
to
f1d41c4
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
from
October 1, 2024 00:48
256a17b
to
8f83605
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
October 1, 2024 00:48
f1d41c4
to
9ee37aa
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
from
October 1, 2024 00:52
8f83605
to
ae93ec8
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
October 1, 2024 00:52
9ee37aa
to
79cbf9f
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
from
October 1, 2024 21:22
ae93ec8
to
3bee6bf
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
October 1, 2024 21:22
79cbf9f
to
7f7dcad
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
2 times, most recently
from
October 2, 2024 00:46
6b44e69
to
23a6de0
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
October 2, 2024 01:08
7f7dcad
to
01177b4
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
from
October 3, 2024 18:08
23a6de0
to
f9ee2a9
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
October 3, 2024 18:08
01177b4
to
5dbcc9f
Compare
charliermarsh
force-pushed
the
charlie/index-api
branch
3 times, most recently
from
October 15, 2024 22:07
4b0e753
to
9e54908
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
October 15, 2024 22:26
5dbcc9f
to
cd67a04
Compare
charliermarsh
force-pushed
the
charlie/index-api-environment-vars
branch
from
October 15, 2024 22:27
cd67a04
to
6969269
Compare
charliermarsh
added a commit
that referenced
this pull request
Oct 17, 2024
The docs reference `UV_INDEX_`, but the code actually uses UV_HTTP_BASIC_ as the prefix for environment variable credentials. See PR #7741 Code is at https://github.com/astral-sh/uv/blob/main/crates/uv-static/src/env_vars.rs#L163 ```rust /// Generates the environment variable key for the HTTP Basic authentication username. pub fn http_basic_username(name: &str) -> String { format!("UV_HTTP_BASIC_{name}_USERNAME") } /// Generates the environment variable key for the HTTP Basic authentication password. pub fn http_basic_password(name: &str) -> String { format!("UV_HTTP_BASIC_{name}_PASSWORD") } ``` --------- Co-authored-by: Charlie Marsh <[email protected]>
tmeijn
pushed a commit
to tmeijn/dotfiles
that referenced
this pull request
Oct 18, 2024
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.4.22` -> `0.4.24` | 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.4.24`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0424) [Compare Source](astral-sh/uv@0.4.23...0.4.24) ##### Bug fixes - Fix Python executable name in Windows free-threaded Python distributions ([#​8310](astral-sh/uv#8310)) - Redact index credentials from lockfile sources ([#​8307](astral-sh/uv#8307)) - Respect `UV_INDEX_` rather than `UV_HTTP_BASIC_` as documented ([#​8306](astral-sh/uv#8306)) - Improve sources deserialization errors ([#​8308](astral-sh/uv#8308)) ##### Documentation - Correct pytorch-to-torch reference in docs ([#​8291](astral-sh/uv#8291)) ### [`v0.4.23`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0423) [Compare Source](astral-sh/uv@0.4.22...0.4.23) This release introduces a revamped system for defining package indexes, as an alternative to the existing pip-style `--index-url` and `--extra-index-url` configuration options. You can now define named indexes in your `pyproject.toml` file using the `[[tool.uv.index]]` table: ```toml [[tool.uv.index]] name = "pytorch" url = "https://download.pytorch.org/whl/cpu" ``` Packages can be pinned to a specific index via `tool.uv.sources`, to ensure that a given package is installed from the correct index. For example, to ensure that `torch` is *always* installed from the `pytorch` index: ```toml [tool.uv.sources] torch = { index = "pytorch" } [[tool.uv.index]] name = "pytorch" url = "https://download.pytorch.org/whl/cpu" ``` Indexes can also be marked as `explicit = true` to prevent packages from being installed from that index unless explicitly pinned. For example, to ensure that `torch` is installed from the `pytorch` index, but all other packages are installed from the default index: ```toml [tool.uv.sources] torch = { index = "pytorch" } [[tool.uv.index]] name = "pytorch" url = "https://download.pytorch.org/whl/cpu" explicit = true ``` To define an additional index outside a `pyproject.toml` file, use the `--index` command-line argument (or the `UV_INDEX` environment variable); to replace the default index (PyPI), use the `--default-index` command-line argument (or `UV_DEFAULT_INDEX`). These changes are entirely backwards-compatible with the deprecated `--index-url` and `--extra-index-url` options, which continue to work as before. See the [Index](https://docs.astral.sh/uv/configuration/indexes/) documentation for more. ##### Enhancements - Add index URLs when provided via `uv add --index` or `--default-index` ([#​7746](astral-sh/uv#7746)) - Add support for named and explicit indexes ([#​7481](astral-sh/uv#7481)) - Add templates for popular build backends ([#​7857](astral-sh/uv#7857)) - Allow multiple pinned indexes in `tool.uv.sources` ([#​7769](astral-sh/uv#7769)) - Allow users to incorporate Git tags into dynamic cache keys ([#​8259](astral-sh/uv#8259)) - Pin named indexes in `uv add` ([#​7747](astral-sh/uv#7747)) - Respect named `--index` and `--default-index` values in `tool.uv.sources` ([#​7910](astral-sh/uv#7910)) - Update to latest PubGrub version ([#​8245](astral-sh/uv#8245)) - Enable environment variable authentication for named indexes ([#​7741](astral-sh/uv#7741)) - Avoid showing lower-bound warning outside of explicit lock and sync ([#​8234](astral-sh/uv#8234)) - Improve logging during lock errors ([#​8258](astral-sh/uv#8258)) - Improve styling of `requires-python` warnings ([#​8240](astral-sh/uv#8240)) - Show hint in resolution failure on `Forbidden` (`403`) or `Unauthorized` (`401`) ([#​8264](astral-sh/uv#8264)) - Update to latest `cargo-dist` version (includes new installer features) ([#​8270](astral-sh/uv#8270)) - Warn when patch version in `requires-python` is implicitly `0` ([#​7959](astral-sh/uv#7959)) - Add more context on client errors during range requests ([#​8285](astral-sh/uv#8285)) ##### Bug fixes - Avoid writing duplicate index URLs with `--emit-index-url` ([#​8226](astral-sh/uv#8226)) - Fix error leading to out-of-bound panic in `uv-pep508` ([#​8282](astral-sh/uv#8282)) - Fix managed distributions of free-threaded Python on Windows ([#​8268](astral-sh/uv#8268)) - Fix selection of free-threaded interpreters during default Python discovery ([#​8239](astral-sh/uv#8239)) - Ignore sources in build requirements for non-source trees ([#​8235](astral-sh/uv#8235)) - Invalid cache when adding lower bound to lockfile ([#​8230](astral-sh/uv#8230)) - Respect index priority when storing credentials ([#​8256](astral-sh/uv#8256)) - Respect relative paths in `uv build` sources ([#​8237](astral-sh/uv#8237)) - Narrow what the pip3.<minor> logic drops from entry points. ([#​8273](astral-sh/uv#8273)) ##### Documentation - Add some additional notes to `--index-url` docs ([#​8267](astral-sh/uv#8267)) - Add upgrade note to README ([#​7937](astral-sh/uv#7937)) - Remove note that "only a single source may be defined for each dependency" ([#​8243](astral-sh/uv#8243)) </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=-->
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR enables users to provide index credentials via named environment variables.
For example, given an index named
internal
that requires a username (public
) and password(
koala
), you can define the index (without credentials) in yourpyproject.toml
:Then set the
UV_INDEX_INTERNAL_USERNAME
andUV_INDEX_INTERNAL_PASSWORD
environment variables, where
INTERNAL
is the uppercase version of the index name: