Commit Graph

8006 Commits

Author SHA1 Message Date
Zanie Blue add7e4eba1 Link to the contributing tab instead of the document 2025-12-16 08:40:05 -06:00
konsti 0cee76417f
Bump version to 0.9.18 (#17141)
It's been a week.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-12-16 13:32:35 +00:00
jkipper af348c2a88
Ignore pyproject index username in lockfile comparison (#16995)
<!--
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

Pyproject.toml index url may contain a username while lockfile doesn't.
Treat it as the same index to prevent unintended package updates

Fixes #16436

---------

Co-authored-by: konstin <konstin@mailbox.org>
2025-12-16 10:47:50 +00:00
Diyor Khayrutdinov b58f543e5e
Support redirects in `uv publish` (#17130)
<!--
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

Follow redirects for `uv publish`. Related issue:
https://github.com/astral-sh/uv/issues/17126.

## Test Plan

<!-- How was it tested? -->
Added a unit test to test the custom redirect logic.

---------

Co-authored-by: konstin <konstin@mailbox.org>
2025-12-16 09:04:28 +00:00
Charlie Marsh 13e7ad62cb
Accept `--torch-backend` in `[tool.uv]` (#17116)
## Summary

I'd like to add `--torch-backend` to `uv tool`, so this PR lifts the
setting out of `[tool.uv.pip]`. Like other settings, if it's in
`[tool.uv.pip]`, it will take preference for `uv pip` operations.
2025-12-15 20:18:40 -05:00
Tomasz Kramkowski 94c97b6434
Add value hints to command line arguments to improve shell completion accuracy (#17080)
## Summary

This partially addresses #17076 by adding `value_hint` to various
arguments.

For cases where an option takes a path to either specifically a file or
a directory directory, `ValueHint::FilePath` and `ValueHint::DirPath`
are used respectively to try to limit the amount of noise presented by
completions in shells which support it.

For cases where a URL (and only a URL, not a path) can be supplied,
`ValueHint::Url` is used.

For cases where a python interpreter is to be specified,
`ValueHint::CommandName` is used which will tab complete from `$PATH` by
default, but will fall back to completing executable filenames if you
start typing a path.

Finally, for the many cases where there is no built in completion which
would make sense, and where default completion of a path would make no
sense (e.g. a package name, or version specifier, or date)
`ValueHint::Other` is used to explicitly disable completion.

## Test Plan

Manually tested a bunch of these. These _could_ be automated in the
sense that we could snapshot the completion from zsh but I've not
thought about how that could be done yet.
2025-12-15 18:29:32 +00:00
konsti af95677b9b
Update cargo shear (#17106)
Requires a companion PR that updates the GitHub Action.
2025-12-15 18:46:35 +01:00
konsti a5d50a20d2
Better rendering for multiline error messages (#17132)
Split out from https://github.com/astral-sh/uv/pull/17110

Indent multiline error messages properly, and add a test with a
multiline context and a context below since that combination isn't
captured atm.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-12-15 16:29:11 +00:00
samypr100 a768a9d111
Relax error when using uv add with `UV_GIT_LFS` set (#17127)
## Summary

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

Previously having `UV_GIT_LFS` set would cause an error when adding a
non-git requirement such as ```error: `requirement` did not resolve to a
Git repository, but a Git extension (`--lfs`) was provided.```

## Test Plan

Additional test has been added.
2025-12-15 08:26:14 -06:00
Tomasz Kramkowski d20948bec2
Support creating lock files on ExFAT on MacOS (#17115)
## Summary

Fix #16859 by falling back to simply creating the lock file and then
attempting to apply permissions in cases where the temporary lockfile
cannot be renamed without overwriting (persist_noclobber) due to lack of
underlying support from the filesystem.

I've also improved the error handling.

## Test Plan

Manually on MacOS with an ExFAT partition.

~~~ bash session
$ hdiutil create -size 1g -fs ExFAT -volname EXFATDISK exfat.dmg
$ hdiutil attach exfat.dmg
$ cd /Volumes/EXFATDISK
$ uv init --bare --cache-dir build/uv/cache -v 
~~~
2025-12-15 14:05:05 +00:00
Ben Beasley a2d64aa224
Update spdx dependency to 0.13 (#17129)
<!--
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

Updates the `spdx` dependency from 0.12.x to the latest release, 0.13.2.

https://github.com/EmbarkStudios/spdx/blob/0.13.2/CHANGELOG.md

Here in uv upstream, this just helps keep dependencies up to date; there
isn’t any other particular specific motivation or benefit. Downstream in
Fedora, this change allows me to avoid maintaining a `rust-spdx0.12`
compat package.
<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan

<!-- How was it tested? -->
`cargo nextest run -- --skip python_install::python_install_pyodide`
2025-12-14 13:25:06 -05:00
haruna c43315f4eb
Change exclude-newer type into optional string (#17121)
<!--
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

fix: #17103 

## Test Plan

The following settings will be enabled for the schema.

```toml
[tool.uv]
exclude-newer = "P7D"
```
2025-12-13 13:42:01 -06:00
Charlie Marsh e77ee15204
Enforce latest-version in `@latest` requests (#17114)
## Summary

Given `uv tool install {name}@latest`, we make revalidation requests for
`{name}`, but we don't actually add a "latest" constraint when resolving
-- we just assume that since the package is unpinned, and we're fetching
the latest available versions, the resolver will select the latest
version.

However, imagine a package in which the latest version requires Python
3.13 or later, but prior versions support Python 3.9 and up. If we
happen to select Python 3.9 ahead of resolution, and the user requests
`{name}@latest`, we would backtrack to the non-latest version due to the
Python mismatch.

This PR modifies `uv tool install` and `uv tool run` to first determine
the latest version, then provide it as a constraint when resolving.
2025-12-13 10:39:01 -05:00
Zanie Blue ed37f3b432
Drop arm musl caveat from Docker documentation (#17111)
This works fine now

```
❯ docker run --rm -it ghcr.io/astral-sh/uv:alpine sh -c "uv python install 3.14"
Installed Python 3.14.2 in 2.77s
 + cpython-3.14.2-linux-aarch64-musl (python3.14)
```
2025-12-12 19:15:15 +00:00
konsti 3e80b10272
Avoid panics due to reads on failed requests (#17098)
Fixes https://github.com/astral-sh/uv/issues/17090, specifically the
panic, not the upstream bug.
2025-12-12 18:02:49 +01:00
konsti 7ad441a0bd
Better error handling for `uv publish` (#17096)
* Use `is_transient_network_error` as we do in all other cases, see also
https://github.com/astral-sh/uv/pull/16245
* Don't report success in the progress reporter if the upload failed
2025-12-12 18:02:37 +01:00
Zanie Blue 5a55bbe883
Include Docker images with the alpine version, e.g., `python3.x-alpine3.23` (#17100)
Closes https://github.com/astral-sh/uv/issues/17095

This also stabilizes the Alpine version for users that do not choose to
pin it. We could add this to the build matrix separately to avoid that,
but I think that's okay?
2025-12-12 14:17:15 +00:00
Tomasz Kramkowski 6ad80c5150
Refactor the Changelog for use in `report_dry_run` (#17039)
## Summary

Remove duplication in `report_dry_run` by making `Changelog` support
both local and remote dists. This is in support of #16653 and will form
a new basis for #16981.

This also involved refactoring `InstallLogger` and its implementations
to support dry run logging.

Additionally includes some minor refactoring in `SummaryInstallLogger`
and a fix to `InstalledVersion`.

See https://github.com/astral-sh/uv/compare/tk/dry-run-refactor for an
alternative approach (although obviously comes with some caveats).

## Test Plan

There are already quite a few tests which cover the output and they
pass. Manual testing was used to ensure styling stayed consistent.
2025-12-12 10:37:30 +00:00
Charlie Marsh 38ae414682
Initialize S3 signer once (#17092)
## Summary

Right now, we initialize the signer many times concurrently.
2025-12-11 20:36:41 +00:00
Matthew Mckee 6de869cc88
Speed up cache size command (#17015)
## Summary

`uv cache size` can be quite slow. Here i use
https://github.com/sharkdp/diskus to walk the cache directory with in
multiple threads.

Add cli option to set the number of threads and default to `
std:🧵:available_parallelism()` or 1.

## Test Plan

Added cli statement with info log test.

I believe this is a fair test, where i set cache dir to a large
directory.

```bash
matthew@matthew-main ~/develop/personal/uv                                                                                                                                                                                                                 [14:17:50]                                                                                                                                                                                                                                       [±cache-size-speed-up ✓▴]
> $ uv cache size --preview-features cache-size -H --cache-dir ~/develop/                                                                                                                                                                   [±cache-size-speed-up ✓▴]
75.7GiB

matthew@matthew-main ~/develop/personal/uv                                                                                                                                                                                                                 [14:18:24]
> $ hyperfine 'uv cache size --preview-features cache-size -H --cache-dir ~/develop/' 'target/debug/uv cache size --preview-features cache-size -H --cache-dir ~/develop/'                                                                  [±cache-size-speed-up ✓▴]
Benchmark 1: uv cache size --preview-features cache-size -H --cache-dir ~/develop/
  Time (mean ± σ):      1.059 s ±  0.014 s    [User: 0.171 s, System: 0.884 s]
  Range (min … max):    1.048 s …  1.097 s    10 runs

Benchmark 2: target/debug/uv cache size --preview-features cache-size -H --cache-dir ~/develop/
  Time (mean ± σ):     413.8 ms ±  17.1 ms    [User: 5789.2 ms, System: 1682.0 ms]
  Range (min … max):   386.3 ms … 441.6 ms    10 runs

Summary
  target/debug/uv cache size --preview-features cache-size -H --cache-dir ~/develop/ ran
    2.56 ± 0.11 times faster than uv cache size --preview-features cache-size -H --cache-dir ~/develop/  
```
2025-12-11 12:11:01 -05:00
Mathieu Kniewallner 59d73fdddf
docs(settings): better document `exclude-newer*` (#17079)
<!--
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

Following the changes in https://github.com/astral-sh/uv/pull/16814,
documentation for
[`--exclude-newer`](https://docs.astral.sh/uv/reference/cli/#uv-sync--exclude-newer)
and
[`--exclude-newer-package`](https://docs.astral.sh/uv/reference/cli/#uv-sync--exclude-newer-package)
arguments were updated, but not their settings counterparts, so this
just updates the settings ones to closely match the arguments ones.

## Test Plan

Ran documentation locally.
2025-12-11 09:23:48 -06:00
Charlie Marsh 4c1571fb76
Fix version reference in resolver example (#17085) 2025-12-11 15:53:48 +01:00
konsti ebdffaf728
CI Perf: fast-build (#16780)
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-12-11 13:51:37 +00:00
Eashwar Ranganathan 3bb7f67c71
Explicitly set EntryType for file entries in tar (#17043)
## Summary
This PR explicitly sets the entry type for files in an sdist. This
changes the entry type from `AREGTYPE` (the 'legacy' regular file type)
to `REGTYPE` (the 'normal' regular file type) in the generated tar.

This change works around a bug in the python `tarfile` module that
causes all entries after a certain point in the tar to be silently
ignored if any entry matches some very specific conditions. In `maturin`
this was very visible since the `PKG-INFO` was written at the very end
so `twine check` would loudly complain that the `PKG-INFO` was missing
and that the sdist was invalid. In `uv` the `PKG-INFO` is written at the
beginning so this issue is unlikely to be caught.

Note that this change does mean that sdists created with newer versions
of the uv build backend will not be byte-for-byte identical with sdists
from an older version.

See https://github.com/PyO3/maturin/issues/2855#issuecomment-3546501132

## Test Plan
This is the same as the change that was made in maturin to work around
the same issue

---------

Co-authored-by: konstin <konstin@mailbox.org>
2025-12-11 10:37:35 +00:00
konsti caac4814df
Add crate graph to contributing guide (#17062)
I share this regularly with people, we should document it.

---------

Co-authored-by: Tomasz Kramkowski <tom@astral.sh>
2025-12-10 09:01:00 -06:00
Zanie Blue a550743bed
Drop some non-integration exclude-newer tests (#17071)
Closes https://github.com/astral-sh/uv/issues/17070

Claude added these and they're unstable and just not useful imo.
2025-12-10 14:04:05 +00:00
Zanie Blue 94f1f02d85
Update the exclude newer duration tests to demonstrate package version changes (#17055)
Follows #16814 updating the test cases with Claude so that the
timestamps and durations are on the boundary of package versions so we
see actual version changes in the lockfile.
2025-12-10 07:47:44 -06:00
Ben Beasley 36806f8e66
Gate a few more tests on the pypi feature (#17059)
<!--
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

Gate a few more tests on the `pypi` feature. All of these fail in
offline environments because they try to communicate with 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, version 0.9.16.
2025-12-10 10:41:47 +01:00
Zanie Blue 2b5d65e61d
Bump version to 0.9.17 (#17058) 2025-12-09 16:36:00 -06:00
github-actions[bot] 81c99dd438
Sync latest Python releases (#17057)
Automated update for Python releases.

Co-authored-by: zanieb <2586601+zanieb@users.noreply.github.com>
2025-12-09 22:30:11 +00:00
Zanie Blue b931c6687c
Increase the size of binary build runners (#17016)
Summary from asking Claude to compare the runtime

```
  | Job                       | Before | After | Saved | Reduction |
  |---------------------------|--------|-------|-------|-----------|
  | macos-aarch64             | 19.1m  | 9.8m  | 9.2m  | 48%       |
  | macos-x86_64              | 15.1m  | 9.2m  | 5.9m  | 39%       |
  | linux-arm (aarch64)       | 18.6m  | 12.2m | 6.4m  | 34%       |
  | linux-arm (armv7)         | 17.4m  | 11.5m | 5.9m  | 34%       |
  | musllinux-cross (aarch64) | 19.3m  | 13.2m | 6.1m  | 32%       |
  | linux-arm (arm)           | 16.6m  | 11.4m | 5.2m  | 31%       |
  | musllinux-cross (armv7)   | 16.4m  | 10.8m | 5.6m  | 34%       |
```
The longest-running affected job went from 19.3m → 13.2m (saved 6.1
minutes, 32% faster).
2025-12-09 16:04:43 -06:00
Zanie Blue eca36eed08
Fix a typo (#17056) 2025-12-09 21:49:52 +00:00
William Woodruff 69910b4aab
Publish PyPI releases before crates.io artifacts (#16989)
## Summary

Closes #16987.

## Test Plan

We need a good way to dry-run this...

---------

Signed-off-by: William Woodruff <william@astral.sh>
2025-12-09 15:20:21 -06:00
konsti 8d2c2e8cdf
Better source-exclude reference docs (#16832)
Fixed https://github.com/astral-sh/uv/issues/16821

This is already explained in the guide, but it was missing from the
reference docs.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-12-09 21:14:28 +00:00
Niko Pikall b6686fbce3
Update UV_VERSION in docs for GitLab CI/CD (#17040)
<!--
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
Update the `UV_VERSION`, such that a `copy-to-clipboard` action and
pasting into a `.gitlab-ci.yml` is not 4 minor versions behind, as it
happened to me a couple of times.

<!-- What's the purpose of the change? What does it do, and why? -->

## Test Plan
I ran `mkdocs serve` and it worked (I literally only changed one
character)
<!-- How was it tested? -->
2025-12-09 14:56:27 -06:00
Charlie Marsh 4af2d2b922
Add `torch-tensorrt` and `torchao` to the PyTorch list (#17053)
## Summary

Closes https://github.com/astral-sh/uv/issues/17050.
2025-12-09 20:29:32 +00:00
Charlie Marsh 2502577c9d
Sort packages in GPU lists (#17054)
## Summary

No semantic changes; this is just bothering me.
2025-12-09 15:10:06 -05:00
Zanie Blue d0a6f5d13f
Add support for relative durations in `exclude-newer` (#16814)
Adds support for "friendly" durations like, 1 week, 7 days, 24 hours
using Jiff's parser. During resolution, we calculate this relative to
the current time and resolve it into a concrete timestamp for the
lockfile. If the span has not changed, e.g., to another relative value,
then locking again will not change the lockfile. The locked timestamp
will only be updated when the lockfile is invalidated, e.g., with
`--upgrade`. This prevents the lockfile from repeatedly churning when a
relative value is used.
2025-12-09 19:52:14 +00:00
Zanie Blue 7b6b02a7d1
Recommend `UV_NO_DEV` in Docker installs (#17030)
Closes https://github.com/astral-sh/uv/issues/17027

See also, https://github.com/astral-sh/uv-docker-example/pull/73
2025-12-09 12:12:08 -06:00
William Woodruff 0dd71f4382
Bump ambient-id to 0.0.7 (#17048) 2025-12-09 09:08:26 -08:00
F4RAN 38ce3b2919
Add hint for misplaced `--verbose` in `uv tool run` (#17020)
Resolves #16777

## Summary
When a command fails, users sometimes add --verbose after the package
name (e.g., uvx foo --verbose) instead of before it (e.g., uvx --verbose
foo). This adds a hint that suggests moving --verbose before the
command.
The hint appears when a verbose flag is detected in the subcommand
arguments and the command fails to resolve. It works for both uvx and uv
tool run.

## Test Plan
Tested by running:
uvx foo-does-not-exist --verbose - shows the hint
uv tool run foo-does-not-exist --verbose - shows the hint
The hint only appears when verbose flags are detected, and the message
shows the correct command format.

## Screenshot
<img width="920" height="34" alt="image"
src="https://github.com/user-attachments/assets/f6c303f6-b5e6-441f-8d8d-9f5e6ab87c87"
/>

Open to feedback and happy to make changes as needed! 💯

---------

Co-authored-by: Tomasz (Tom) Kramkowski <tom@astral.sh>
2025-12-09 10:15:06 -06:00
Zanie Blue a70ee58ae1
Move test support files out of `scripts/` into `test/`
(#17032)

It's been bothering me that we have a bunch of stub packages and such in
a `scripts` directory.
2025-12-09 10:06:05 -06:00
chisato 9774f8f1d4
Fix relocatable nushell activation script (#17036)
<!--
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? -->
Nushell activation now computes the venv root dynamically via path self
for relocatable venvs, while non-relocatable venvs still embed a quoted
absolute path

Still keep `activate.csh` (maybe delete is also an option)

close https://github.com/astral-sh/uv/issues/16973

<!-- How was it tested? -->
2025-12-09 14:39:55 +00:00
Zanie Blue 77df5887e4
Add a Claude hook for formatting (#17033)
Inspired by
https://github.com/oven-sh/bun/blob/main/.claude/hooks/pre-bash-zig-build.js

This has been driving me pretty crazy and the fix is easy enough.
2025-12-08 16:57:17 +00:00
Zanie Blue 4e1469b151
Remove now unused generate tests (#17031)
I missed this in #16969
2025-12-08 15:50:40 +00:00
Zanie Blue 5a6f2ea319
Generate reference documentation at publish-time and the JSON schema at release-time (#16969)
It'd be nice to avoid churn for contributors. This is a pretty frequent
cause of CI failures and I don't think we really need to have the
reference documentation committed.
2025-12-08 12:31:38 +00:00
Charlie Marsh 28a8194a67
Respect dropped (but explicit) indexes in dependency groups (#17012)
## Summary

There are a class of outcomes whereby an index might not be included in
"allowed indexes", but could still correctly appear in a lockfile. In
the linked case, we have two `default = true` indexes, and one of them
is also named. We omit the second `default = true` index from the list
of "allowed indexes", but since it's named, a dependency can reference
it explicitly. We handle this correctly for `project.dependencies`, but
the handling was incorrectly omitting dependency groups.

Closes https://github.com/astral-sh/uv/issues/16843.
2025-12-06 14:06:46 +00:00
Zanie Blue a63e5b62e3
Bump version to 0.9.16 (#17008) 2025-12-06 07:52:06 -06:00
Charlie Marsh ed19672f1f
Bump `astral-tl` to v0.7.11 (#17010)
## Summary

This was reverted due to a hang
(https://github.com/astral-sh/uv/issues/16937) which was then resolved
upstream (https://github.com/astral-sh/astral-tl/pull/16).
2025-12-06 07:32:55 -06:00
github-actions[bot] 9635258867
Sync latest Python releases (#16943)
Automated update for Python releases.

---------

Co-authored-by: jjhelmus <1050278+jjhelmus@users.noreply.github.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-12-06 00:03:57 +00:00