1047 Commits

Author SHA1 Message Date
Charlie Marsh
333f03f112 Bump version to v0.5.16 (#10395) 2025-01-08 10:29:32 -05:00
Charlie Marsh
c8b3e8523c Re-enable zlib-ng on x86 platforms (#10365)
## Summary

Closes https://github.com/astral-sh/uv/issues/10363.
2025-01-07 11:00:32 -05:00
konsti
c6ac121ed0 Refactor batch prefetch (#10349) 2025-01-07 14:58:36 +01:00
Zanie Blue
eb6ad9a4fa Bump version to 0.5.15 (#10337) 2025-01-06 18:04:25 -06:00
renovate[bot]
16097b51c4 Update Rust crate tempfile to v3.15.0 (#10318) 2025-01-05 21:29:38 -05:00
renovate[bot]
98d06f40f5 Update Rust crate insta to v1.42.0 (#10314) 2025-01-05 21:27:30 -05:00
renovate[bot]
5aefe69ecf Update Rust crate itertools to 0.14.0 (#10316) 2025-01-05 21:27:14 -05:00
renovate[bot]
0b9519b1fc Update Rust crate syn to v2.0.95 (#10312) 2025-01-06 01:19:11 +00:00
renovate[bot]
f93ada48e9 Update Rust crate spdx to v0.10.8 (#10311) 2025-01-06 01:16:15 +00:00
renovate[bot]
af23311d15 Update Rust crate jiff to v0.1.21 (#10310) 2025-01-06 01:12:57 +00:00
renovate[bot]
f4cca71c0b Update Rust crate async-trait to v0.1.84 (#10309) 2025-01-06 01:11:44 +00:00
renovate[bot]
fbe6f1edf4 Update Rust crate reqwest to v0.12.12 (#10227) 2025-01-03 12:18:43 -05:00
Charlie Marsh
9f1ba2b967 Bump version to v0.5.14 (#10279) 2025-01-02 14:31:04 -05:00
Charlie Marsh
c77aa5820b Add a required version setting to uv (#10248)
## Summary

This follows Ruff's design exactly: you can provide a version specifier
(like `>=0.5`), and we'll enforce it at runtime.

Closes https://github.com/astral-sh/uv/issues/8605.
2024-12-31 15:37:46 +00:00
renovate[bot]
0ea4f5f8b1 Update Rust crate syn to v2.0.93 (#10229) 2024-12-30 03:03:52 +00:00
renovate[bot]
78e246f043 Update Rust crate serde to v1.0.217 (#10228) 2024-12-30 02:56:19 +00:00
renovate[bot]
4623ab32be Update Rust crate jiff to v0.1.16 (#10226) 2024-12-30 02:55:16 +00:00
renovate[bot]
07f6596933 Update Rust crate glob to v0.3.2 (#10225) 2024-12-30 02:43:47 +00:00
renovate[bot]
19fc8865fb Update Rust crate boxcar to v0.2.8 (#10224) 2024-12-30 02:42:41 +00:00
Charlie Marsh
cecff3a726 Guard against self-deletion in uv venv and uv tool (#10206)
## Summary

Closes https://github.com/astral-sh/uv/issues/1327.
2024-12-29 10:46:45 -05:00
Charlie Marsh
4c49683f7b Bump version to v0.5.13 (#10188) 2024-12-26 23:58:13 +00:00
Charlie Marsh
b52d48973f Revert "Update reqwest (#10178)" (#10187)
This reverts commit d2f58d9299.

Closes https://github.com/astral-sh/uv/issues/10186
2024-12-26 23:40:24 +00:00
Charlie Marsh
351d602d86 Bump version to v0.5.12 (#10175) 2024-12-26 14:16:19 -05:00
Charlie Marsh
d2f58d9299 Update reqwest (#10178) 2024-12-26 14:16:12 -05:00
Charlie Marsh
b6697a777c Run cargo update (#10173) 2024-12-26 12:00:58 -05:00
Charlie Marsh
3cb723220e Remove anyhow::Result for lock serialization (#10151) 2024-12-25 01:24:26 +00:00
Charlie Marsh
d1b1da5ac1 Upgrade cargo-dist to v0.27.0 (#10141)
## Summary

Required peer to https://github.com/astral-sh/uv/pull/10115.
2024-12-24 08:24:14 -05:00
renovate[bot]
7796a9cb3e Update Rust crate hyper to v1.5.2 (#10105) 2024-12-24 08:10:06 -05:00
renovate[bot]
5b3e54d9dd Update Rust crate axoupdater to 0.9.0 (#10115) 2024-12-24 08:09:13 -05:00
renovate[bot]
c329623770 Update Rust crate thiserror to v2.0.9 (#10112) 2024-12-23 08:48:06 -05:00
renovate[bot]
4008e313bf Update Rust crate which to v7.0.1 (#10113) 2024-12-23 08:47:36 -05:00
renovate[bot]
54ab15121c Update Rust crate target-lexicon to v0.13.1 (#10111) 2024-12-23 01:45:06 +00:00
renovate[bot]
27ec53c736 Update Rust crate syn to v2.0.91 (#10109) 2024-12-23 01:34:43 +00:00
renovate[bot]
a31ec7aa16 Update Rust crate serde_json to v1.0.134 (#10108) 2024-12-23 01:33:50 +00:00
renovate[bot]
4945880270 Update Rust crate predicates to v3.1.3 (#10107) 2024-12-23 01:29:47 +00:00
renovate[bot]
1f97944c79 Update Rust crate platform-info to v2.0.5 (#10106) 2024-12-23 01:12:31 +00:00
renovate[bot]
ad156f393c Update Rust crate home to v0.5.11 (#10104) 2024-12-23 01:01:24 +00:00
renovate[bot]
18d8b79db1 Update Rust crate console to v0.15.10 (#10103) 2024-12-23 00:59:23 +00:00
renovate[bot]
9e33658ba9 Update Rust crate anyhow to v1.0.95 (#10102) 2024-12-23 00:49:18 +00:00
konsti
ae659c8bfe Stable order for virtual packages (#10024)
uv gives priorities to packages by package name, not by virtual package
(`PubGrubPackage`). pubgrub otoh when prioritizing order the virtual
packages. When the order of virtual packages changes, uv changes its
resolutions and error messages. This means uv was depending on
implementation details of pubgrub's prioritization caching.

This broke with https://github.com/pubgrub-rs/pubgrub/pull/299, which
added a tiebreaker term that made pubgrub's sorting deterministic given
a deterministic ordering of allocating the packages (which happens the
first time pubgrub sees a package).

The new custom tiebreaker decreases the difference to upstream pubgrub.
2024-12-20 09:28:46 +00:00
Zanie Blue
c4d0caaee5 Bump version to 0.5.11 (#10044) 2024-12-19 18:01:45 -06:00
Zanie Blue
37b11ddb22 Bump version to 0.5.10 (#9983) 2024-12-17 14:53:19 -06:00
Zanie Blue
3fae5332c1 Fix Cargo.lock by updating thiserror (#9975) 2024-12-17 10:53:44 -06:00
konsti
ebc6d20d9d Better build error messages (#9660)
Build failures are one of the most common user facing failures that
aren't "obivous" errors (such as typos) or resolver errors. Currently,
they show more technical details than being focussed on this being an
error in a subprocess that is either on the side of the package or -
more likely - in the build environment, e.g. the user needs to install a
dev package or their python version is incompatible.

The new error message clearly delineates the part that's important (this
is a build backend problem) from the internals (we called this hook) and
is consistent about which part of the dist building stage failed. We
have to calibrate the exact wording of the error message some more. Most
of the implementation is working around the orphan rule, (this)error
rules and trait rules, so it came out more of a refactoring than
intended.

Example:


![image](https://github.com/user-attachments/assets/2bc12992-db79-4362-a444-fd0d94594b77)
2024-12-17 09:44:32 -06:00
konsti
b7df5dbaf3 Avoid liblzma-dev system dep in uv-dev and uv-bench (#9933)
Enable `lzma-sys/static` through the performance feature not only in uv,
but in uv-dev and uv-bench too, to avoid the system dependency on
`liblzma-dev`.

Ref #9880
2024-12-17 16:12:33 +01:00
konsti
431ddc1d74 Change backtracking when packages conflict too much (#9843)
Background reading: https://github.com/astral-sh/uv/issues/8157
Companion PR: https://github.com/astral-sh/pubgrub/pull/36
Requires for test coverage: https://github.com/astral-sh/packse/pull/230

When two packages A and B conflict, we have the option to choose a lower
version of A, or a lower version of B. Currently, we determine this by
the order we saw a package (assuming equal specificity of the
requirement): If we saw A before B, we pin A until all versions of B are
exhausted. This can lead to undesirable outcomes, from cases where it's
just slow (sentry) to others cases without lower bounds where be
backtrack to a very old version of B. This old version may fail to build
(terminating the resolution), or it's a version so old that it doesn't
depend on A (or the shared conflicting package) anymore - but also is
too old for the user's application (fastapi). #8157 collects such cases,
and the `wrong-backtracking` packse scenario contains a minimized
example.

We try to solve this by tracking which packages are "A"s, culprits, and
"B"s, affected, and manually interfering with project selection and
backtracking. Whenever a version we just chose is rejected, we give the
current package a counter for being affected, and the package it
conflicted with a counter for being a culprit. If a package accumulates
more counts than a threshold, we reprioritize: Undecided after the
culprits, after the affected, after packages that only have a single
version (URLs, `==<version>`). We then ask pubgrub to backtrack just
before the culprit. Due to the changed priorities, we now select package
B, the affected, instead of package A, the culprit.

To do this efficiently, we ask pubgrub for the incompatibility that
caused backtracking, or just the last version to be discarded (due to
its dependencies). For backtracking, we use the last incompatibility
from unit propagation as a heuristic. When a version is discarded
because one of its dependencies conflicts with the partial solution, the
incompatibility tells us the package in the partial solution that
conflicted.

We only backtrack once per package, on the first time it passes the
threshold. This prevents backtracking loops in which we make the same
decisions over and over again. But we also changed the priority, so that
we shouldn't take the same path even after the one time we backtrack (it
would defeat the purpose of this change).

There are some parameters that can be tweaked: Currently, the threshold
is set to 5, which feels not too eager with so me of the conflicts that
we want to tolerate but also changes strategies quickly. The relative
order of the new priorities can also be changed, as for each (A, B) pair
the priority of B is afterwards lower than that for A. Currently,
culprits capture conflict for the whole package, but we could limit that
to a specific version. We could discard conflict counters after
backtracking instead of keeping them eternally as we do now. Note that
we're always taking about pairs (A, B), but in practice we track
individual packages, not pairs.

A case that we wouldn't capture is when B is only introduced to the
dependency graph after A, but I think that would require cyclical
dependency for A and B to conflict? There may also be cases where
looking at the last incompatibility is insufficient.

Another example that we can't repair with prioritization is
urllib3/boto3/botocore: We actually have to check all the newer versions
of boto3 and botocore to identify the version that allows with the older
urllib3, no shortcuts allowed.

```
urllib3<1.25.4
boto3
```

All examples I tested were cases with two packages where we only had to
switch the order, so I've abstracted them into a single packse case.

This PR changes the resolution for certain paths, and there is the risk
for regressions.

Fixes #8157

---

All tested examples improved.

Input fastapi:
```text
starlette<=0.36.0
fastapi<=0.115.2
```

```
# BEFORE
$ uv pip --no-progress compile -p 3.11 --exclude-newer 2024-10-01 --no-annotate debug/fastapi.txt
annotated-types==0.7.0
anyio==4.6.0
fastapi==0.1.17
idna==3.10
pydantic==2.9.2
pydantic-core==2.23.4
sniffio==1.3.1
starlette==0.36.0
typing-extensions==4.12.2

# AFTER
$ cargo run --profile fast-build --no-default-features pip compile -p 3.11 --no-progress --exclude-newer 2024-10-01 --no-annotate debug/fastapi.txt 
annotated-types==0.7.0
anyio==4.6.0
fastapi==0.109.1
idna==3.10
pydantic==2.9.2
pydantic-core==2.23.4
sniffio==1.3.1
starlette==0.35.1
typing-extensions==4.12.2
```


Input xarray:
```text
xarray[accel]
```

```
# BEFORE
$ uv pip --no-progress compile -p 3.11 --exclude-newer 2024-10-01 --no-annotate debug/xarray-accel.txt
bottleneck==1.4.0
flox==0.9.13
llvmlite==0.36.0
numba==0.53.1
numbagg==0.8.2
numpy==2.1.1
numpy-groupies==0.11.2
opt-einsum==3.4.0
packaging==24.1
pandas==2.2.3
python-dateutil==2.9.0.post0
pytz==2024.2
scipy==1.14.1
setuptools==75.1.0
six==1.16.0
toolz==0.12.1
tzdata==2024.2
xarray==2024.9.0

# AFTER
$ cargo run --profile fast-build --no-default-features pip compile -p 3.11 --no-progress --exclude-newer 2024-10-01 --no-annotate debug/xarray-accel.txt
bottleneck==1.4.0
flox==0.9.13
llvmlite==0.43.0
numba==0.60.0
numbagg==0.8.2
numpy==2.0.2
numpy-groupies==0.11.2
opt-einsum==3.4.0
packaging==24.1
pandas==2.2.3
python-dateutil==2.9.0.post0
pytz==2024.2
scipy==1.14.1
six==1.16.0
toolz==0.12.1
tzdata==2024.2
xarray==2024.9.0
```


Input sentry: The resolution is identical, but arrived at much faster:
main tries 69 versions (sentry-kafka-schemas: 63), PR tries 12 versions
(sentry-kafka-schemas: 6; 5 times conflicting, then once the right
version).

```text
python-rapidjson<=1.20,>=1.4
sentry-kafka-schemas<=0.1.113,>=0.1.50
```

```
# BEFORE
$ uv pip --no-progress compile -p 3.11 --exclude-newer 2024-10-01 --no-annotate debug/sentry.txt
fastjsonschema==2.20.0
msgpack==1.1.0
python-rapidjson==1.8
pyyaml==6.0.2
sentry-kafka-schemas==0.1.111
typing-extensions==4.12.2

# AFTER
$ cargo run --profile fast-build --no-default-features pip compile -p 3.11 --no-progress --exclude-newer 2024-10-01 --no-annotate debug/sentry.txt
fastjsonschema==2.20.0
msgpack==1.1.0
python-rapidjson==1.8
pyyaml==6.0.2
sentry-kafka-schemas==0.1.111
typing-extensions==4.12.2
```


Input apache-beam
```text
# Run on Python 3.10
dill<0.3.9,>=0.2.2
apache-beam<=2.49.0
```

```
# BEFORE
$ uv pip --no-progress compile -p 3.10 --exclude-newer 2024-10-01 --no-annotate debug/apache-beam.txt
  × Failed to download and build `apache-beam==2.0.0`
  ╰─▶ Build backend failed to determine requirements with `build_wheel()` (exit status: 1)

# AFTER
$ cargo run --profile fast-build --no-default-features pip compile -p 3.10 --no-progress --exclude-newer 2024-10-01 --no-annotate debug/apache-beam.txt
apache-beam==2.49.0
certifi==2024.8.30
charset-normalizer==3.3.2
cloudpickle==2.2.1
crcmod==1.7
dill==0.3.1.1
dnspython==2.6.1
docopt==0.6.2
fastavro==1.9.7
fasteners==0.19
grpcio==1.66.2
hdfs==2.7.3
httplib2==0.22.0
idna==3.10
numpy==1.24.4
objsize==0.6.1
orjson==3.10.7
proto-plus==1.24.0
protobuf==4.23.4
pyarrow==11.0.0
pydot==1.4.2
pymongo==4.10.0
pyparsing==3.1.4
python-dateutil==2.9.0.post0
pytz==2024.2
regex==2024.9.11
requests==2.32.3
six==1.16.0
typing-extensions==4.12.2
urllib3==2.2.3
zstandard==0.23.0
```
2024-12-16 11:39:50 +01:00
renovate[bot]
2b61a67cf7 Update Rust crate rustix to v0.38.42 (#9924) 2024-12-15 20:12:42 -05:00
renovate[bot]
34281d96f1 Update Rust crate thiserror to v2.0.7 (#9926) 2024-12-15 20:12:08 -05:00
renovate[bot]
3617dd1b46 Update Rust crate serde to v1.0.216 (#9925) 2024-12-15 20:11:53 -05:00
Charlie Marsh
0652800cb0 Bump version to v0.5.9 (#9889) 2024-12-13 17:28:19 -05:00