Commit Graph

6314 Commits

Author SHA1 Message Date
Charlie Marsh 7b6a5159f1 Make resolver dependency edges source-aware across forks (#18435)
## Summary

This is a non-behavior-changing refactor that puts direct source
information on individual `PubGrubDependency` edges. The resulting code
is, in my opinion, a bit simpler with clearer abstractions and more
consistent handling.
2026-03-16 08:19:00 -04:00
Charlie Marsh 99de5322c5 Enforce available distributions for supported environments (#18451)
## Summary

A revival of https://github.com/astral-sh/uv/pull/17118. We now enforce
that builds are available for all supported environments in addition to
required environments.

Closes https://github.com/astral-sh/uv/issues/17067.

Closes https://github.com/astral-sh/uv/issues/17060.
2026-03-16 07:56:21 -04:00
Zsolt Dollenstein 5606d963fc Fetch Ruff release metadata from an Astral mirror (#18358) 2026-03-16 10:50:39 +00:00
konsti 5f77df89fb Improve distribution id performance (#18486)
Improve the performance for https://github.com/astral-sh/uv/pull/18373.

```
$ hyperfine --warmup 3 --runs 30 \
    '/tmp/uv-0-baseline lock --project /home/konsti/projects/airflow' \
    '/tmp/uv-1-or-insert-with lock --project /home/konsti/projects/airflow' \
    '/tmp/uv-2-single-lookup lock --project /home/konsti/projects/airflow' \

Benchmark 1: /tmp/uv-0-baseline lock --project /home/konsti/projects/airflow
Time (mean ± σ):     147.1 ms ±  10.1 ms    [User: 108.4 ms, System: 23.6 ms]
Range (min … max):   130.5 ms … 165.9 ms    30 runs

Benchmark 2: /tmp/uv-1-or-insert-with lock --project /home/konsti/projects/airflow
Time (mean ± σ):     141.3 ms ±   7.3 ms    [User: 106.3 ms, System: 21.3 ms]
Range (min … max):   131.5 ms … 160.6 ms    30 runs

Benchmark 3: /tmp/uv-2-single-lookup lock --project /home/konsti/projects/airflow
Time (mean ± σ):     139.6 ms ±   7.3 ms    [User: 104.7 ms, System: 21.8 ms]
Range (min … max):   128.3 ms … 160.9 ms    30 runs

Summary
/tmp/uv-2-single-lookup lock --project /home/konsti/projects/airflow ran
 1.01 ± 0.07 times faster than /tmp/uv-1-or-insert-with lock --project /home/konsti/projects/airflow
 1.05 ± 0.09 times faster than /tmp/uv-0-baseline lock --project /home/konsti/projects/airflow
```
2026-03-15 20:29:04 +01:00
Zanie Blue fe5ca6ca80 Disable SYSTEM_VERSION_COMPAT when querying interpreters on macOS (#18452)
Closes https://github.com/astral-sh/uv/issues/14267
Replaces https://github.com/astral-sh/uv/pull/18436 — adding my review
because I cannot push there
Replaces https://github.com/astral-sh/uv/pull/18416

---------

Co-authored-by: Ed Schofield <ed@pythoncharmers.com>
2026-03-14 12:45:37 -05:00
Tomasz Kramkowski 08abfdbb81 Use settings::resolve_preview for project validation (#18447)
## Summary

The affected code was manually implementing part of the full logic which
was already available in `settings::resolve_preview` so this PR just
makes the project validation code use this function instead.

## Test Plan

Existing test coverage.
2026-03-14 14:20:45 +00:00
Charlie Marsh 45ea4dd4ec Fix uv sync --active recreating active environments when UV_PYTHON_INSTALL_DIR is relative (#18398)
## Summary

We need to normalize any relative managed-Python install roots before
checking whether the active environment’s interpreter is uv-managed, so
that `sync --active` reuses the environment.

Closes https://github.com/astral-sh/uv/issues/16631.
2026-03-13 18:47:53 -05:00
renovate[bot] 8337ffaffd Update Rust crate wmi to 0.18.3 (#17602)
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [wmi](https://redirect.github.com/ohadravid/wmi-rs) |
workspace.dependencies | minor | `0.16.0` → `0.18.0` |

---

### Release Notes

<details>
<summary>ohadravid/wmi-rs (wmi)</summary>

###
[`v0.18.0`](https://redirect.github.com/ohadravid/wmi-rs/releases/tag/v0.18.0)

[Compare
Source](https://redirect.github.com/ohadravid/wmi-rs/compare/v0.17.3...v0.18.0)

#### What's Changed

- Remove `COMLibrary` and let `WMIConnection` initialize COM if needed
by [@&#8203;ohadravid](https://redirect.github.com/ohadravid) in
[#&#8203;137](https://redirect.github.com/ohadravid/wmi-rs/pull/137)
You can now call `WMIConnection::new()` and let the crate handle the
initialization internally.
Note: COM will NOT be uninitialized when the connection is dropped
(similar to <=0.17 versions, which didn't uninitialize COM on drop since
[#&#8203;53](https://redirect.github.com/ohadravid/wmi-rs/issues/53)).
If this is not what you want, then you must initialize COM yourself
**before** creating the connection. See the docs for more.
- Update the crate to Rust 2024 edition

**Full Changelog**:
<https://github.com/ohadravid/wmi-rs/compare/v0.17.3...v0.18.0>

###
[`v0.17.3`](https://redirect.github.com/ohadravid/wmi-rs/releases/tag/v0.17.3)

[Compare
Source](https://redirect.github.com/ohadravid/wmi-rs/compare/v0.17.2...v0.17.3)

#### What's Changed

- chore(deps): update criterion requirement from 0.5 to 0.6 by
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;128](https://redirect.github.com/ohadravid/wmi-rs/pull/128)
- Update CI images by
[@&#8203;ohadravid](https://redirect.github.com/ohadravid) in
[#&#8203;135](https://redirect.github.com/ohadravid/wmi-rs/pull/135)
- chore(deps): update windows requirement from 0.61 to 0.62 by
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;134](https://redirect.github.com/ohadravid/wmi-rs/pull/134)

**Full Changelog**:
<https://github.com/ohadravid/wmi-rs/compare/v0.17.2...v0.17.3>

###
[`v0.17.2`](https://redirect.github.com/ohadravid/wmi-rs/releases/tag/v0.17.2)

[Compare
Source](https://redirect.github.com/ohadravid/wmi-rs/compare/v0.17.1...v0.17.2)

#### What's Changed

- feat(remote\_connection): added with\_credentials() by
[@&#8203;hatch15](https://redirect.github.com/hatch15) in
[#&#8203;127](https://redirect.github.com/ohadravid/wmi-rs/pull/127)

#### New Contributors

- [@&#8203;hatch15](https://redirect.github.com/hatch15) made their
first contribution in
[#&#8203;127](https://redirect.github.com/ohadravid/wmi-rs/pull/127)

**Full Changelog**:
<https://github.com/ohadravid/wmi-rs/compare/v0.17.1...v0.17.2>

###
[`v0.17.1`](https://redirect.github.com/ohadravid/wmi-rs/releases/tag/v0.17.1)

[Compare
Source](https://redirect.github.com/ohadravid/wmi-rs/compare/v0.17.0...v0.17.1)

#### What's Changed

- Support arrays of IUnknown pointers by
[@&#8203;samin-cf](https://redirect.github.com/samin-cf) in
[#&#8203;125](https://redirect.github.com/ohadravid/wmi-rs/pull/125) and
[@&#8203;ohadravid](https://redirect.github.com/ohadravid) in
[#&#8203;126](https://redirect.github.com/ohadravid/wmi-rs/pull/126)

**Full Changelog**:
<https://github.com/ohadravid/wmi-rs/compare/v0.17.0...v0.17.1>

###
[`v0.17.0`](https://redirect.github.com/ohadravid/wmi-rs/releases/tag/v0.17.0)

[Compare
Source](https://redirect.github.com/ohadravid/wmi-rs/compare/v0.16.0...v0.17.0)

#### What's Changed

- Added support for Option by
[@&#8203;vpopescu](https://redirect.github.com/vpopescu) in
[#&#8203;122](https://redirect.github.com/ohadravid/wmi-rs/pull/122)

#### Breaking Changes

- Fixed conversions from Rust types to WMI types (so, only when used for
method calling or using put\_property), which were incorrect in a few
cases (notably, u32s and u16s were not converted correctly), and added
some missing conversions, in
[#&#8203;124](https://redirect.github.com/ohadravid/wmi-rs/pull/124)
- `SafeArrayAccessor::new` now accepts a `NonNull<SAFEARRAY>` instead of
a reference, in
[#&#8203;124](https://redirect.github.com/ohadravid/wmi-rs/pull/124)

#### New Contributors

- [@&#8203;vpopescu](https://redirect.github.com/vpopescu) made their
first contribution in
[#&#8203;122](https://redirect.github.com/ohadravid/wmi-rs/pull/122)

**Full Changelog**:
<https://github.com/ohadravid/wmi-rs/compare/v0.16.0...v0.17.0>

</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: konstin <konstin@mailbox.org>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2026-03-13 20:32:00 +00:00
Zanie Blue 8c730aaad6 Bump version to 0.10.10 (#18455) 2026-03-13 14:35:08 -05:00
Zanie Blue f190514288 Improve error handling for platform detection in Python downloads (#18453)
I noticed this weird error chain in
https://github.com/astral-sh/uv/issues/8635#issuecomment-4055185865

```
error: Failed to parse request part 
    Caused by: Could not read ELF interpreter from any of the following paths: /bin/sh, /usr/bin/env, /bin/dash, /bin/ls
```

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-13 19:11:05 +00:00
renovate[bot] 3f03c64a0a Update Rust to v1.94.0 (#18442)
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [rust](https://redirect.github.com/rust-lang/rust) | minor | `1.93` →
`1.94.0` |

---

### Release Notes

<details>
<summary>rust-lang/rust (rust)</summary>

###
[`v1.94.0`](https://redirect.github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1940-2026-03-05)

[Compare
Source](https://redirect.github.com/rust-lang/rust/compare/1.93.1...1.94.0)

\==========================

<a id="1.94.0-Language"></a>

## Language

- [Impls and impl items inherit `dead_code` lint level of the
corresponding traits and trait
items](https://redirect.github.com/rust-lang/rust/pull/144113)
- [Stabilize additional 29 RISC-V target features including large
portions of the RVA22U64 / RVA23U64
profiles](https://redirect.github.com/rust-lang/rust/pull/145948)
- [Add warn-by-default `unused_visibilities` lint for visibility on
`const _`
declarations](https://redirect.github.com/rust-lang/rust/pull/147136)
- [Update to Unicode
17](https://redirect.github.com/rust-lang/rust/pull/148321)
- [Avoid incorrect lifetime errors for
closures](https://redirect.github.com/rust-lang/rust/pull/148329)

<a id="1.94.0-Platform-Support"></a>

## Platform Support

- [Add `riscv64im-unknown-none-elf` as a tier 3
target](https://redirect.github.com/rust-lang/rust/pull/148790)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

[platform-support-doc]:
https://doc.rust-lang.org/rustc/platform-support.html

<a id="1.94.0-Libraries"></a>

## Libraries

- [Relax `T: Ord` bound for some `BinaryHeap<T>`
methods.](https://redirect.github.com/rust-lang/rust/pull/149408)

<a id="1.94.0-Stabilized-APIs"></a>

## Stabilized APIs

-
[`<[T]>::array_windows`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.array_windows)
-
[`<[T]>::element_offset`](https://doc.rust-lang.org/stable/std/primitive.slice.html#method.element_offset)
-
[`LazyCell::get`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get)
-
[`LazyCell::get_mut`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.get_mut)
-
[`LazyCell::force_mut`](https://doc.rust-lang.org/stable/std/cell/struct.LazyCell.html#method.force_mut)
-
[`LazyLock::get`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get)
-
[`LazyLock::get_mut`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.get_mut)
-
[`LazyLock::force_mut`](https://doc.rust-lang.org/stable/std/sync/struct.LazyLock.html#method.force_mut)
- [`impl TryFrom<char> for
usize`](https://doc.rust-lang.org/stable/std/convert/trait.TryFrom.html#impl-TryFrom%3Cchar%3E-for-usize)
-
[`std::iter::Peekable::next_if_map`](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map)
-
[`std::iter::Peekable::next_if_map_mut`](https://doc.rust-lang.org/stable/std/iter/struct.Peekable.html#method.next_if_map_mut)
- [x86 `avx512fp16`
intrinsics](https://redirect.github.com/rust-lang/rust/issues/127213)
  (excluding those that depend directly on the unstable `f16` type)
- [AArch64 NEON fp16
intrinsics](https://redirect.github.com/rust-lang/rust/issues/136306)
  (excluding those that depend directly on the unstable `f16` type)
-
[`f32::consts::EULER_GAMMA`](https://doc.rust-lang.org/stable/std/f32/consts/constant.EULER_GAMMA.html)
-
[`f64::consts::EULER_GAMMA`](https://doc.rust-lang.org/stable/std/f64/consts/constant.EULER_GAMMA.html)
-
[`f32::consts::GOLDEN_RATIO`](https://doc.rust-lang.org/stable/std/f32/consts/constant.GOLDEN_RATIO.html)
-
[`f64::consts::GOLDEN_RATIO`](https://doc.rust-lang.org/stable/std/f64/consts/constant.GOLDEN_RATIO.html)

These previously stable APIs are now stable in const contexts:

-
[`f32::mul_add`](https://doc.rust-lang.org/stable/std/primitive.f32.html#method.mul_add)
-
[`f64::mul_add`](https://doc.rust-lang.org/stable/std/primitive.f64.html#method.mul_add)

<a id="1.94.0-Cargo"></a>

## Cargo

- Stabilize the config include key. The top-level include config key
allows loading additional config files, enabling better organization,
sharing, and management of Cargo configurations across projects and
environments.
[docs](https://doc.rust-lang.org/nightly/cargo/reference/config.html#including-extra-configuration-files)
[#&#8203;16284](https://redirect.github.com/rust-lang/cargo/pull/16284)
- Stabilize the pubtime field in registry index. This records when a
crate version was published and enables time-based dependency resolution
in the future. Note that crates.io will gradually backfill existing
packages when a new version is published. Not all crates have pubtime
yet.
[#&#8203;16369](https://redirect.github.com/rust-lang/cargo/pull/16369)
[#&#8203;16372](https://redirect.github.com/rust-lang/cargo/pull/16372)
- Cargo now parses [TOML v1.1](https://toml.io/en/v1.1.0) for manifests
and configuration files. Note that using these features in Cargo.toml
will raise your development MSRV, but the published manifest remains
compatible with older parsers.
[#&#8203;16415](https://redirect.github.com/rust-lang/cargo/pull/16415)
- [Make `CARGO_BIN_EXE_<crate>` available at runtime
](https://redirect.github.com/rust-lang/cargo/pull/16421/)

<a id="1.94.0-Compatibility-Notes"></a>

## Compatibility Notes

- [Forbid freely casting lifetime bounds of
`dyn`-types](https://redirect.github.com/rust-lang/rust/pull/136776)
- [Make closure capturing have consistent and correct behaviour around
patterns](https://redirect.github.com/rust-lang/rust/pull/138961)
Some finer details of how precise closure captures get affected by
pattern matching have been changed. In some cases, this can cause a
non-move closure that was previously capturing an entire variable by
move, to now capture only part of that variable by move, and other parts
by borrow. This can cause the borrow checker to complain where it
previously didn't, or cause `Drop` to run at a different point in time.
- [Standard library macros are now imported via prelude, not via
injected
`#[macro_use]`](https://redirect.github.com/rust-lang/rust/pull/139493)
  This will raise an error if macros of the same name are glob imported.
For example if a crate defines their own `matches` macro and then glob
imports that,
it's now ambiguous whether the custom or standard library `matches` is
meant and
  an explicit import of the name is required to resolve the ambiguity.
One exception is `core::panic` and `std::panic`, if their import is
ambiguous
a new warning
([`ambiguous_panic_imports`](https://redirect.github.com/rust-lang/rust/issues/147319))
is raised.
This may raise a new warning
([`ambiguous_panic_imports`](https://redirect.github.com/rust-lang/rust/issues/147319))
on `#![no_std]` code glob importing the std crate.
Both `core::panic!` and `std::panic!` are then in scope and which is
used is ambiguous.
- [Don't strip shebang in expression-context
`include!(…)`s](https://redirect.github.com/rust-lang/rust/pull/146377)
This can cause previously working includes to no longer compile if they
included files which started with a shebang.
- [Ambiguous glob reexports are now also visible
cross-crate](https://redirect.github.com/rust-lang/rust/pull/147984)
This unifies behavior between local and cross-crate errors on these
exports, which may introduce new ambiguity errors.
- [Don't normalize where-clauses before checking
well-formedness](https://redirect.github.com/rust-lang/rust/pull/148477)
- [Introduce a future compatibility warning on codegen attributes on
body-free trait
methods](https://redirect.github.com/rust-lang/rust/pull/148756)
  These attributes currently have no effect in this position.
- [On Windows `std::time::SystemTime::checked_sub_duration` will return
`None` for times before the Windows epoch
(1/1/1601)](https://redirect.github.com/rust-lang/rust/pull/148825)
- [Lifetime identifiers such as `'a` are now NFC
normalized](https://redirect.github.com/rust-lang/rust/pull/149192).
- [Overhaul filename handling for cross-compiler
consistency](https://redirect.github.com/rust-lang/rust/pull/149709)
Any paths emitted by compiler now always respect the relative-ness of
the paths and `--remap-path-prefix` given originally.
One side-effect of this change is that paths emitted for local crates in
Cargo (path dependencies and workspace members) are no longer absolute
but relative when emitted as part of a diagnostic in a downstream crate.

<a id="1.94.0-Internal-Changes"></a>

## Internal Changes

These changes do not affect any public interfaces of Rust, but they
represent
significant improvements to the performance or internals of rustc and
related
tools.

- [Switch to `annotate-snippets` for error
emission](https://redirect.github.com/rust-lang/rust/pull/150032)
  This should preserve mostly the same outputs in rustc error messages.

</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:eyJjcmVhdGVkSW5WZXIiOiI0My42Ni40IiwidXBkYXRlZEluVmVyIjoiNDMuNjYuNCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiYnVpbGQ6c2tpcC1kb2NrZXIiLCJidWlsZDpza2lwLXJlbGVhc2UiLCJpbnRlcm5hbCJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2026-03-13 13:59:55 -05:00
Charlie Marsh 3db30e048d Filter out unsupported environment wheels (#18445)
## Summary

The issue here is that once conflicts are introduced, the markers in the
lockfile get too complicated for our basic environment checks. We should
_also_ filter by supported environments here.

Closes https://github.com/astral-sh/uv/issues/18428.
2026-03-13 14:46:27 -04:00
Tomasz Kramkowski eec8048a0b Preserve absolute/relative paths in lockfiles (#18176)
## Summary

Attempt to track and preserve relative/absolute paths when read from files.

File URLs are treated as absolute. Synthetic VerbatimUrls shouldn't have
a `given`, and are treated as relative.

This means that paths passed as absolute will be output as absolute,
although they may get normalized. Paths passed as relative will be
output as relative but they may be relative to a different location (so
that they continue to work going forwards). Previously in various places
we'd either make things absolute unconditionally or relative
unconditionally.

Cases which should now be fixed:

- uv.lock - Path dependencies, indexes, and find-links were always
converted to relative paths.
- pylock.toml export (from_resolution path) - Paths were always
relativized. Now preserves the user's original format.
- pylock.toml export (from_lock path) - Relative paths from the lock
file were being converted to absolute paths. Now uses the path exactly
as stored in the lock file.

Also noteworthy is the bugfix for a windows misbehaviour. See the commit
message for some more information.

Note: For now the `uv add` side of this has been split off as a breaking change.

## Test Plan

Added missing tests, updated existing.

I believe all the changed tests are all now correct and were previously
demonstrating buggy behaviour. Well, at least if you are on board with
the idea that we should keep relative paths relative and absolute paths
and / file URLs absolute.

## Related Issues/PRs

* Closes https://github.com/astral-sh/uv/issues/15055
* Closes https://github.com/astral-sh/uv/issues/16602
* Closes https://github.com/astral-sh/uv/issues/16514
* Closes https://github.com/astral-sh/uv/pull/15870
2026-03-13 17:42:03 +00:00
William Woodruff 7319e4699c Remove overloaded use of 'audit' (#18427)
## Summary

Once `uv audit` lands, this will be pretty confusing to users IMO.

I've changed it to "Checked" to demo-run the changes, but I'd definitely
appreciate opinions on a better term for this (scanned? validated?)

## Test Plan

Bumped so many snapshots.

---------

Signed-off-by: William Woodruff <william@astral.sh>
2026-03-13 23:17:06 +09:00
William Woodruff e979ed7a03 Reject invalid classifiers, warn on license classifiers (#18419)
## Summary

This makes two changes to our handling of trove classifiers in uv's
build backend:

1. We now reject malformed trove classifiers. I've done this by adding a
`Classifier` newtype that parses and rejects anything that _looks_ wrong
(there's no formal grammar for classifiers, so this is a pretty
primitive check, but it should be enough to preempt most common user
errors). We don't use an allowlist at the moment, although in principle
we could do that as well/instead.
2. We now emit a user warning on any license classifiers, since these
have been deprecated since PEP 639 was accepted. I've added this within
`PyProjectToml::license_metadata` since in the future we'll also want to
produce a hard error when license classifiers are present _and_
new-style structured license metadata is also present. That change will
require a breaking release however.

Closes https://github.com/astral-sh/uv/issues/16354.

## Test Plan

I've added some new unit tests for this, plus an integration test for
the user warning.

---------

Signed-off-by: William Woodruff <william@astral.sh>
2026-03-13 22:56:23 +09:00
Henry Schreiner 6541b475b9 chore: update versions in new project init (#18417)
<!--
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 updates the versions a bit in the new project init.
Scikit-build-core updated to 0.12+, pybind11 updated to 3+ (which allows
a small simplification), and PyO3 updated to 0.28.2+ (which is what I
was running into, it was on an old version).

I also wanted to update the gitignore, as it's missing a bunch of things
for Maturin (like `target/*` and `*.so`!), but I guess that's somewhere
else.

---------

Co-authored-by: konstin <konstin@mailbox.org>
2026-03-13 13:50:51 +00:00
konsti 5ede7030cf Warn if --project directory does not exist (#17714)
For #17093

Errors if `--project` points to a file, as this already errors on Linux.

---------

Co-authored-by: ddoemonn <ozergokalpsezer@gmail.com>
2026-03-13 12:26:33 +00:00
github-actions[bot] 9bcbaac3e9 Add CPython 3.15.0a7 (#18403)
Automated update for Python releases.

Co-authored-by: jjhelmus <1050278+jjhelmus@users.noreply.github.com>
2026-03-12 23:55:37 +00:00
Charlie Marsh 9c1f577673 Simplify selected extra markers in uv export (#18433)
## Summary

`uv export` now carries selected root extras through the export graph
and simplifies `extra` markers on ordinary dependency edges, not just
optional-dependency edges. This fixes cases where --all-extras would
still emit redundant markers for requirements that are unconditional
once the chosen extras are known.
2026-03-12 19:46:29 -04:00
Zanie Blue dd0d76cd83 Fix type errors on main (#18430) 2026-03-12 21:48:06 +00:00
Zsolt Dollenstein ed35fe83ab Fetch Ruff from an Astral mirror (#18286) 2026-03-12 20:54:30 +00:00
Tomasz Kramkowski ca1e9a9d06 Introduce a global preview state (#18194)
## Summary

Introduce a global preview state to reduce the amount of churn required
when adding a preview feature.

This PR also introduces a testing feature to `uv_preview` enabled for
dev builds (builds which are used for running tests among other things).
This exposes `uv_preview::test::with_features` which can be used from
other crates' unit tests to override the preview state for the duration
of a scope. `uv_preview::init` continues to exist and work in this mode
since running the integration test suite in workspace mode pulls in the
dev feature (whereas doing it in package mode, does not, IDFK).

When doing a debug or release build, the testing feature is not enabled.

The PR is based on and closes #17844.

As an example, I've converted the build backend to using global preview
as it was a place which did unit tests which needed to set the preview
state.

## Test Plan

Verification that things continue to work and that the testing feature
does not enable for debug or release builds but does enable for tests
was done manually and by running the test suite.

Additional tests were added.

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-12 20:20:55 +00:00
Charlie Marsh 3b544adc25 Make uv cache clear an alias of uv cache clean (#18420)
## Summary

A common point of confusion.
2026-03-12 11:48:26 -04:00
Tomasz Kramkowski 5d52a35830 Remove unnecessary error wrapper type (#18411)
## Summary

I was [working on addressing feedback and some issues I spotted in the
centralised environments
PR](https://www.youtube.com/watch?v=5W4NFcamRhM) and I noticed that this
wrapper type was unnecessary to achieve the desired result.

## Test Plan

Existing tests.
2026-03-12 12:05:06 +00:00
Andrew Barnes c89a78ec08 Log explicit config file path in verbose output (#18353)
When `--config-file` or `UV_CONFIG_FILE` is used, emit a `DEBUG` message
after logging is initialized so users can verify which configuration
file is active.

The existing debug log in `FilesystemOptions::from_file()` fires before
the tracing subscriber is registered, so it is silently dropped.

Closes #17182

---------

Co-authored-by: konstin <konstin@mailbox.org>
2026-03-11 13:53:26 +00:00
Charlie Marsh 26fed87a5a Respect timestamp and other cache keys in cached environments (#18396)
## Summary

We now take cache keys and timestamps into account when reusing
environments via `--with`, etc.

Closes https://github.com/astral-sh/uv/issues/16617.
2026-03-11 12:52:17 +00:00
Charlie Marsh 4af1dc8491 Recreate Python environments under uv tool install --force (#18399)
## Summary

`uv tool install --force` will now always recreate the environment,
which I find more intuitive (and makes it a more reliable escape hatch).

Closes https://github.com/astral-sh/uv/issues/17907.
2026-03-11 12:47:25 +00:00
William Woodruff 88147b668c Plumb top-level concurrency into uv audit (#18407)
## Summary

Follows #18394. This plumbs the actual concurrency settings (rather than
their default) and removes the default impl for `Osv`.

## Test Plan

NFC.

Signed-off-by: William Woodruff <william@astral.sh>
2026-03-11 20:21:51 +08:00
William Woodruff 761c7468d3 Switch to batched OSV queries for uv audit (#18394)
## Summary

This switches us to OSV's batch query API for vulnerability ID lookups,
which can then be used to concurrently fetch the actual full finding
responses.

In my local testing, this yields significant speedups: from 23s on main
(before this PR) with a small project (~70 deps) to 950ms with this PR.

~~WIP, I want to think through this approach a little more.~~

See #18119

## Test Plan

Added new unit tests.

---------

Signed-off-by: William Woodruff <william@astral.sh>
2026-03-11 19:25:25 +08:00
liam 5fca951e26 Warn when workspace member scripts are skipped due to missing build system (#18389)
Resolves #18388

When a workspace member declares `[project.scripts]` without a
`[build-system]` table or `tool.uv.package = true`, uv silently skips
installing those entry points. The warning that normally fires for the
root project was never emitted for non-root workspace members, because
the check only inspected the workspace root's `pyproject.toml`.

This diff replaces the single-project check with a loop over all
workspace members, so the warning fires for any member that has scripts
but is not packaged. The warning message now includes the package name
to make it actionable when multiple members are involved.
2026-03-10 15:02:18 -04:00
Charlie Marsh 5dc986d367 Avoid sharing version metadata across indexes (#18373)
## Summary

The metadata cache used `VersionId` as a key, which meant that if a
package-version existed on two different indexes, we assumed identical
metadata. This turns out not to be true in some contexts, e.g., for the
linked issue with PyTorch. We now key it on `DistributionId`, which does
include the index.

Closes https://github.com/astral-sh/uv/issues/17732.
2026-03-10 07:34:42 -04:00
William Woodruff d31348109f Add links to uv audit output (#18392)
## Summary

This adds links to `uv audit`'s outputs. This required adding links to
the backing (common) Vulnerability type and pulling them from the OSV
service. OSV will always produce a link for a Vulnerability (since the
ID itself can be turned into a link), but `Vulnerability::link` itself
is optional since other services may not necessarily guarantee this.

Follows #18193.

## Test Plan

None yet.

---------

Signed-off-by: William Woodruff <william@astral.sh>
2026-03-10 17:58:55 +08:00
William Woodruff f54ce6768d Output/report formatting for uv audit (#18193)
## Summary

This adds some initial output/report formatting for `uv audit`.

This is an initial blush, any feedback to align this with
rendering/formatting idioms elsewhere would be greatly appreciated!

Atop #18119. 

## Test Plan

None yet.

---------

Signed-off-by: William Woodruff <william@astral.sh>
2026-03-10 12:07:56 +08:00
Charlie Marsh bec06f62bb Avoid copying /usr in install test (#18372)
Closes https://github.com/astral-sh/uv/issues/18361.

---------

Co-authored-by: konsti <konstin@mailbox.org>
Co-authored-by: Tomasz Kramkowski <tom@astral.sh>
2026-03-09 14:39:27 +00:00
samypr100 9889525195 fix(uv-platform): adjust windows ostype to match sys-info-rs, fix windows version (#18383)
## Summary

In https://github.com/astral-sh/uv/pull/18324, sys-info-rs was dropped
in favor of a more native reimplementation to provide OsType and
OsRelease.

This PR adjusts two areas for windows to match closely previous
behavior:

1. OsType should be `Windows` rather than `Windows_NT`
https://github.com/astral-sh/uv/pull/18324#discussion_r2902257834 as
seen in
https://github.com/FillZpp/sys-info-rs/blob/60ecf1470a5b7c90242f429934a3bacb6023ec4d/c/windows.c#L12.
This also matches the output of `platform.system()` in CPython.
2. OsRelease previously used `GetVersionEx` in sys-info-rs. Looking
closely, this was used primarily in
`crates/uv-python/src/interpreter.rs` and not in linehaul as linehaul
uses `platform.release()`. The problem with `GetVersionEx` is that it
returns often the wrong version due to legacy reasons (e.g. may be stuck
returning `6.2.9200`). The current implementation only returns the build
number from the registry which is prone to problems across windows older
variants. The implementation should use `RtlGetVersion` system call
which returns the current major, minor, build in the same way as
reported by `sys.getwindowsversion()` in CPython. In order to strike
balance, this switches the implementation to use four octects
`{major}.{minor}.{build}.{revision}` as recent windows versioning relies
on major, build and revision where as older versions rely on major,
minor and service pack. A windows-version crate by the same author as
windows-rs was added as it includes the correct system calls for the
windows versions.

## Test Plan

Tested manually on both Windows desktop (10, 11) and Windows Server
(2016).
2026-03-08 22:10:21 -05:00
Mikaël Barbero 499cc82b35 Add --outdated flag to uv tool list (#18318)
## Summary

Add a `--outdated` flag that queries PyPI for the latest version of each
installed tool and filters the output to only show tools with available
updates. Each outdated tool is displayed with its installed version and
a `[latest: X.Y.Z]` annotation.

The implementation reuses the existing `LatestClient` infrastructure
from `pip list --outdated`, fetching versions concurrently with progress
reporting. Up-to-date tools are omitted from the output. A
`--no-outdated` hidden flag is included for flag negation consistency.

Fixes #9309

## Test Plan

A new integration test has been created in
`crates/uv/tests/it/tool_list.rs`, and the feature has also been tested
locally.

Signed-off-by: Mikaël Barbero <mikael.barbero@eclipse-foundation.org>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-08 12:20:19 -04:00
Ben Beasley 77489379b1 Conditionalize two new tests on the test-pypi feature (#18369)
<!--
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

<!-- What's the purpose of the change? What does it do, and why? -->
Both `build_backend::tool_uv_build_backend_without_build_backend` and
`build_backend::tool_uv_build_backend_wrong_build_backend` fail in
offline environments because they try to download a build backend from
PyPI.

This PR conditionalizes both tests on the existing `test-pypi` feature.

## Test Plan

<!-- How was it tested? -->
Applied as a downstream patch to Fedora’s `uv` package.
2026-03-08 11:55:34 -04:00
William Woodruff e30c081d5a Send mint-token requests with a proper Content-Type (#18334)
## Summary

Using `.body()` meant that the request was sent without a
`Content-Type`, whereas we want to explicitly communicate that the
mint-token request is a JSON payload. Using `.json()` causes request to
send the `Content-Type` header by default.

## Test Plan

Existing coverage.

---------

Signed-off-by: William Woodruff <william@astral.sh>
2026-03-07 21:03:05 +08:00
Zanie Blue f675560f32 Bump version to 0.10.9 (#18357) 2026-03-06 14:00:59 -06:00
Charlie Marsh 12caaf3160 Respect build constraints for workspace members (#18350)
## Summary

These are respected in `uv sync` and `uv pip install`, but not `uv
build`.

Closes https://github.com/astral-sh/uv/issues/18283
2026-03-06 16:53:07 +00:00
Zanie Blue 24e9b47900 Add fallback to /usr/lib/os-release on Linux (#18349) 2026-03-06 16:50:54 +00:00
Charlie Marsh 9dea237fca Revalidate editables and other dependencies in scripts (#18328)
## Summary

Lockfile re-validation was iterating from the workspace roots; but for
scripts, we have no roots! This is similar to the approach we use in `uv
tree`, `uv export`, etc.

Closes https://github.com/astral-sh/uv/issues/18312.
2026-03-06 11:46:07 -05:00
Zanie Blue 363aea27be Drop the sys-info dependency (#18324)
Part of https://github.com/astral-sh/uv/issues/14574 and
https://github.com/termux/termux-packages/issues/27547

Avoids the downstream patch at
https://github.com/termux/termux-packages/blob/master/packages/uv/0001-sys-info-replace-index-with-strchr.diff

`sys-info-rs` has not been updated in years
https://github.com/FillZpp/sys-info-rs — it includes C code and can't be
built on Termux https://github.com/FillZpp/sys-info-rs/issues/116

I considered switching to https://github.com/GuillaumeGomez/sysinfo but
our usage is trivial, so we implement our requirements in `uv-platform`
instead
2026-03-06 16:30:19 +00:00
konsti 401661ee22 Log the duration we took before erroring (#18231)
We previously errored due to not having long enough backoff, and there
were questions about how long the retries are, so let's log this on
failure.
2026-03-06 08:51:10 -06:00
Zanie Blue 8b82d17f44 Support Python 3.13+ on Android (#18301)
Python 3.13+ changed how it reports platform information on Android; see
https://peps.python.org/pep-0738/#architectures

Here we add support for the new platform values, without which uv will
fail due to an unrecognized interpreter.

Closes #18296
Closes #18285
Closes https://github.com/astral-sh/uv/issues/18313

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-03-06 07:42:21 -06:00
konsti 6055369bb1 Remove invisible unicode characters (#18344) 2026-03-06 14:27:57 +01:00
Charlie Marsh 5fc74a2357 Add fbgemm-gpu, fbgemm-gpu-genai, torchrec, and torchtune to the PyTorch list (#18338)
## Summary

Like #18336.
2026-03-06 07:27:35 -06:00
konsti 53c4a0925a Workspace refactoring rollup (#18308)
Three small refactorings pulled out of the toml optimization branch.
2026-03-06 10:37:41 +00:00
konsti 4a1028e78c Avoid toml Document overhead (#18306)
The difference is below the noise threshold, but it showed up in the
profiled. The code originally existed for error handling that has since
been removed.
2026-03-06 11:16:15 +01:00
Djordje 8616b11d59 Add torchcodec to PyTorch List (#18336)
<!--
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

torchcodec added
https://github.com/astral-sh/uv/issues/18335
<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

<!-- How was it tested? -->
2026-03-05 19:11:38 -05:00