1144 Commits

Author SHA1 Message Date
Zanie Blue
6d3614eece Bump version to 0.6.2 (#11630) 2025-02-19 13:11:11 -06:00
konsti
29c2be3e97 Eagerly reject unsupported Git schemes (#11514)
Initially, we were limiting Git schemes to HTTPS and SSH as only
supported schemes. We lost this validation in #3429. This incidentally
allowed file schemes, which apparently work with Git out of the box.

A caveat for this is that in tool.uv.sources, we parse the git field
always as URL. This caused a problem with #11425: repo = { git =
'c:\path\to\repo', rev = "xxxxx" } was parsed as a URL where c: is the
scheme, causing a bad error message down the line.

This PR:

* Puts Git URL validation back in place. It bans everything but HTTPS,
SSH, and file URLs. This could be a breaking change, if users were using
a git transport protocol were not aware of, even though never
intentionally supported.
* Allows file: URL in Git: This seems to be supported by Git and we were
supporting it albeit unintentionally, so it's reasonable to continue to
support it.
* It does not allow relative paths in the git field in tool.uv.sources.
Absolute file URLs are supported, whether we want relative file URLs for
Git too should be discussed separately.

Closes #3429: We reject the input with a proper error message, while
hinting the user towards file:. If there's still desire for relative
path support, we can keep it open.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2025-02-18 02:14:06 +00:00
Zanie Blue
c91ee82a82 Bump version to 0.6.1 (#11580) 2025-02-17 11:57:47 -06:00
konsti
90e9287dd8 Warn for builds in non-build and workspace root pyproject.toml (#11394)
When running `uv pip install .` in a directory with a pyproject.toml
that does not configure a build, we will invoke setuptools and get a
wheel we can't parse (https://github.com/astral-sh/uv/issues/11344).
This PR adds warnings around these setups.

---------

Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2025-02-17 15:57:18 +00:00
konsti
248da23f6d Split uv-git and uv-git-types (#11448)
We want to build `uv-build` without depending on the network crates. In
preparation for that, we split uv-git into uv-git and uv-git-types,
where only uv-git depends on reqwest, so that uv-build can use
uv-git-types.
2025-02-17 10:37:55 +01:00
renovate[bot]
e21f793a1f Update Rust crate clap to v4.5.29 (#11564) 2025-02-16 22:04:13 -05:00
renovate[bot]
39b28b210c Update Rust crate tempfile to v3.17.0 (#11570) 2025-02-16 21:49:47 -05:00
renovate[bot]
040ee26531 Update Rust crate smallvec to v1.14.0 (#11569) 2025-02-16 21:49:34 -05:00
renovate[bot]
fbed410c53 Update Rust crate jiff to 0.2.0 (#11568) 2025-02-16 21:49:21 -05:00
renovate[bot]
8c6792ebe0 Update Rust crate codspeed-criterion-compat to v2.8.0 (#11567) 2025-02-16 21:49:14 -05:00
renovate[bot]
4a8fc5df91 Update Rust crate toml_edit to v0.22.24 (#11565) 2025-02-16 21:49:03 -05:00
Zanie Blue
591f38c25e Bump version to v0.6.0 (#11496)
Co-authored-by: Charlie Marsh <charlie.r.marsh@gmail.com>
2025-02-14 11:55:54 -06:00
Charlie Marsh
4d5041dc00 Use files instead of junctions on Windows (#11269)
Instead of using junctions, we can just write files that contain (as the
file contents) the target path. This requires a little more finesse in
that, as readers, we need to know where to expect these. But it also
means we get to avoid junctions, which have led to a variety of
confusing behaviors. Further, `replace_symlink` should now be on atomic
on Windows.

Closes #11263.
2025-02-13 16:17:49 -06:00
Charlie Marsh
ceb22fcfe5 Support --active for PEP 723 script environments (#11433)
## Summary

See: https://github.com/astral-sh/uv/pull/11361#discussion_r1948851085
2025-02-13 13:40:21 -06:00
Zanie Blue
e38ac4900d Bump version to 0.5.31 (#11459) 2025-02-12 14:45:22 -06:00
Charlie Marsh
1cd9c37151 Use stable environments for remote and stdin scripts (#11364)
## Summary

This is a follow-on to #11347 to use a stable directory for remote and
stdin scripts. The annoying piece here was figuring out what to use as
the cache key. For remote scripts, I'm using the URL; for stdin scripts,
there isn't any identifying information, so I'm just using a hash of the
metadata.
2025-02-12 00:54:46 +00:00
Charlie Marsh
ca49495e4b Bump version to v0.5.30 (#11405) 2025-02-10 21:42:31 +00:00
renovate[bot]
cbb94e40b3 Update Rust crate mailparse to 0.16.0 (#11375) 2025-02-10 02:40:08 +00:00
renovate[bot]
9f7b344b88 Update Rust crate rustc-hash to v2.1.1 (#11369) 2025-02-10 02:21:03 +00:00
renovate[bot]
eb19d471f4 Update Rust crate data-encoding to v2.8.0 (#11374) 2025-02-10 02:16:51 +00:00
renovate[bot]
534b1a3bc9 Update Rust crate which to v7.0.2 (#11372) 2025-02-10 01:46:29 +00:00
renovate[bot]
f7649bcfcb Update Rust crate toml to v0.8.20 (#11371) 2025-02-10 01:43:14 +00:00
renovate[bot]
d4b357d40b Update Rust crate target-lexicon to v0.13.2 (#11370) 2025-02-10 01:40:28 +00:00
renovate[bot]
dbdeaf28ee Update Rust crate clap to v4.5.28 (#11368) 2025-02-09 20:33:16 -05:00
renovate[bot]
9db3034b5d Update Rust crate bytecheck to v0.8.1 (#11367) 2025-02-09 20:33:08 -05:00
renovate[bot]
3d8b01a10e Update Rust crate boxcar to v0.2.9 (#11366) 2025-02-09 20:33:01 -05:00
Charlie Marsh
1b2125712e Upgrade astral-tokio-tar to v0.5.1 (#11359)
## Summary

Pulling in https://github.com/astral-sh/tokio-tar/pull/40.

Closes https://github.com/astral-sh/uv/issues/2235.
2025-02-09 14:14:47 -05:00
Zanie Blue
ca73c47543 Bump version to 0.5.29 (#11267) 2025-02-05 19:59:29 -05:00
Charlie Marsh
c0f6406c76 Migrate to published astral-tokio-tar crate (#11260)
We now publish this to `crates.io`:
https://crates.io/crates/astral-tokio-tar
2025-02-05 15:43:33 -05:00
Jo
6f8d9b85d8 Remove cachedir dependency (#11240)
## Summary

Vendor the `HEADER` constant too so we can eliminate the dependency on
`cachedir`.
2025-02-05 08:54:02 -05:00
Charlie Marsh
fea00dcdd5 Bump version to v0.5.28 (#11228) 2025-02-04 20:28:43 -05:00
konsti
ac1004284a Fix hardlinks in tar unpacking (#11221)
In https://github.com/astral-sh/tokio-tar/pull/2, we accidentally
changed the `target_base` from the target base to the parent of the
file. This would cause hardlink unpacking to fail.

Example: A hardlink at `hardlinked-0.1.0/pyproject.toml` pointing to
`hardlinked-0.1.0/pyproject.toml.real` would try pointing to
`hardlinked-0.1.0/hardlinked-0.1.0/pyproject.toml.real` instead and fail
the unpacking.

The actual fix is in astral-tokio-tar, on the uv side there are only tests.

Fixes #11213
2025-02-04 17:38:22 +00:00
Zanie Blue
73e9928d40 Bump version to 0.5.27 (#11201) 2025-02-03 16:55:36 -06:00
Zanie Blue
dd7cd2e86a Remove warnings for missing lower bounds (#11195)
These are noisy relative to the effect they have on the user. It seems
better to prioritize hints on poor resolutions. Notably, it seems hard
to make these "not noisy" ref #11091.

Does not include the "lowest" resolution mode, in which lower bounds are
critical.
2025-02-03 16:03:31 -06:00
Charlie Marsh
85461c2c90 Avoid setting permissions during tar extraction (#11191)
## Summary

As in our zip operation (and like pip), we want to explicitly avoid
setting permissions during unpacking -- apart from setting the
executable bit.

This depends on https://github.com/astral-sh/tokio-tar/pull/8.

Closes https://github.com/astral-sh/uv/issues/11188.
2025-02-03 19:29:11 +00:00
Charlie Marsh
7b43baf251 Use Astral-maintained tokio-tar fork (#11174)
## Summary

I shipped one security fix here along with several significant
performance improvements for large TAR files:

- https://github.com/astral-sh/tokio-tar/pull/2
- https://github.com/astral-sh/tokio-tar/pull/4
- https://github.com/astral-sh/tokio-tar/pull/5

I also PR'd the security fix to `edera-dev`
(https://github.com/edera-dev/tokio-tar/pull/4).
2025-02-03 17:51:35 +00:00
konsti
f7c3f30a16 Update pubgrub to set-based outdated priority tracking (#11169)
Looks like the set based prioritize tracking from
https://github.com/pubgrub-rs/pubgrub/pull/313 is a slight speedup.

I assume the changed derivation tree in the error snapshot is due to
out-of-sync virtual package priorities, while the main package priority
defining the solution remains stable.

```
$ hyperfine --warmup 2 "./uv-main pip compile --no-progress scripts/requirements/airflow.in --universal" "./uv-branch pip compile --no-progress scripts/requirements/airflow.in --universal"
  Benchmark 1: ./uv-main pip compile --no-progress scripts/requirements/airflow.in --universal
    Time (mean ± σ):     115.0 ms ±   4.8 ms    [User: 131.0 ms, System: 113.6 ms]
    Range (min … max):   108.1 ms … 125.8 ms    25 runs

  Benchmark 2: ./uv-branch pip compile --no-progress scripts/requirements/airflow.in --universal
    Time (mean ± σ):     105.4 ms ±   2.6 ms    [User: 118.5 ms, System: 113.5 ms]
    Range (min … max):   101.1 ms … 111.9 ms    28 runs

  Summary
    ./uv-branch pip compile --no-progress scripts/requirements/airflow.in --universal ran
      1.09 ± 0.05 times faster than ./uv-main pip compile --no-progress scripts/requirements/airflow.in --universal
```
2025-02-03 13:08:51 +01:00
renovate[bot]
4a88cdd6ee Update Rust crate syn to v2.0.98 (#11172) 2025-02-02 20:47:35 -05:00
renovate[bot]
d3dd91c78c Update Rust crate jiff to v0.1.29 (#11171) 2025-02-02 20:33:43 -05:00
renovate[bot]
6f1578fa59 Update Rust crate async-trait to v0.1.86 (#11170) 2025-02-03 01:16:19 +00:00
renovate[bot]
b0e9781da4 Update Rust crate miette to v7.5.0 (#9568) 2025-02-01 04:06:15 +00:00
Charlie Marsh
8adf4a8977 Migrate from urlencoding to percent-encoding (#11144)
## Summary

This lets us drop a dependency entirely. `percent-encoding` is used by
`url` and so is already in the graph, whereas `urlencoding` isn't used
by anything else.
2025-01-31 16:29:46 -05:00
Charlie Marsh
027db656aa Run cargo update (#11146)
## Summary

Renovate only captures first-party dependencies, so it's good to run
this from time to time.
2025-01-31 16:07:36 -05:00
Charlie Marsh
26f84e5699 Percent-decode URLs in canonical comparisons (#11088)
## Summary

This PR adds an additional normalization step to `CanonicalUrl` whereby
we now percent-decode the path, to ensure that (e.g.)
`torch-2.5.1%2Bcpu.cxx11.abi-cp39-cp39-linux_x86_64.whl` and
`torch-2.5.1+cpu.cxx11.abi-cp39-cp39-linux_x86_64.whl` are considered
equal. Further, when generating the "reinstall" report, we use the
canonical URL rather than the verbatim URL.

In making this change, I also learned that we don't apply any of the
normalization passes to `file://` URLs. I inadvertently removed it in
93d606aba2,
since setting the password or URL on ` file://` URL errors -- but now
suppress those errors anyway.

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

## Test Plan

- Downloaded a [PyTorch
wheel](https://download.pytorch.org/whl/cpu-cxx11-abi/torch-2.5.1%2Bcpu.cxx11.abi-cp39-cp39-linux_x86_64.whl)
- `python3.9 -m pip install
torch-2.5.1+cpu.cxx11.abi-cp39-cp39-linux_x86_64.whl --platform
linux_x86_64 --target foo --no-deps`
- `cargo run pip install
torch-2.5.1+cpu.cxx11.abi-cp39-cp39-linux_x86_64.whl --python-platform
linux --python-version 3.9 --target foo --no-deps`
- Verified that the package had the `~` symbol for the reinstall.
2025-01-31 15:45:48 -05:00
Zanie Blue
5ef3d51390 Bump version to 0.5.26 (#11119) 2025-01-30 15:37:00 -06:00
Zanie Blue
9c07c3fc5b Bump version to 0.5.25 (#11042) 2025-01-28 15:40:43 -06:00
renovate[bot]
b1706ad8be Update Rust crate rustix to v0.38.44 (#10974) 2025-01-26 22:23:02 -05:00
renovate[bot]
bcbc35c844 Update Rust crate fs-err to v3.1.0 (#10976) 2025-01-27 02:49:02 +00:00
renovate[bot]
fb545130eb Update Rust crate rkyv to v0.8.10 (#10973) 2025-01-27 02:23:24 +00:00
renovate[bot]
a1ce4aac59 Update Rust crate jiff to v0.1.27 (#10972) 2025-01-26 21:21:01 -05:00