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>
Copies astral-sh/ruff#22126
We can use a larger _and_ less expensive runner for the build step.
Total runtime went from 18m -> 15m and most of that time is no longer on
the benchmark runner.
---------
Co-authored-by: Claude <noreply@anthropic.com>
Yet another attempt at #5714 to see if it improves CI times now that
Windows test times have increased
I think this is worth it now
```
main (1 shard): 13m 46s
branch (2 shards): 10m 31s
branch (3 shards): 7m 34s
```
total time (a.k.a., cost increase)
```
main (1 shard): 13m 46s
branch (2 shards): 20m 18s
branch (3 shards): 21m 32s
```
As in #875, we could explore moving the build step before the sharded
test runs. The build is 3m of the runtime, but I think artifact transfer
and runner startup time was too expensive last time and I don't expect
it to be faster. It might save a bit on CI cost, but I'm not super
worried about that.
I chose three shards due to a reasonable reduction in per-shard runtime
without a big increase in total runtime (compared to two shards). I
think since half of the shard runtime is fixed build time (vs reducable
test time), going up to more shards would be wasteful.
We use a hash-based strategy for test splitting, which means adding
tests will never move tests across shards.
I moved _off_ of the Depot runner because the "checkout" setup is taking
_way_ too long, about 120s more than the GitHub one which, once we split
over multiple shards, overcomes the speed benefits of the Depot runners.
The downsides here are:
1. Increased total CI time and therefore increased cost
2. GitHub runners are more expensive than Depot runners
3. Failing tests can be split across multiple shards, requiring more
GitHub UI navigation
(1) The runtime is unacceptably slow and I think the cost increase is
fairly marginal
(2) We can move back to Depot runners once they resolve the specific
performance issue
(3) Failing tests on Windows without failing tests on Linux are fairly
rare and should often be isolated to a single shard
---------
Co-authored-by: Claude <noreply@anthropic.com>
<!--
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
Fixes#17210.
## Test Plan
Added a test function.
Co-authored-by: Zanie Blue <contact@zanie.dev>
Resolves https://github.com/astral-sh/uv/issues/16846,
https://github.com/astral-sh/uv/issues/16813
This diff adds support for disabling `exclude-newer` for specific
packages using `<name>=false`. This allows packages
without upload dates (e.g., CPU-only PyTorch wheels from custom indices)
to be resolved when a global `exclude-newer` is set, without disabling
it globally.
---------
Co-authored-by: Zanie Blue <contact@zanie.dev>
The Windows registry test (PEP 514 integration) tests Python
installation registration functionality rather than system Python
detection like the other tests in test-system, so it fits better in
test-integration.
Co-authored-by: Claude <noreply@anthropic.com>
## Summary
This changes how the `download-metadata.json` file is generated for
Pyodide.
Previously, if we have a different Pyodide version with a same Python
version, the older Pyodide version is selected.
For example, say we have
- Pyodide 0.29.0 with Python 3.13.2
- Pyodide 0.28.3 with Python 3.13.2
then, pyodide 0.28.3 was stored in `download-metadata.json` as we
iterate in decending order with overwriting the value that was
previously written.
I fixed it by picking up the latest Pyodide version for each Python
version.
## Test Plan
Ran `uv run -- crates/uv-python/fetch-download-metadata.py` locally, and
verified the output:
```
2026-01-09 15:39:23 INFO Fetching Pyodide checksums: 0/4
2026-01-09 15:39:24 INFO Selected cpython-3.13.2-emscripten-wasm32-musl (0.29.1)
2026-01-09 15:39:24 INFO Selected cpython-3.12.7-emscripten-wasm32-musl (0.27.7)
2026-01-09 15:39:24 INFO Selected cpython-3.12.1-emscripten-wasm32-musl (0.26.4)
2026-01-09 15:39:24 INFO Selected cpython-3.11.3-emscripten-wasm32-musl (0.25.1)
```
We get a bunch of redundant skipped `Release / Build binary ...` jobs in
CI otherwise, and I would rather the release workflow didn't have a pull
request trigger at all.
Follows #17388
## Summary
Given `uv run foo/bar.py`, we now detect the workspace starting at
`foo/bar.py`, rather than the current working directory. I think this is
much more intuitive as demonstrated by the new test.
This change is currently in preview, but would ship as a breaking change
in v0.10.