Commit Graph

1234 Commits

Author SHA1 Message Date
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
Zanie Blue a63e5b62e3
Bump version to 0.9.16 (#17008) 2025-12-06 07:52:06 -06:00
Zanie Blue 8390b311f8
Update the versioning policy to retain the minor breaking scheme indefinitely (#16710) 2025-12-05 09:05:46 -06:00
konsti 62bf92132b
Add a 5 min default timeout for deadlocks (#16342)
When a process is running and another calls `uv cache clean` or `uv
cache prune` we currently deadlock - sometimes until the CI timeout
(https://github.com/astral-sh/setup-uv/issues/588). To avoid this, we
add a default 5 min timeout waiting for a lock. 5 min balances allowing
in-progress builds to finish, especially with larger native
dependencies, while also giving timely errors for deadlocks on (remote)
systems.

Commit 1 is a refactoring.

This branch also fixes a problem with the logging where acquired and
released resources currently mismatch:

```
DEBUG Acquired lock for `https://github.com/tqdm/tqdm`
DEBUG Using existing Git source `https://github.com/tqdm/tqdm`
DEBUG Released lock at `C:\Users\Konsti\AppData\Local\uv\cache\git-v0\locks\16bb813afef8edd2`
```
2025-12-04 14:59:04 +01: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
Matthijs Kok 539b7368cd
Update Docker integration guide to prefer `COPY` over `ADD` for simple cases (#16883)
## Summary

Docker best practices recommend to use `COPY` when the additional
functionality of `ADD` is not used.

See:
- https://docs.docker.com/build/building/best-practices/#add-or-copy
-
https://www.docker.com/blog/docker-best-practices-understanding-the-differences-between-add-and-copy-instructions-in-dockerfiles/

## Test Plan

Docs only change
2025-12-03 15:16:42 +00:00
Charlie Marsh 99660a8574
Upgrade PyTorch documentation to latest versions (#16970)
## Summary

Point to PyTorch 2.9, Python 3.14, CUDA 12.8, etc.
2025-12-03 07:01:49 -08:00
Matthew Woolf 20ab80ad8f
Update pytorch.md to include information about supporting CUDA 13.0.x (#16957)
## Summary

This change updates the guide about integration with pytorch to include
the CUDA 13.0 variant.

## Test Plan

I generated the documentation and verified that it looked correct.
2025-12-03 06:47:57 -08: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
samypr100 ed63be5dab
chore(🧹): const env var usage cleanup (#16950)
## Summary

* Updates existing references to use EnvVars where usage was missing.
* Adds missing entries to env var usages, e.g. new env var declarations
in uv-trampoline, tests, etc.
* Note: this doesn't affect trampoline sizes as the end result is the
same
* Fixes versioning of `UV_HIDE_BUILD_OUTPUT`.

## Test Plan

Existing Tests. Compiled the trampolines locally to verify zero changes
(size, binary).

## Question

Will this complicate the crates publishing release process? I'm not
certain yet if it will be an issue for uv-trampoline (non-workspace
member) to reference a uv workspace member from a bump & release
perspective wrt lock files. If so, I'll revert the uv-trampoline changes
but keep the others.
2025-12-02 22:16:46 -08:00
Charlie Marsh eb65f9ff74
Add `UV_HIDE_BUILD_OUTPUT` to omit build logs (#16885)
## Summary

Closes #16804.
2025-12-02 16:43:01 -08:00
Zanie Blue e7af5838bb
Bump version to 0.9.15 (#16942) 2025-12-02 17:48:28 -06:00
samypr100 fee7f9d093
Support Git LFS with opt-in (#16143)
## Summary

Follow up to https://github.com/astral-sh/uv/pull/15563
Closes https://github.com/astral-sh/uv/issues/13485

This is a first-pass at adding support for conditional support for Git
LFS between git sources, initial feedback welcome.

e.g.
```
[tool.uv.sources]
test-lfs-repo = { git = "https://github.com/zanieb/test-lfs-repo.git", lfs = true }
```

For context previously a user had to set `UV_GIT_LFS` to have uv fetch
lfs objects on git sources. This env var was all or nothing, meaning you
must always have it set to get consistent behavior and it applied to all
git sources. If you fetched lfs objects at a revision and then turned
off lfs (or vice versa), the git db, corresponding checkout lfs
artifacts would not be updated properly. Similarly, when git source
distributions were built, there would be no distinction between sources
with lfs and without lfs. Hence, it could corrupt the git, sdist, and
archive caches.

In order to support some sources being LFS enabled and other not, this
PR adds a stateful layer roughly similar to how `subdirectory` works but
for `lfs` since the git database, the checkouts and the corresponding
caching layers needed to be LFS aware (requested vs installed). The
caches also had to isolated and treated entirely separate when handling
LFS sources.

Summary
* Adds `lfs = true` or `lfs = false` to git sources in pyproject.toml
* Added `lfs=true` query param / fragments to most relevant url structs
(not parsed as user input)
  * In the case of uv add / uv tool, `--lfs` is supported instead
* `UV_GIT_LFS` environment variable support is still functional for
non-project entrypoints (e.g. uv pip)
* `direct-url.json` now has an custom `git_lfs` entry under VcsInfo
(note, this is not in the spec currently -- see caveats).
* git database and checkouts have an different cache key as the sources
should be treated effectively different for the same rev.
* sdists cache also differ in the cache key of a built distribution if
it was built using LFS enabled revisions to distinguish between non-LFS
same revisions. This ensures the strong assumption for archive-v0 that
an unpacked revision "doesn't change sources" stays valid.

Caveats
* `pylock.toml` import support has not been added via git_lfs=true,
going through the spec it wasn't clear to me it's something we'd support
outside of the env var (for now).
* direct-url struct was modified by adding a non-standard `git_lfs`
field under VcsInfo which may be undersirable although the PEP 610 does
say `Additional fields that would be necessary to support such VCS
SHOULD be prefixed with the VCS command name` which could be interpret
this change as ok.
* There will be a slight lockfile and cache churn for users that use
`UV_GIT_LFS` as all git lockfile entries will get a `lfs=true` fragment.
The cache version does not need an update, but LFS sources will get
their own namespace under git-v0 and sdist-v9/git hence a cache-miss
will occur once but this can be sufficient to label this as breaking for
workflows always setting `UV_GIT_LFS`.

## Test Plan

Some initial tests were added. More tests likely to follow as we reach
consensus on a final approach.

For IT test, we may want to move to use a repo under astral namespace in
order to test lfs functionality.

Manual testing was done for common pathological cases like killing LFS
fetch mid-way, uninstalling LFS after installing an sdist with it and
reinstalling, fetching LFS artifacts in different commits, etc.

PSA: Please ignore the docker build failures as its related to depot
OIDC issues.

---------

Co-authored-by: Zanie Blue <contact@zanie.dev>
Co-authored-by: konstin <konstin@mailbox.org>
2025-12-02 12:23:51 +00:00
Charlie Marsh 2cdbf9e547
Add ROCm 6.4 to `--torch-backend=auto` (#16919)
## Summary

Closes https://github.com/astral-sh/uv/issues/16917.
2025-12-01 20:27:20 -05:00
Zsolt Dollenstein 05814f9cd5
Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
Charlie Marsh 0ae54dbd8a
Use `UV_WORKING_DIR` for consistency (#16884)
## Summary

Closes https://github.com/astral-sh/uv/issues/16870.
2025-11-30 15:59:05 +00:00
my1e5 7ca92dcf66
Bump setup-uv action to v7 in docs (#16858)
## Summary

Bumps the setup-uv action to v7 in the GitHub Actions integration docs.

## Test Plan

Built the documentation.
2025-11-26 16:15:02 +01:00
Zanie Blue 735b87004c
Bump version to 0.9.13 (#16862) 2025-11-26 15:12:54 +00:00
Zanie Blue 0fb1233363
Bump version to 0.9.12 (#16840) 2025-11-24 23:22:12 +00:00
William Woodruff 7b3199f07c
Collect and upload PEP 740 attestations during `uv publish` (#16731)
Co-authored-by: konsti <konstin@mailbox.org>
2025-11-24 16:47:15 -05:00
Zanie Blue 4b92f4fde4
Move the "Export" guide to the projects concept section (#16835)
I consider this a bit too advanced to be in the top-level guides
2025-11-24 10:39:52 -06:00
Zanie Blue 666059bd88
Add documentation for intermediate Docker layers in a workspace (#16787) 2025-11-24 15:22:27 +00:00
Zanie Blue d3a9455998
Update the cargo install recommendation to use crates (#16800) 2025-11-20 20:05:46 -06:00
Zanie Blue 4be1e0a83c
Bump version to 0.9.11 (#16794) 2025-11-20 16:24:01 -06:00
Zanie Blue dfe89047bb
Publish to `crates.io` (#16770) 2025-11-20 21:26:44 +00:00
Zanie Blue 5eda329e5a
Improve note about build system in publish guide (#16788)
Addresses
https://github.com/astral-sh/uv/issues/5605#issuecomment-3549958048
2025-11-20 13:59:59 -06:00
Zanie Blue 75bd2ea0c5
Move do not upload publish note out of the guide into concepts (#16789)
This feels a little out of place here and it seems nice to be able to
link to it.
2025-11-20 12:33:15 -06:00
Tom Schafer fd7e6d0a05
Add SBOM export support (#16523)
Co-authored-by: Will Rollason <william.rollason@snyk.io>
2025-11-20 12:52:31 -05:00
pythonweb2 7d8634bf35
Document the new behavior for free-threaded python versions (#16781)
## Summary

I noticed that after first installing the free-threaded version, then
the gil version of 3.14, I wasn't able
to install greenlet, because it doesn't ship with wheels for the
free-threaded version (I think it isn't
safe for it to use that interpreter). I noticed that the change made in
3.14 wasn't updated in the docs.

## Test Plan

N/A

---------

Co-authored-by: Wade Roberts <wade.roberts@centralsquare.com>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-11-20 08:58:49 -06:00
Zanie Blue 3ac43e8d15
Disable always-authenticate when running under Dependabot (#16773)
Dependabot appears to run a proxy which intercepts all requests and adds
credentials — credentials are _not_ provided via the CLI or environment
variables and there's no way for a user to do so. This means that when
`authenticate = "always"` is used (or when the index URL is on a pyx
domain), uv will fail even though Dependabot may intercept the request
and add credentials.

See
https://github.com/dependabot/dependabot-core/#private-registry-credential-management
2025-11-18 15:43:44 -06:00
Zanie Blue cda7fc3fda
Revert "Fix CMD path in FastAPI Dockerfile (#16701)" (#16752)
This reverts commit 92230ba679 from #16701

See https://github.com/astral-sh/uv/pull/16701#issuecomment-3538541379
2025-11-17 13:17:27 -06:00
konsti 44f5a14f40
Bump version to 0.9.10 (#16762)
Motivated by https://github.com/astral-sh/uv/pull/16759

Doesn't contain https://github.com/astral-sh/uv/pull/16752, but that one
doesn't seem critical
2025-11-17 16:29:14 +00:00
Zanie Blue 07e03ee776
Add `uv workspace list` to list workspace members (#16691)
I'm a little wary here, in the sense that it might be silly to have a
command that does something so simple that's covered by `uv workspace
metadata`? but I think this could be stabilized much faster than `uv
workspace metadata` and makes it easier to write scripts against
workspace members.

---------

Co-authored-by: liam <liam@scalzulli.com>
2025-11-17 09:35:50 -06:00
Zsolt Dollenstein 6f525f9462
Add a "storage" reference document (#15954)
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-11-17 09:38:14 -05:00
samypr100 bf99f0a195
Add support for SSL_CERT_DIR (#16473)
## Summary

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

Adds support for the standard
[SSL_CERT_DIR](https://docs.openssl.org/3.6/man3/SSL_CTX_load_verify_locations)
which has gained recent proper support from
[rustls-native-certs](https://github.com/rustls/rustls-native-certs/pull/187)
in v0.8.2.

In addition, this PR clarifies documentation around `SSL_CERT_FILE` and
`SSL_CERT_DIR` when used in combination with `UV_NATIVE_TLS` as
mentioned in
https://github.com/astral-sh/uv/issues/16412#issuecomment-3434927201

## Test Plan

Manually tested with custom cert chains in multiple directories and
loading them via SSL_CERT_DIR. We didn't have tests for `SSL_CERT_FILE`
or `SSL_CERT_DIR` environment variables so I added a basic one using our
own test-only certificate generation and dummy https server. I also
moved some things around for better reuse.
2025-11-16 11:48:31 -06:00
Meitar Reihan b9826778b9
Support http/https URLs in `uv python --python-downloads-json-url` (#16542)
continuation PR based on #14687

---------

Co-authored-by: Geoffrey Thomas <geofft@ldpreload.com>
Co-authored-by: Aria Desires <aria.desires@gmail.com>
2025-11-14 17:51:24 -05:00
Meitar Reihan 7f4d8c67a8
Account for `python_downloads_json_url` on Pre-release Python version warnings (#16737)
Solves #16711
2025-11-14 15:12:35 -06:00
Zanie Blue f5ce5b47c8
Add support for `--upgrade` in `uv python install` (#16676)
This allows us to suggest `uv python install --upgrade 3.14` as the
canonical way to get the latest patch version of a given Python
regardless of whether it is installed already. Currently, you can do `uv
python upgrade 3.14` and it will install it, but I'd like to remove that
behavior as I find it very surprising.
2025-11-13 09:55:48 -06:00
Mikayla Thompson 88811553e4
`pip install --target` (and `sync`) install python if necessary (#16694)
## Summary

As described in https://github.com/astral-sh/uv/issues/12229, `pip
install` with `--target` or `--prefix` seem like they should install the
necessary python version if it doesn't exist, but they currently don't.

Most minimal reproduction is something like:
```
> uv python uninstall 3.13
...
> uv pip install anyio --target target-dir --python 3.13
error: No interpreter found for Python 3.13 in virtual environments, managed installations, or search path
```

This also fails without `--target`, but a venv is expected in that case,
so the with `--target`/`--prefix` is the only version that needs to be
fixed. The same mechanism occurs for `uv pip sync` as well.

## Test Plan

Added tests for install and sync that failed before fix and now pass.

---------

Signed-off-by: Mikayla Thompson <mrt@mikayla.codes>
2025-11-12 15:42:52 -07:00
Zanie Blue 4fac4cb7ed
Bump version to 0.9.9 (#16708) 2025-11-12 18:14:44 +00:00
Charlie Marsh 2c0d166260
Add `only-emit-workspace` and similar variants to `uv export` (#16681)
## Summary

This is useful for scenarios in which you want to emit the workspace
dependencies, but nothing else.
2025-11-12 16:51:45 +00:00
jspablo 92230ba679
Fix CMD path in FastAPI Dockerfile (#16701)
<!--
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 suggestion for uv when used with FastAPI and Docker.

## Test Plan

The Dockerfile sets `/app` as workdir, later the CMD command points
again to `app/main.py` instead of only `main.py`, causing the following
error:
```
Path does not exist app/main.py
```
2025-11-12 07:39:14 -06:00
Mikayla Thompson b81060674e
`workspace dir` command (#16678)
Addresses https://github.com/astral-sh/uv/issues/13636

Prints the path to the workspace root by default, and any of the child
packages if requested.

I looped it into the same preview flag as `workspace metadata`, given
how closely related they are.

## Summary

```
─> uv workspace dir
/Users/mikayla/code/uv/dev-envs

─> uv workspace dir --package foo-proj
/Users/mikayla/code/uv/dev-envs/foo-proj

─> uv workspace dir --package bar-proj
error: Package `bar-proj` not found in workspace.
```

## Test Plan

Unit tests added.

---------

Signed-off-by: Mikayla Thompson <mrt@mikayla.codes>
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-11-11 12:30:39 -07:00
liam 63ab247765
Allow explicit values with `uv version --bump` (#16555)
Resolves https://github.com/astral-sh/uv/issues/16427

This PR updates `uv version --bump` so you can pin the exact number
you’re targeting, i.e. `--bump patch=10` or `--bump dev=42`. The
command-line interface now parses those `component=value` flags, and the
bump logic actually sets the version to the number you asked for.
2025-11-11 12:27:32 -05:00
Zanie Blue 3ccad58166
Add `uv workspace metadata` (#16516)
This adds the scaffolding for a `uv workspace metadata` command, as an
equivalent to `cargo metadata`, for integration with downstream tools. I
didn't do much here beyond emit the workspace root path and the paths of
the workspace members. I explored doing a bit more in #16638, but I
think we're actually going to want to come up with a fairly
comprehensive schema like `cargo metadata` has. I've started exploring
that too, but I don't have a concrete proposal to share yet.

I don't want this to be a top-level command because I think people would
expect `uv metadata <PACKAGE>` to show metadata about arbitrary packages
(this has been requested several times). I also think we can do other
things in the workspace namespace to make trivial integrations simpler,
like `uv workspace list` (enumerate members) and `uv workspace dir`
(show the path to the workspace root).

I don't expect this to be stable at all to start. I've both gated it
with preview and hidden it from the help. The intent is to merge so we
can iterate on it as we figure out what integrations need.
2025-11-11 15:46:01 +00:00
Mikayla Thompson f22af0f88a
Deprecate `--project` arg for init (#16674)
Addresses https://github.com/astral-sh/uv/issues/15790

## Summary

After discussion, the functionality of `--project` vs `--directory` was
quite unclear in this case, so deprecating `--project` for `init` is
probably the clearest behavior option. This is a breaking change, so it
requires being under preview before being rolled out fully.

Included in the PR now:
- new feature flag (`init --project` is deprecated if `--preview` or
`--preview-features deprecate-project-for-init` are provided)
- tests (for `--directory` behavior, as well as the current warning and
future error)
- documentation updated in docs/concepts/projects/init.md

---------

Signed-off-by: Mikayla Thompson <mrt@mikayla.codes>
2025-11-10 16:33:08 -07:00
Mathieu Kniewallner 9a21897f3d
feat(cli): expose `UV_NO_DEFAULT_GROUPS` environment variable (#16645)
<!--
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

Similarly to #16529 that adds `UV_NO_GROUP`, this adds
`UV_NO_DEFAULT_GROUPS` that does the same as `--no-default-groups`. This
can be useful on the CI, to disable default groups on a job without
having to set the argument in all commands that could trigger a sync
(for instance
[here](8757b318e9/.github/workflows/main.yml (L105-L116))).

## Test Plan

Snapshot tests.

---------

Co-authored-by: samypr100 <3933065+samypr100@users.noreply.github.com>
2025-11-10 14:43:48 -06:00
Zanie Blue 85c5d32284
Bump version to 0.9.8 (#16636) 2025-11-07 11:45:22 -06:00
Haaris Rahman e5c10cd45d
Fix typo in uv tool list doc (#16625)
<!--
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


Fixed a typo in the docs.

Regenerated the docs, with the fix.


<!-- What's the purpose of the change? What does it do, and why? -->
2025-11-06 22:06:17 -06:00
Charlie Marsh 5fe8af114b
Accept multiple packages in `uv export` (#16603)
## Summary

Closes https://github.com/astral-sh/uv/issues/16503.
2025-11-05 22:52:22 +00:00