Commit Graph

194 Commits

Author SHA1 Message Date
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
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
Zanie Blue 2b5d65e61d
Bump version to 0.9.17 (#17058) 2025-12-09 16:36:00 -06: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
konsti 05fa19c440
Use explicit credentials cache instead of global static (#16768)
Fixes https://github.com/astral-sh/uv/issues/16447

Passing this around explicitly uncovers some behaviors where we pass
e.g. the credentials store to reading the lockfile. The changes in this
PR should preserve the existing behavior for now, they only make the
locations we read from more explicit.

Labeling this PR as "Enhancement" instead of "Internal" in case this
changes behavior when it shouldn't have.
2025-12-03 14:51:25 +01:00
Zanie Blue e7af5838bb
Bump version to 0.9.15 (#16942) 2025-12-02 17:48:28 -06:00
Zanie Blue 99c40f74c5
Link to the uv version in crates.io member READMEs (#16939)
Closes https://github.com/astral-sh/uv/issues/16931
2025-12-02 20:02:22 +00: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
Zsolt Dollenstein 05814f9cd5
Bump version to 0.9.14 (#16909) 2025-12-01 11:52:15 -05:00
Zanie Blue 735b87004c
Bump version to 0.9.13 (#16862) 2025-11-26 15:12:54 +00:00
Zanie Blue 17c1061676
Fix the links to uv in crates.io member READMEs (#16848) 2025-11-25 18:47:32 +00:00
Zanie Blue 0fb1233363
Bump version to 0.9.12 (#16840) 2025-11-24 23:22:12 +00:00
Zanie Blue 7b8240dca9
Generate a README for crate members too (#16812)
We skip members with existing READMEs for now.

Follows #16809 and #16811
2025-11-21 15:44:05 -06:00
Zanie Blue 1de0cbea94
Use the word "internal" in crate descriptions (#16810)
ref
https://github.com/astral-sh/uv/pull/16809#pullrequestreview-3494007588
2025-11-21 13:22:47 -06:00
Zanie Blue 563438f13d
Fix documentation links for crates (#16801)
Part of https://github.com/astral-sh/uv/issues/4392

We shouldn't link to PyPI, and dropping the workspace-level
documentation link should mean that we get the auto-generated `docs.rs`
links.
2025-11-21 10:44:58 -06:00
Zanie Blue dfe89047bb
Publish to `crates.io` (#16770) 2025-11-20 21:26:44 +00:00
William Woodruff ae1edef9c0
Reject ambiguously parsed URLs (#16622)
Co-authored-by: Zanie Blue <contact@zanie.dev>
2025-11-12 16:27:57 +00:00
konsti 92c2bfcca0
Remove unnecessary `DisplaySafeUrl::from` (#16689)
For #16622
2025-11-11 19:12:20 +00:00
konsti 148b694b6b
Make `augment_requirement` a method (#16592)
Fixing the pattern so we can be consistent in
https://github.com/astral-sh/uv/pull/16143#discussion_r2479028440
2025-11-04 19:53:59 +01:00
Charlie Marsh c2100d11f3
Make cache control lookups robust to username (#16088)
## Summary

We serialize the index to the lockfile without the username, so if we
compare based on `==` and the user _includes_ the username in their
`pyproject.toml`, the check will always fail.

Closes https://github.com/astral-sh/uv/issues/16076.
2025-10-01 16:57:50 -04:00
Charlie Marsh 170ab1cd7f
Ignore origin when comparing installed tools (#16055)
## Summary

This field gets dropped when you serialize and deserialize, so we should
ignore it when comparing indexes.

Closes https://github.com/astral-sh/uv/issues/16051.
2025-09-29 17:23:18 +00:00
Charlie Marsh 7f7fac812c
Add S3 request signing (#15925)
## Summary

This PR enables users to mark a URL as an S3 endpoint, at which point uv
will sign requests to that URL by detecting credentials from the
standard AWS environment variables, configuration files, etc.

Signing is handled by the
[reqsign](https://docs.rs/reqsign/latest/reqsign/) crate, which we can
also use in the future to sign requests for other providers.
2025-09-22 23:59:52 +00:00
Frazer McLean f122387f89
Fix implied `platform_machine` marker for `win_arm64` platform tag (#15921)
<!--
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

I'm back again after #14041, this time for `win_arm64`. I [asked a
Windows on ARM
user](https://github.com/getlogbook/logbook/pull/451#issuecomment-3295513650)
what the value of `platform.machine()` is, and it's `ARM64`.

## Test Plan

Updated/added tests
2025-09-17 19:33:59 -04:00
Charlie Marsh b770639c91
Rename `provides_extras` to `provides_extra` (#15825)
## Summary

This is now consistent with `requires_dist` (singular).
2025-09-14 13:27:45 +00:00
Charlie Marsh 580bc9d079
Avoid erroring when `match-runtime` target is optional (#15671)
## Summary

If the package that has the `match-runtime` dependency itself isn't
being installed, we should avoid erroring if the package it _depends on_
isn't in the resolution.

Closes https://github.com/astral-sh/uv/issues/15661.
2025-09-04 08:34:53 -04:00
Charlie Marsh 4e48d759c4
Add zstandard support for wheels (#15645)
## Summary

This PR allows pyx to send down hashes for zstandard-compressed
tarballs. If the hash is present, then the file is assumed to be present
at `${wheel_url}.tar.zst`, similar in design to PEP 658
`${wheel_metadata}.metadata` files. The intent here is that the index
must include the wheel (to support all clients and support
random-access), but can optionally include a zstandard-compressed
version alongside it.
2025-09-03 01:38:31 +00:00
Charlie Marsh b57ad179b6
Allow registries to pre-provide core metadata (#15644)
## Summary

This PR adds support for the `application/vnd.pyx.simple.v1` content
type, similar to `application/vnd.pypi.simple.v1` with the exception
that it can also include core metadata for package-versions directly.
2025-09-03 00:56:29 +00:00
Charlie Marsh d70ea34d45
Fix settings rendering for `extra-build-dependencies` (#15622)
## Summary

This was fixed in https://github.com/astral-sh/uv/pull/15161, then
reverted as it regressed the error handling. I've re-applied the change
here, but moved the error handling to the runtime, rather than
parse-time. I think this is slightly worse in that we no longer include
the originating source code snippet, but it at least gives us the
expected behavior :(

Closes https://github.com/astral-sh/uv/issues/15124.
2025-09-02 09:06:21 -04:00
adamnemecek 9be016f3f8
refactored IndexUrl (#15613) 2025-09-01 09:28:42 +02:00
konsti 7d49571336
Rename `Dev` to `Group` internally (#15557)
The "dev" naming is a pre-PEP 735 artifact.
2025-08-27 18:35:43 +00:00
konsti 0bde9e4b8f
Read index credentials from env for `uv publish` (#15545)
We were previously missing the
`index_locations.cache_index_credentials()` call in `uv publish` to load
index credentials from the env.

See https://github.com/astral-sh/uv/issues/11836#issuecomment-3022735011
Fixes #11836
2025-08-27 11:19:10 -05:00
Charlie Marsh 615e076beb
Rename some Simple API structs (#15530)
## Summary

For clarity.
2025-08-26 13:55:58 +00:00
Charlie Marsh ef9a332364
Cache `WHEEL` and `METADATA` reads in installed distributions (#15489)
## Summary

Uses interior mutability to cache the reads. This follows the pattern we
use for reading the platform tags in `Interpreter::tags`.
2025-08-25 13:40:20 +00:00
Charlie Marsh be4d5b72aa
Reject already-installed wheels that don't match the target platform (#15484)
## Summary

We've received several requests to validate that installed wheels match
the current Python platform. This isn't _super_ common, since it
requires that your platform changes in some meaningful way (e.g., you
switch from x86 to ARM), though in practice, it sounds like it _can_
happen in HPC environments. This seems like a good thing to do
regardless, so we now validate that the tags (as recoded in `WHEEL`) are
consistent with the current platform during installs.

Closes https://github.com/astral-sh/uv/issues/15035.
2025-08-25 09:20:54 -04:00
Charlie Marsh f16760e10a
Cache PyTorch wheels by default (#15481)
## Summary

After chatting with the PyTorch team, it looks like some number of
wheels were accidentally uploaded with
`no-cache,no-store,must-revalidate` due to
https://github.com/pytorch/pytorch/pull/149218. They're going to correct
this for the respective wheels. I've encouraged them to set an immutable
caching header for these files, and it might happen. But even if this
isn't set, by default we only allow these wheels to be cached for 600s,
since the other wheels don't include a `Cache-Control` header at all
(but do include a `Last-Modified`, so we cache based on our heuristic:
`Freshness lifetime heuristically assumed because of presence of
last-modified header: 600s`). This probably leads to tons of unnecessary
downloads for users over time. Andrey from the PyTorch team agreed that
we should do this.

Closes https://github.com/astral-sh/uv/issues/15480.
2025-08-24 11:41:17 -04:00
Charlie Marsh 35a8dd514e
Import `PackageName` from `uv-normalize` (#15439)
## Summary

This might be unintentional? `PackageName` is re-exported from
`uv-pep508`, so some crates import it from there.
2025-08-21 23:15:40 +00:00
Charlie Marsh 58c7cc0e0f
Reject already-installed wheels built with outdated settings (#15289)
## Summary

With this PR, we track the settings that were used to build a wheel
(`--config-settings`, plus any `extra-build-dependencies` or
`extra-build-variables`) and write those to the `.dist-info` directory
upon install. This then allows us to "reject" already-installed wheels,
if the user changes the build dependencies or `--config-settings` (or,
crucially, if they use `match-runtime = true` and the resolution
changes).

Closes https://github.com/astral-sh/uv/issues/15218.
2025-08-15 15:15:55 +00:00
Charlie Marsh bcfa8443da
Rename `InstalledDist` methods to reflect read operation (#15290)
## Summary

I found it surprising that these don't "just" return fields from the
struct.
2025-08-14 22:39:40 +01:00
Charlie Marsh 82d5b6780a
Move `--config-settings` structs into `uv-distribution-types` (#15278)
## Summary

This breaks up a cycle I'm running into in incorporating the build
configuration into our cache keys. This is actually a type that ends up
in the frontend build system, etc., so I think it makes more sense here
anyway (as opposed to `uv-configuration` which tend to be our own
user-facing types).
2025-08-14 15:07:47 +01:00
samypr100 57df0146e2
Update Rust toolchain to 1.89 (#15157)
## Summary

Bumps Rust toolchain to 1.89, but not the MSRV.

Lifetime changes is related to a new lint rule explained in
https://blog.rust-lang.org/2025/08/07/Rust-1.89.0/#mismatched-lifetime-syntaxes-lint

## Test Plan

Existing Tests
2025-08-08 13:01:52 +00:00
Charlie Marsh 3c1844ca4a
Add support for per-project build-time environment variables (#15095)
## Summary

E.g., you can now do:

```toml
[tool.uv.extra-build-variables]
flash-attn = { FLASH_ATTENTION_SKIP_CUDA_BUILD = "TRUE" }
```
2025-08-06 18:01:55 -05:00
adamnemecek 3d3856ffd5
additional use of Self, remove * and & where not needed (#15091)
continuation of #15074.
2025-08-05 15:19:56 -05:00
Charlie Marsh bda9ea957a
Support `match-runtime = true` in the `uv pip` CLI (#15087)
## Summary

Pretty straightforward, a ~one line change plus recreating the
`BuildDispatch` (which I tried to avoid, but ran into lifetime issues).
2025-08-05 20:03:10 +00:00
Zanie Blue 1fb0fa045c
Add Python versions to markers implied from wheels (#14913)
Looking into  https://github.com/astral-sh/uv/issues/14836

This does resolve the issue, if the user adds `python_version ==
'3.8.*'` to the `required-environments`.
2025-08-05 14:52:32 -05:00
adamnemecek 3f83390e34
Make the use of `Self` consistent. (#15074)
## Summary

Make the use of `Self` consistent. Mostly done by running `cargo clippy
--fix -- -A clippy::all -W clippy::use_self`.

## Test Plan

<!-- How was it tested? -->
No need.
2025-08-05 20:17:12 +01:00
Charlie Marsh 8ef3b2eb8e
Enable extra build dependencies to 'match runtime' versions (#15036)
## Summary

This is an alternative to https://github.com/astral-sh/uv/pull/14944
that functions a little differently. Rather than adding separate
strategies, you can instead say:

```toml
[tool.uv.extra-build-dependencies]
child = [{ requirement = "anyio", match-runtime = true }]
```

Which will then enforce that `anyio` uses the same version as in the
lockfile.
2025-08-05 19:00:44 +01:00
Charlie Marsh a28c3fb7d9
Preserve lowered extra build dependencies (#15038)
## Summary

I should've noticed this during review -- my bad -- but it looks like
after lowering, we're converting back to `uv_pep508::Requirement`. This
is mostly okay, but it's lossy for some lowerings. For example, we lose
index pinning. With this PR, we now preserve the lowered types
(`Requirement`).

Closes https://github.com/astral-sh/uv/issues/15037.
2025-08-04 22:42:11 +01:00
Charlie Marsh 0a51489ec4
Remove resolved TODO in `allowed_indexes` (#14912)
## Summary

This got solved in #14858.
2025-07-26 04:04:28 +00:00
konsti 9376cf5482
Remove prioritized dist duplication (#14887)
`Candidate` has an optional field `prioritized`, which was mostly
redundant with `CandidateDist`. Specifically, it was only `None`, if
`CandidateDist` was `Installed`. This commit removes this duplication.
2025-07-25 17:18:24 +02:00