Commit Graph

8166 Commits

Author SHA1 Message Date
konsti 20f468167a Log when response arrives (#17488)
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/
```
2026-01-15 17:23:50 +00:00
Zanie Blue 36b6315f72 Refactor CI plan job (#17478)
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>
2026-01-15 11:15:46 -06:00
Zanie Blue 73ad74c4d5 Improve error message for abi3 wheels on free-threaded Python (#17442)
Closes #17406 

Unlike https://github.com/astral-sh/uv/pull/17415, this returns a
dedicated error variant instead of adding a downstream special case to
handling of `Python` tag incompatibilities.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-15 10:58:10 -06:00
konsti 6db2c62906 Normalize test snapshots (#17486)
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
```
2026-01-15 17:50:10 +01:00
Zanie Blue 3eadf6c1c1 Remove redundant mkdocs insiders installs (#17477)
All of the features moved into the public mkdocs.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-15 10:25:55 -06:00
Zanie Blue 0920a0e8fb Lock to avoid concurrent refresh of pyx tokens (#17479)
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>
2026-01-15 10:24:05 -06:00
William Woodruff b3b15560c3 Test uv+PyPI Trusted Publishing on Gitlab (#17443) 2026-01-15 10:43:56 -05:00
konsti 157ac882be Use explicit manylinux/musllinux targets and better pre-upload checks (#17358)
This ensures that changes to the targets are intentional and explicit.

The target versions are from https://pypi.org/project/uv/0.9.22/#files

See also https://github.com/astral-sh/ty/pull/2393
2026-01-15 15:01:05 +01:00
Zanie Blue ba3a708160 Remove emojis from README (#17476)
Per our discussion when creating the ty README

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-15 07:23:25 -06:00
Zanie Blue 681e8e060f Improve cache initialization failure error message (#17469)
Adds an error chain to improve clarity when we fail to initialize the
cache directory.

Related to https://github.com/astral-sh/uv/issues/17465

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-15 07:23:10 -06:00
konsti ed50e40d05 Clear known env vars for tests (#14080)
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
2026-01-15 11:40:31 +01:00
Ben Beasley 47d3d0c6e1 Gate some tests added in 0.9.23 on the pypi feature (#17481)
<!--
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.
2026-01-15 11:40:18 +01:00
Luis Nell db7d1a2058 Add a hint to use a newer uv when a managed Python download is not found (#17461)
## 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>
2026-01-15 09:58:41 +00:00
github-actions[bot] 0c08cba0c4 Sync latest Python releases (#17480)
Automated update for Python releases.

Co-authored-by: jjhelmus <1050278+jjhelmus@users.noreply.github.com>
2026-01-15 04:21:14 +00:00
Charlie Marsh 677d80f8c9 Add support for GCS request signing (#17474)
## Summary

This follows the pattern we've already established for S3.
2026-01-14 15:47:53 -05:00
Zanie Blue 8eb42ff2c5 Install rustfmt in Claude Code for Web (#17475)
My post-edit hooks were failing because this was not installed.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 20:46:35 +00:00
Zanie Blue 41c96d43c9 Reduce the number of CI checks run on pull requests (#17471)
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.
2026-01-14 13:12:11 -06:00
Zanie Blue b1668eb2d8 Add timeouts to Docker build jobs (#17473)
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.
2026-01-14 18:55:57 +00:00
konsti 0ab603e035 Add METADATA.json and WHEEL.json in uv build backend (#15510)
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>
2026-01-14 18:52:09 +00:00
Zanie Blue 9ea3466aba Add linting and formatting instructions to the CONTRIBUTING guide (#17470)
I noticed these were missing.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 12:18:42 -06:00
Zanie Blue 0843c4d832 Avoid rendering pyproject.toml examples for more system-level settings (#17462)
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>
2026-01-14 12:18:35 -06:00
Zanie Blue a4327c21b4 Use a Depot runner for plan jobs (#17472)
This job is in the hot path for all other CI jobs, let's avoid letting
it be blocked by GitHub concurrency limits and such.
2026-01-14 18:14:43 +00:00
Zanie Blue b95b151cac Skip flaky test_simultaneous_independent_create_set on Windows (#17468)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-14 17:17:01 +00:00
Zanie Blue ae62c0d3f7 Install Clippy in Claude Code for Web (#17466)
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 16:23:06 +00:00
Zanie Blue 5a5bb69d2c Skip benchmarks when Rust code is unchanged (#17454)
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>
2026-01-14 15:44:55 +00:00
Zanie Blue 10c93553e0 Update the binary build workflow names to just show targets (#17453)
I found these really noisy with the default names which show the whole
matrix entry.
2026-01-14 07:36:09 -06:00
Zanie Blue 932d5de510 Use Rust cache in "Sync Python Downloads" (#17447)
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-14 07:35:57 -06:00
Zanie Blue e8f020754a Only save Rust cache on main or when cache-relevant files change (#17452)
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>
2026-01-14 07:35:45 -06:00
Zanie Blue 6efa51134d Reduce cache contention due to RUST_BACKTRACE environment variable (#17451)
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>
2026-01-14 07:35:25 -06:00
renovate[bot] f3add550af Update Rust crate h2 to v0.4.13 (#17458)
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>
2026-01-14 08:52:17 +00:00
Zanie Blue 9ab2b5fe5f Use ubuntu-slim for a subset of jobs (#17450)
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 17:16:31 -06:00
Zanie Blue 38fcac0f36 Bump version to 0.9.25 (#17449) 2026-01-13 16:55:34 -06:00
Zanie Blue 33c91159c6 Use keyring authentication when retrieving tool@latest version (#17448)
Closes #17436

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 16:31:06 -06:00
github-actions[bot] c6a02873fd Sync latest Python releases (#17445)
Automated update for Python releases.

Co-authored-by: zanieb <2586601+zanieb@users.noreply.github.com>
2026-01-13 22:01:12 +00:00
Zanie Blue 11d46df064 Update "Sync Python downloads" job to use Rust cache (#17446)
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 21:56:09 +00:00
Zanie Blue 3c72e56d92 Use constants for latest Python versions in tests (#17444)
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 21:36:45 +00:00
William Woodruff 6dfa0e3722 Abstract Trusted Publishing services (#17418) 2026-01-13 15:53:58 +00:00
Zanie Blue c43fb6103b Speedup walltime benchmarks by splitting build and run jobs (#17393)
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>
2026-01-13 09:49:07 -06:00
Zanie Blue f9ee1c2bf4 Add nextest partitioning to Windows tests (#17421)
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>
2026-01-13 09:20:06 -06:00
Diyor Khayrutdinov 4ee320b0a8 Fix error message when installing musl python on armv7 (#17213)
<!--
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>
2026-01-13 02:45:04 +00:00
Zanie Blue 98d17fc4d2 Fix another state bug in the uv auth tests (#17435)
This test was also order dependent; see also #17424

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 01:35:31 +00:00
Charlie Marsh 69333ead26 Avoid unwrapping size for file responses (#17434)
## Summary

This may have been an oversight? The field is optional on the struct.
2026-01-12 20:13:37 -05:00
Zanie Blue e9755bceb3 Report failing jobs when "all required jobs check" fails (#17433)
You can tell this by looking at the JSON input but that's not quite
friendly enough for me.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-13 01:09:18 +00:00
liam 827edd0740 Allow disabling exclude-newer per package (#16854)
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>
2026-01-12 19:00:07 -06:00
Zanie Blue 824706ca87 Move Windows registry test from test-system to test-integration (#17432)
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>
2026-01-13 00:49:45 +00:00
Gyeongjae Choi 7b497d48bd Use latest Pyodide version for each python version (#17372)
## 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)
```
2026-01-12 17:59:26 -06:00
Zanie Blue f1e5667d2f Add a Claude Code hook to install the gh CLI in web sessions (#17429) 2026-01-12 17:35:15 -06:00
Zanie Blue 7fa30ab278 Move release plan checks to a separate workflow (#17422)
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
2026-01-12 14:49:40 -06:00
Zanie Blue eca58cbae5 Fix incorrect test token_native_auth_realm (#17424)
The state was leaking in from another test case here.

Co-authored-by: Claude <noreply@anthropic.com>
2026-01-12 20:38:50 +00:00
Charlie Marsh 6d5e8031d3 Detect workspace from uv run target (#17423)
## 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.
2026-01-12 13:52:48 -06:00