## Summary
This test, added in 0.9.26, tries to download anyio from PyPI. This PR
therefore gates it on the `pypi` feature.
<!-- What's the purpose of the change? What does it do, and why? -->
## Test Plan
<!-- How was it tested? -->
Applied as a patch to the `uv` package in Fedora and built in an offline
environment.
## Summary
Addresses #16709. Now specifying a simple version with `--python` or
specifying a version using `--python-version` will result in the
specified version getting downloaded with a fallback to the previous
behaviour if the download fails for some transient reason or if
downloads are disabled.
The behaviour of how `--python` gets treated as `--python-version`, if a
"simple version" is specified, is kept. This means that `--python 3.7`
turns into a soft requirement. This seems at odds with how other similar
parts of UV work, but there seem to be quite a few tests which test for
this specific behaviour and I think this is best saved for a separate
issue.
## Test Plan
I added a test case which would previously fall back to the default
interpreter and warn about it.
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:
- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->
## Summary
This adds `-t` to `uv pip` to preserve drop-in compatibility with pip's
`-t` shortform
Closes#17495
<!-- What's the purpose of the change? What does it do, and why? -->
## Test Plan
Just interactively checked to make sure it works in the same places as
`--test`
```bash
uv pip install -t test ansible
uv pip list -t test
echo 'ansible' > requirements.txt
uv pip sync -t test requirements.txt
```
I needed this for a test, e.g., to disable a source for an extra build
dependency without disabling the source for a workspace member, and had
also seen some requests for it. I think it makes sense to allow this.
The refactor is fairly mechanical, we go from
`SourceStrategy::Enabled|Disabled` to
`NoSources::All|None|Package(names)` as we do for other options like
`NoBinary`.
Related https://github.com/astral-sh/uv/issues/17441
Looking at #17485, I noticed we don't log when a request finishes,
making the log harder to read than necessary.
Example new log message:
```
TRACE Received response for revalidation request with status 304 Not Modified for: https://pypi.org/simple/idna/
```
Aiming for more readability and maintainability here. Sort of limited by
bash and GitHub Actions, but I don't think it quite merits a change to
Python yet.
Co-authored-by: Claude <noreply@anthropic.com>
This reduces the churn when changing test snapshots, as insta updates
the quotes when the contents change. Instead, we decouple it by updating
the quotes in bulk here.
Created by:
```
cargo insta test --accept --force-update-snapshots
```
Prevent concurrent processes from all refreshing the token
simultaneously by using a file lock. When a refresh is needed:
1. Acquire an exclusive file lock (which will block if another process
is refreshing)
3. Re-read the tokens from disk and check if they are fresh enough,
instead of making another request
4. Otherwise, perform the refresh and update the cached tokens
This prevents thundering herd issues when multiple concurrent processes
are invoking `uv auth token` or `uv auth helper` at the same time.
Also, set the tolerance for `uv auth helper` to the same as `uv auth
token` (5 minutes).
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Zsolt Dollenstein <zsol.zsol@gmail.com>
Currently, it's possible to break our test suite by having an env var
set that influences uv, either a `UV_*` var, or something more generic
such as the XDG env vars. We previously fixed them env-var-by-env-var as
we discovered. By clearing uv-specific env var for subcommands, we can
invert this.
We intentionally avoid clearing all env vars as some of them, especially
on Windows, are system env vars required for basic operations.
Notable limitations are that this only affects tests that use
`TestContext::add_shared_env` (default, can be opted-out).
Fixed#9873
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:
- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->
## Summary
Makes it easier to run integration tests in offline environments by
gating four new tests on the `pypi` feature. All of these tests fail in
offline environments when they try to make HTTPS requests to PyPI.
<!-- What's the purpose of the change? What does it do, and why? -->
## Test Plan
<!-- How was it tested? -->
Applied as a patch to Fedora’s [`uv`
package](https://src.fedoraproject.org/rpms/uv); built and ran
integration tests in an offline environment.
## Summary
Suggest using a newer uv version when a managed python installation request
fails with `NoDownloadFound`.
Before:
```
error: No interpreter found for Python ==3.14.* in managed installations or search path
```
After:
```
error: No interpreter found for Python ==3.14.* in managed installations or search path
hint: uv embeds available Python downloads and may require an update to install new versions. Consider retrying on a newer version of uv.
```
## Test Plan
Integration test added for this case.
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
We're hitting GitHub concurrency limits (organization wide limit of 60
jobs), and while we could move to paid runners with high concurrency
limits, I'd prefer to stay on the free runners and some of these jobs,
e.g., `test-system`, require GitHub runners.
This moves a bunch of our extended testing behind a label, e.g.,
`test:extended` or `test:system`, and only runs them on `main` by
default.
These are hitting OIDC failures on Depot and run for 30m consuming a lot
of CI concurrency.
These timeouts are based on historical data retrieved by Claude.
https://discuss.python.org/t/pep-819-json-package-metadata/105558
Add an experimental JSON format for METADATA and WHEEL files in the uv
build backend to have a reference what it would look like and to
demonstrate that the actual change is just a few lines, how much easier
it is than the existing email header format.
The change is overwhelmingly adding the preview feature as it's the
first preview item in the build backend, writing the actual JSON is only
a couple of lines.
---------
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
Following #16918, mark additional system-level settings as
`uv_toml_only` so they don't appear in the `pyproject.toml`
documentation examples:
- `native-tls`
- `cache-dir`
- `python-install-mirror`
- `pypy-install-mirror`
- `python-downloads-json-url`
Eventually, we'll want to ban these in the `pyproject.toml` without some
opt-in.
Co-authored-by: Claude <noreply@anthropic.com>
Ignore that the file matching is a little redundant with other checks,
I'll consolidate those in a subsequent pull request.
Co-authored-by: Claude <noreply@anthropic.com>
The goal here is to reduce cache consumption and contention by avoiding
cache saves on pull requests unless the pull request makes a change that
requires a new cache entry.
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This is included in the Rust cache key hash because it is prefixed with
`RUST_` but has no affect on compilation. This invalidates caches that
could be shared across jobs.
---------
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| [h2](https://redirect.github.com/hyperium/h2) | workspace.dependencies
| patch | `0.4.12` → `0.4.13` |
---
### Release Notes
<details>
<summary>hyperium/h2 (h2)</summary>
###
[`v0.4.13`](https://redirect.github.com/hyperium/h2/blob/HEAD/CHANGELOG.md#0413-January-5-2026)
[Compare
Source](https://redirect.github.com/hyperium/h2/compare/v0.4.12...v0.4.13)
- Add support for 1xx informational responses on client and server side.
- Fix auto-releasing of padding bytes of DATA frames for flow control
windows.
- Fix to stop assigning capacity to pending streams which can't use it
yet.
- Fix tracing to not grab the parent for the connection span.
</details>
---
### Configuration
📅 **Schedule**: Branch creation - Between 12:00 AM and 03:59 AM, only on
Monday ( * 0-3 * * 1 ) (UTC), Automerge - At any time (no schedule
defined).
🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.
♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.
🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.
---
- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box
---
This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/astral-sh/uv).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi43NC41IiwidXBkYXRlZEluVmVyIjoiNDIuNzQuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiaW50ZXJuYWwiXX0=-->
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>