Commit Graph

572 Commits

Author SHA1 Message Date
Nicola Spieser Buiss 4e7991058b Fix UV_NO_DEFAULT_GROUPS rejecting truthy values like 1 (#18057)
## Summary

Fixes #18002.

`UV_NO_DEFAULT_GROUPS=1 uv sync` currently fails with:

```
error: invalid value '1' for '--no-default-groups'
  [possible values: true, false]
```

This is because `--no-default-groups` uses clap's default bool parser,
which only accepts `true`/`false`. Meanwhile, `--no-dev` (and
`UV_NO_DEV`) already uses `BoolishValueParser`, which accepts `1`,
`yes`, `on`, `true` (and their negatives).

## Fix

Add `value_parser = clap::builder::BoolishValueParser::new()` to all
four `--no-default-groups` argument definitions (`SyncArgs`, `RunArgs`,
`ExportArgs`, `TreeArgs`), matching the existing pattern used by
`--no-dev`.

## Test Plan

`UV_NO_DEFAULT_GROUPS=1 uv sync` should now succeed instead of erroring.

Co-authored-by: Ocean <ocean@Mac-mini-von-Ocean.local>
2026-02-18 08:47:04 -06:00
Tomasz Kramkowski 079e3fd059 Bump version to 0.10.4 (#18072) 2026-02-17 21:15:57 +00:00
Tomasz Kramkowski c75a0c625c Bump version to 0.10.3 (#18012) 2026-02-16 10:42:51 +00:00
Zanie Blue e94ea9f371 Use version constraints for default ruff version in uv format (#17977)
Change the default ruff version from a pin at `0.15.0` to a constraint
`>=0.15,<0.16`, allowing patch updates without a uv release. We'll bump
this constraint if there are no breaking formatter changes.
2026-02-13 17:00:21 -06:00
Zanie Blue d07c5cf510 Add support for ruff version constraints and exclude-newer in uv format (#17651)
I'm picking up some pretty old work here prompted by
https://github.com/astral-sh/setup-uv/pull/737 and a desire to be able
to fetch newer `python-build-standalone` versions.

Previously, we only supported a static version which means we can
construct a known GitHub asset URL trivially. However, to support the
"latest" version or version constraints, we need a registry with
metadata. The GitHub API is notoriously rate limited, so we don't want
to use that. It'd be great to use PyPI (and more broadly, the resolver),
but I don't want to introduce it in this code path yet. Instead, this
hits https://github.com/astral-sh/versions in order to determine the
available versions. We stream the NDJSON line by line to avoid
downloading the whole file in order to read one version.

Loosely requires https://github.com/astral-sh/uv/pull/17648 to reach
production and be ported to `ruff`, though it's not a blocker.
2026-02-11 10:54:01 -06:00
Tomasz Kramkowski a788db7e5d Bump version to 0.10.2 (#17958) 2026-02-10 18:21:21 +00:00
konsti b1b14d39ae Bump version to 0.10.1 (#17953) 2026-02-10 11:14:16 +00:00
Zanie Blue 0ba432459a Bump version to 0.10.0 (#17882)
Co-authored-by: Brent Westbrook <36778786+ntBre@users.noreply.github.com>
2026-02-05 20:28:44 +00:00
Zanie Blue d2ab2d0208 Stabilize Python upgrades (#17766)
Includes a few things...

- Drops preview warnings for use of `uv python upgrade` and `uv python
install --upgrade`
- Adds `--resolve-links` to `uv python find`, which I needed in test
cases to retain existing snapshots
- Fixes issues in our "Using environment ..." messages on Windows which
were incorrect
- Refactors `from_executable` for the `PythonMinorVersionLink` type
(https://github.com/astral-sh/uv/pull/17842/commits/28b2ed2525327d94fdf5372a29bbbc476d74680f)
to use the type system to prevent incorrect construction (for above)
- Removes special casing where we only upgrade links if they already
exist, which existed so preview wasn't needed on every invocation
- Fixes a bug with `PythonMinorVersionLink::exists` which returned
`true` even if the link pointed to the wrong Python installation leading
to discovery failures
2026-02-05 11:52:18 -06:00
Zanie Blue ea4560831e Bump version to 0.9.30 (#17865) 2026-02-04 21:18:04 +00:00
Zanie Blue d44e65e9ed Use relocatable virtual environments by default (#17770)
Under the `relocatable-envs-default` preview feature

See #13994
2026-02-04 14:30:34 +00:00
liam 30e2c2b57d Allow comma-separated values in uv sync --extra (#17525)
Resolves (partially) https://github.com/astral-sh/uv/issues/17511

This diff enables comma-separated values for `--extra`, allowing `uv
sync --extra foo,bar` as an alternative to `uv sync --extra foo --extra
bar`.
2026-02-04 11:09:25 +00:00
Zanie Blue 1f1321d842 Bump version to 0.9.29 (#17837) 2026-02-03 13:06:01 -06:00
William Woodruff fc0db7927a Hide a subset of environment variable values in --help (#17745) 2026-01-30 01:58:26 +01:00
Zanie Blue 0e1351e400 Bump version to 0.9.28 (#17738) 2026-01-29 13:51:05 -06:00
Zanie Blue b5797b2ab4 Bump version to 0.9.27 (#17706) 2026-01-26 22:38:10 +00:00
Tomasz Kramkowski 6e3ba2f03d Introduce PreviewFeature to clarify intent throughout the codebase (#17670)
## Summary

This PR replaces `bitflags` in favour of `enumflags2` (which we already
transitively depended on) so that `PreviewFeatures` can be replaced with
`PreviewFeature` which is an enum. This clarifies intent in cases where
we only care about one specific `PreviewFeature`.

To avoid a bunch of boilerplate changes, the `Preview` wrapper has been
kept and creation now involves a `&[PreviewFeature]` in all cases. The
alternative was to have everything which initialises a `Preview` use
`BitFlags` directly and possibly to remove `Preview` entirely but this
keeps things simpler and limits the changes throughout the rest of the
codebase solely to changes which deal with the name changes (ALL_CAPS to
PascalCase) and the impact on `--show-settings` which I don't believe we
care about stability of output for?

The changes to `--show-settings` could be avoided with some custom
`Debug` implementation but that seems excessive.

This PR will impact #16452. But the changes were inspired by trying to
remove the need for that particular PR to add more runtime type
checking.

## Test Plan

Existing tests were adjusted (I also fixed some missing cases). The test
for panicking in cases which are now prevented through the use of type
changes has been dropped. All the rest of the tests were ran, snapshot
changes reviewed and applied.
2026-01-23 17:19:23 +00:00
Zanie Blue 3e22637c93 Use #[expect(clippy::...)] throughout and drop unused supressions (#17537)
Co-authored-by: Claude <noreply@anthropic.com>
2026-01-20 21:52:06 +00:00
Tobias Gårdhus e2095b987a Implement uv pip freeze --exclude flag (#17045)
## Summary

Implements the `--exclude` flag to `uv pip freeze`, which allows to
filter unwanted dependencies from the resulting requirements.txt file.

```bash
uv pip freeze --exclude pandas
```

part of https://github.com/astral-sh/uv/issues/3141


## Test Plan

Unit test with simple exclusion example of command argument(s)
2026-01-17 09:34:32 -06:00
Yusuf Bham 8a02f6352a Add -t shortform for --target to uv pip subcommands (#17501)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

This adds `-t` to `uv pip` to preserve drop-in compatibility with pip's
`-t` shortform

Closes #17495

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

## Test Plan
Just interactively checked to make sure it works in the same places as
`--test`
```bash
uv pip install -t test ansible
uv pip list -t test
echo 'ansible' > requirements.txt
uv pip sync -t test requirements.txt
```
2026-01-16 07:50:43 -06:00
Zanie Blue ee4f003628 Bump version to 0.9.26 (#17496) 2026-01-15 14:25:54 -06:00
Zanie Blue 490b7f322e Add --no-sources-package (#14910)
I needed this for a test, e.g., to disable a source for an extra build
dependency without disabling the source for a workspace member, and had
also seen some requests for it. I think it makes sense to allow this.

The refactor is fairly mechanical, we go from
`SourceStrategy::Enabled|Disabled` to
`NoSources::All|None|Package(names)` as we do for other options like
`NoBinary`.

Related https://github.com/astral-sh/uv/issues/17441
2026-01-15 13:53:42 -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 38fcac0f36 Bump version to 0.9.25 (#17449) 2026-01-13 16:55:34 -06: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
Tomasz Kramkowski 4513797f46 Add --compile-bytecode to uv python install and uv python upgrade to compile the standard library (#17088)
## Summary

Implement #16408.

Currently doesn't avoid recompiling the bytecode when it is already
compiled which should be fine since the compiler script skips things
which are already compiled.

pyodide is currently unsupported due to it using a zip for its standard library
and also because it misreports the location of the standard library.

## Test Plan

Styling of the status report was manually tested, there is a new test
for testing the actual functionality.
2026-01-12 09:31:33 +00:00
Zanie Blue 0fda1525eb Bump version to 0.9.24 (#17395) 2026-01-09 22:09:11 +00:00
Zanie Blue 00f07541a1 Bump version to 0.9.23 (#17385) 2026-01-09 19:09:04 +00:00
Charlie Marsh 85dedc8051 Enable uploads via pre-signed URLs (#17349)
## Summary

For pyx, we can allow uploads that bypass the registry and send the file
directly to S3. This is an opt-in feature, enabled via the `--direct`
flag.
2026-01-08 21:26:34 -05:00
Charlie Marsh cd55d1ce12 Manually parse and reconcile Boolean environment variables (#17321)
## Summary

This gives us more flexibility since we can avoid erroring on
"conflicts" when one option is disabled (e.g., `UV_FROZEN=0 uv lock
--check`).

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

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

---------

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-06 20:43:04 +00:00
konsti 82a6a66b81 Bump version to 0.9.22 (#17333)
There's a hyper-util bump to get out separate from other reqwest related
changes.
2026-01-06 11:23:12 +01:00
Zanie Blue 0dc9556adb Bump version to 0.9.21 (#17270) 2025-12-30 15:46:08 +00:00
Zanie Blue 8c429c8fb8 Fix typo in python install --default documentation (#9826)
Signed-off-by: William Woodruff <william@astral.sh>
Co-authored-by: William Woodruff <william@astral.sh>
2025-12-29 18:54:50 -05:00
Charlie Marsh 765a967236 Bump version to 0.9.20 (#17256)
## Summary

In #17254, I failed to bump the versions of the various internal crates,
so need to re-release.
2025-12-29 20:13:57 +00:00
Zanie Blue a0a14b17ec Support comma-separated values in --no-binary and --only-binary (#17185)
Closes #17181

Co-authored-by: Claude <noreply@anthropic.com>
2025-12-19 07:58:35 -06:00
Charlie Marsh 6578e0521b Avoid creating file contents with uv init --bare --script (#17162)
## Summary

As suggested in Discord.
2025-12-17 15:26:17 +00:00
Charlie Marsh 0a83bf7dd5 Respect --torch-backend in uv tool commands (#17117)
## Summary

Like `uv pip`, these don't require a universal resolution, so
`--torch-backend` is easy to support.
2025-12-16 19:23:50 -05: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
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
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
Zanie Blue 2b5d65e61d Bump version to 0.9.17 (#17058) 2025-12-09 16:36:00 -06: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 a63e5b62e3 Bump version to 0.9.16 (#17008) 2025-12-06 07:52:06 -06:00
Zanie Blue f6ad3dcd57 Regenerate the crates.io readmes on release (#16992)
Otherwise, they're stale!
2025-12-04 19:19:36 -06:00
Zsolt Dollenstein 0c5391a7c7 Add a uv auth helper --protocol bazel command (#16886) 2025-12-04 18:56:57 +00:00
Oshadha Gunawardena 2abe56a357 Clarify --project flag help text to indicate project discovery (#16965)
Clarify `--project` flag help text to indicate project discovery

  Update the help text for `--project` from "Run the command within
  the given project directory" to "Discover a project in the given
  directory" to better reflect its actual behavior.

  The `--project` flag affects file discovery (pyproject.toml, uv.toml,
  etc.) but does not change the working directory. Users should use
  `--directory` for changing the working directory.

  Fixes #16718
2025-12-03 12:15:36 -06:00
Tomasz Kramkowski 2f553bfc51 Add a stub debug subcommand to uv pip announcing its intentional absence (#16966)
## Summary

Inform users who encounter #16879 that `uv pip debug` is currently
intentionally not implemented.

## Test Plan

Added an integration test for the warning, ran the test suite.
2025-12-03 16:10:21 +00:00
Charlie Marsh 49b70e7225 Support --target and --prefix in uv pip list, uv pip freeze, and uv pip show (#16955)
## Summary

Closes https://github.com/astral-sh/uv/issues/15112.
2025-12-03 06:49:11 -06:00
Zanie Blue e7af5838bb Bump version to 0.9.15 (#16942) 2025-12-02 17:48:28 -06:00