996 Commits

Author SHA1 Message Date
Zanie Blue
80d41671bc Bump version to 0.5.8 (#9791) 2024-12-11 15:18:51 +00:00
renovate[bot]
3b727b7323 Update Rust crate target-lexicon to 0.13.0 (#9729) 2024-12-10 20:34:07 -05:00
Charlie Marsh
3ee2b10738 Enable uv tool uninstall uv on Windows (#8963)
## Summary

Extending self-delete and self-replace functionality to uv itself on
Windows.

Closes https://github.com/astral-sh/uv/issues/6400.
2024-12-10 13:13:22 -05:00
renovate[bot]
b17902da0f Update Rust crate thiserror to v2.0.6 (#9727) 2024-12-09 01:15:25 +00:00
Charlie Marsh
c4f3d1cf14 Run cargo update (#9712) 2024-12-07 22:50:22 -05:00
Zanie Blue
3ca155ddd6 Bump version to 0.5.7 (#9698) 2024-12-06 17:50:21 -06:00
konsti
6ed6fc108e Build backend: Add direct builds to the resolver and installer (#9621)
This is like #9556, but at the level of all other builds, including the
resolver and installer. Going through PEP 517 to build a package is
slow, so when building a package with the uv build backend, we can call
into the uv build backend directly instead: No temporary virtual env, no
temp venv sync, no python subprocess calls, no uv subprocess calls.

This fast path is gated through preview. Since the uv wheel is not
available at test time, I've manually confirmed the feature by comparing
`uv venv && cargo run pip install . -v --preview --reinstall .` and `uv
venv && cargo run pip install . -v --reinstall .`. When hacking the
preview so that the python uv build backend works without the setting
the direct build also (wheel built with `maturin build --profile
profiling`), we can see the perfomance difference:

```
$ hyperfine --prepare "uv venv" --warmup 3 \
    "UV_PREVIEW=1 target/profiling/uv pip install --no-deps --reinstall scripts/packages/built-by-uv --preview" \
    "target/profiling/uv pip install --no-deps --reinstall scripts/packages/built-by-uv --find-links target/wheels/"
Benchmark 1: UV_PREVIEW=1 target/profiling/uv pip install --no-deps --reinstall scripts/packages/built-by-uv --preview
  Time (mean ± σ):      33.1 ms ±   2.5 ms    [User: 25.7 ms, System: 13.0 ms]
  Range (min … max):    29.8 ms …  47.3 ms    73 runs
 
Benchmark 2: target/profiling/uv pip install --no-deps --reinstall scripts/packages/built-by-uv --find-links target/wheels/
  Time (mean ± σ):     115.1 ms ±   4.3 ms    [User: 54.0 ms, System: 27.0 ms]
  Range (min … max):   109.2 ms … 123.8 ms    25 runs
 
Summary
  UV_PREVIEW=1 target/profiling/uv pip install --no-deps --reinstall scripts/packages/built-by-uv --preview ran
    3.48 ± 0.29 times faster than target/profiling/uv pip install --no-deps --reinstall scripts/packages/built-by-uv --find-links target/wheels/
```

Do we need a global option to disable the fast path? There is one for
`uv build` because `--force-pep517` moves `uv build` much closer to a
`pip install` from source that a user of a library would experience (See
discussion at #9610), but uv overall doesn't really make guarantees
around the build env of dependencies, so I consider the direct build a
valid option.

Best reviewed commit-by-commit, only the last commit is the actual
implementation, while the preview mode introduction is just a
refactoring touching too many files.
2024-12-04 15:57:18 +00:00
konsti
19c3c08bf3 Improve build frontend error handling (#9611)
Move the error handling for `build_package` into an enum, to avoid
`bail!` and duplicated `.context()` calls.
2024-12-04 09:04:23 +00:00
Zanie Blue
ae033e2d3b Improve message when updater receipt is for a different uv executable (#9487)
Attempts to improve confusing messaging in cases like
https://github.com/astral-sh/uv/issues/6774#issuecomment-2504950681,
when the receipt is for a different uv executable.

```
❯ cargo run --all-features -q -- self update
warning: Self-update is only available for uv binaries installed via the standalone installation scripts.

The current executable is at `/Users/zb/workspace/uv/target/debug/uv` but the standalone installer was used to install uv to `/Users/zb/.cargo`. Are multiple copies of uv installed?
```

Requires https://github.com/axodotdev/axoupdater/pull/221
Closes https://github.com/astral-sh/uv/issues/6774
2024-12-04 01:26:32 +00:00
Zanie Blue
59460b8a7c Bump version to 0.5.6 (#9612) 2024-12-03 14:13:06 -06:00
Charlie Marsh
75949f3fec Avoid cloning String in marker evaluation (#9598)
## Summary

A small TODO that I found interesting. See:
https://github.com/astral-sh/pubgrub/pull/35.
2024-12-03 14:28:04 +00:00
renovate[bot]
89a25ba465 Update Rust crate rustc-hash to v2.1.0 (#9569) 2024-12-02 01:23:42 +00:00
renovate[bot]
b5807754fe Update Rust crate indexmap to v2.7.0 (#9567) 2024-12-01 20:07:06 -05:00
renovate[bot]
2ee710a620 Update tokio-tracing monorepo (#9566) 2024-12-01 20:06:59 -05:00
renovate[bot]
0a42c3c340 Update Rust crate syn to v2.0.90 (#9564) 2024-12-01 20:06:47 -05:00
renovate[bot]
3ee6ef2556 Update Rust crate rkyv to v0.8.9 (#9563) 2024-12-01 20:06:40 -05:00
renovate[bot]
f92640cf2a Update Rust crate pathdiff to v0.2.3 (#9562) 2024-12-01 20:06:34 -05:00
renovate[bot]
fb64fb7e13 Update Rust crate jiff to v0.1.15 (#9561) 2024-12-01 20:06:28 -05:00
renovate[bot]
ef20d6a92a Update Rust crate cargo-util to v0.2.16 (#9560) 2024-12-01 20:06:20 -05:00
konsti
8a863194c8 Use SharedState for build dispatch (#9553)
When looking at the build frontend code, I noticed that we always pass
every single field of the shared state to the build dispatch:

```rust
    let build_dispatch = BuildDispatch::new(
        ...
        &state.index,
        &state.git,
        &state.capabilities,
        &state.in_flight,
        ...
    );
```

We can abstract this by moving `SharedState` into the build dispatch.
The `BuildDispatch` then has only immutable fields and the
`SharedState`. Since the `SharedState` is all `Arc`s, we can clone it
freely.
2024-12-01 17:20:28 -05:00
Zanie Blue
95cd8b8b3f Bump version to 0.5.5 (#9478) 2024-11-27 11:37:39 -06:00
Charlie Marsh
916d5d7778 Migrate to PubGrub's arena for package names (#9448)
## Summary

There's more we can do here, i.e., to leverage the IDs more widely, but
this is a start.
2024-11-26 15:05:39 -05:00
konsti
c94777fc54 Initialize rayon lazily (#9435)
When performing a noop sync, we don't need the rayon threadpool, yet we
pay for its initialization:

![Screenshot from 2024-11-26
08-59-07](https://github.com/user-attachments/assets/d918f50d-b5b7-4bdd-820d-cbe71b633aaa)

Be making the initialization lazy, we avoid that cost:

![Screenshot from 2024-11-26
09-53-08](https://github.com/user-attachments/assets/193baea0-667f-4b9d-9a75-886a86f0f837)

This code runs every time before user code in `uv run`.

This means that before calling rayon, one now needs to call
`LazyLock::force(&RAYON_INITIALIZE);`.

Performance mode (CPU 0 is a perf core):
```
$ taskset -c 0 hyperfine --warmup 5 -N "/home/konsti/projects/uv/uv-main sync" "/home/konsti/projects/uv/target/profiling/uv sync"
Benchmark 1: /home/konsti/projects/uv/uv-main sync
  Time (mean ± σ):       4.5 ms ±   0.1 ms    [User: 2.7 ms, System: 1.8 ms]
  Range (min … max):     4.4 ms …   6.4 ms    640 runs
 
  Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options.
 
Benchmark 2: /home/konsti/projects/uv/target/profiling/uv sync
  Time (mean ± σ):       4.4 ms ±   0.1 ms    [User: 2.7 ms, System: 1.6 ms]
  Range (min … max):     4.3 ms …   5.0 ms    679 runs
 
Summary
  /home/konsti/projects/uv/target/profiling/uv sync ran
    1.03 ± 0.04 times faster than /home/konsti/projects/uv/uv-main sync
```

Power saver mode:
```
$ hyperfine --warmup 5 -N "/home/konsti/projects/uv/uv-main sync" "/home/konsti/projects/uv/target/profiling/uv sync"
Benchmark 1: /home/konsti/projects/uv/uv-main sync
  Time (mean ± σ):      28.1 ms ±   1.2 ms    [User: 15.5 ms, System: 20.3 ms]
  Range (min … max):    25.7 ms …  31.9 ms    102 runs
 
Benchmark 2: /home/konsti/projects/uv/target/profiling/uv sync
  Time (mean ± σ):      24.0 ms ±   1.2 ms    [User: 13.8 ms, System: 9.9 ms]
  Range (min … max):    22.2 ms …  28.2 ms    122 runs
 
Summary
  /home/konsti/projects/uv/target/profiling/uv sync ran
    1.17 ± 0.08 times faster than /home/konsti/projects/uv/uv-main sync
```
2024-11-26 14:58:38 +00:00
Charlie Marsh
0158717ae6 Don't warn when --output-file is empty (#9417)
## Summary

Closes https://github.com/astral-sh/uv/issues/9410.
2024-11-25 22:09:18 +00:00
renovate[bot]
288d128065 Update Rust crate url to v2.5.4 (#9405) 2024-11-24 20:48:44 -05:00
renovate[bot]
0c944681b1 Update Rust crate syn to v2.0.89 (#9404) 2024-11-24 20:48:37 -05:00
renovate[bot]
ab0e1552ac Update Rust crate proc-macro2 to v1.0.92 (#9403) 2024-11-24 20:48:31 -05:00
renovate[bot]
abd8281328 Update Rust crate hashbrown to v0.15.2 (#9402) 2024-11-24 20:48:11 -05:00
renovate[bot]
64f65031b7 Update Rust crate async-compression to v0.4.18 (#9401) 2024-11-24 20:48:03 -05:00
Charlie Marsh
c62c83c37a Bump version to v0.5.4 (#9290) 2024-11-20 16:01:24 -05:00
Charlie Marsh
1b13036674 Add retries for Python downloads (#9274)
## Summary

This uses the same approach as in the rest of uv, but with another
dedicated method for retries.

Closes https://github.com/astral-sh/uv/issues/8525.
2024-11-20 09:42:42 -05:00
Charlie Marsh
ccc0962cbd Use zlib-rs on all platforms (#9264) 2024-11-20 00:01:58 -05:00
Ben Beasley
80ab562f9f In uv-globfilter, use the workspace fs-err in dev-dependencies (#9262)
<!--
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

In uv-globfilter, use the workspace `fs-err` in `dev-dependencies`.

This fixes an unnecessary dev-dependency on `fs-err` 2.x even after the
workspace fs-err was updated to 3.x in
https://github.com/astral-sh/uv/pull/8625.

The `Cargo.lock` file still has `fs-err v2.11.0` after this PR, but it
is via `tracing-durations-export v0.3.0` rather than directly required
by any `uv` crate.

## Test Plan

<!-- How was it tested? -->

```
$ cd crates/uv-globfilter/
$ cargo test
```
2024-11-20 03:59:37 +00:00
Charlie Marsh
45eeae61ff Use existing index field in PEP 723 scripts (#9238)
## Summary

Purely internal, this setting already exists.
2024-11-19 14:45:12 -05:00
Charlie Marsh
56d3622087 Bump version to v0.5.3 (#9229) 2024-11-19 18:53:54 +00:00
renovate[bot]
dae630ae50 Update Rust crate fs-err to v3 (#8625) 2024-11-19 15:09:00 +00:00
Charlie Marsh
0aaa6ba5be Migrate to zlib-rs (#9184)
## Summary

I've tried this a few times; just curious if it passes tests.
2024-11-18 15:45:14 +00:00
konsti
a07d5a1d18 Update pubgrub to Ranges::from_iter (#9145)
Co-authored-by: Zanie Blue <contact@zanie.dev>
2024-11-18 12:28:17 +00:00
renovate[bot]
b7de92d22c Update Rust crate spdx to v0.10.7 (#9182) 2024-11-17 20:50:26 -05:00
renovate[bot]
ff95014584 Update Rust crate serde_json to v1.0.133 (#9181) 2024-11-17 20:50:09 -05:00
renovate[bot]
655704a603 Update Rust crate regex-automata to v0.4.9 (#9179) 2024-11-17 20:49:51 -05:00
renovate[bot]
e2ca4cf833 Update Rust crate indicatif to v0.17.9 (#9178) 2024-11-17 20:49:26 -05:00
renovate[bot]
352e3341de Update Rust crate flate2 to v1.0.35 (#9176) 2024-11-17 20:48:21 -05:00
renovate[bot]
b8a0ae8f27 Update Rust crate clap to v4.5.21 (#9175) 2024-11-17 20:48:01 -05:00
renovate[bot]
c358161497 Update Rust crate serde to v1.0.215 (#9180) 2024-11-17 20:47:38 -05:00
Charlie Marsh
8dd095cab8 Include version constraints in derivation chains (#9112)
## Summary

Derivation chains can now include the versions at which a package was
requested.
2024-11-15 15:06:24 -05:00
renovate[bot]
312ae12650 Update Rust crate thiserror to v2 (#9006) 2024-11-15 09:54:16 -06:00
Michał Górny
dafbd7d405 Update "tl" crate URL following repository transfer (#9147)
## Summary

Update the URL to the "tl" crate since the repository has been
transferred to astral-sh/. This is of no real consequence, except it
keeps triggering Gentoo linter that detects permanently redirected URL.

## Test Plan

`cargo test`
2024-11-15 13:07:51 +00:00
konsti
997ff9d57a Allow apostrophe in venv name (#8984)
Escape an apostrophe in the venv path name.

Fixes #8947
2024-11-15 10:52:10 +01:00
konsti
0abb2a4595 Refactor shell quoting (#9055)
Move the shlex-like quoting utils in the uv-shell crate, so we only
write `r#"'"'"'"#` once.

Split out from #8984
2024-11-15 09:06:54 +00:00