astral-uv:charlie/universal-lock

Last commit made on 2024-06-04
Get this branch:
git clone -b charlie/universal-lock https://git.launchpad.net/astral-uv

Branch merges

Branch information

Name:
charlie/universal-lock
Repository:
lp:astral-uv

Recent commits

7970c1d... by Charlie Marsh <email address hidden>

Require literal separator

b3111ba... by Charlie Marsh <email address hidden>

Avoid joining globs in workspace discovery

420333a... by Charlie Marsh <email address hidden>

Avoid 'are incompatible' for singular bounded versions (#4003)

## Summary

Not sure if this is worth the complexity, but it does read better.

365ca63... by Andrew Gallant <email address hidden>

uv/tests: add new universal tests

This updates to packse 0.3.17. There are a few incidental changes in
places, but the main addition here are the tests for universal
resolutions.

42b584c... by Andrew Gallant <email address hidden>

scripts/scenarios: update packse to 0.3.17

7b736fc... by Andrew Gallant <email address hidden>

scripts/scenarios: update 'generate.py' to handle universal tests

This commit adds a template and does some light surgery on `generate.py`
to make use of that template. In particular, the universal tests require
using the "workspace"-aware version of `uv`, so we can't use the
existing `uv pip {compile,install}` tests.

459966a... by Andrew Gallant <email address hidden>

uv/tests: update packse tests (#4015)

This is just the result of running

    ./scripts/sync_scenarios.sh

From the root of the `uv` repository.

When I initially ran this, it produced some tests with snapshots that
weren't being updated. It turned out this was because the tests weren't
running, as they were gated behind the `python-patch` feature. In this
commit, we add `python-patch` to our `cargo insta` command, which should
update all relevant snapshots.

There are still some superfluous updates as a result of a spell checker
being run on generated files, but

5c30b39... by Andrew Gallant <email address hidden>

uv-resolver: normalize marker expressions (#4017)

This is a quick fix for some flaky tests where the output in the lock
file isn't stable because marker expressions can be combined in a
non-deterministic order.

I believe there is ongoing work to simplify marker expressions which
will help here, but I think some kind of normalization is still
ultimately needed to guarantee consistent output.

I first noticed the flaky test in:
https://github.com/astral-sh/uv/pull/4015

3b8f3a7... by Ibraheem Ahmed <email address hidden>

Avoid work-stealing in bytecode compilation (#4004)

## Summary

Avoid using work-stealing Tokio workers for bytecode compilation,
favoring instead dedicated threads. Tokio's work-stealing does not
really benefit us because we're spawning Python workers and scheduling
tasks ourselves — we don't want Tokio to re-balance our workers. Because
we're doing scheduling ourselves and compilation is a primarily
compute-bound task, we can also create dedicated runtimes for each
worker and avoid some synchronization overhead.

This is part of a general desire to avoid relying on Tokio's
work-stealing scheduler and be smarter about our workload. In this case
we already had the custom scheduler in place, Tokio was just getting in
the way (though the overhead is very minor).

## Test Plan

This improves performance by ~5% on my machine.

```
$ hyperfine --warmup 1 --prepare "target/profiling/uv-dev clear-compile .venv" "target/profiling/uv-dev compile .venv" "target/profiling/uv-dev-dedicated compile .venv"
Benchmark 1: target/profiling/uv-dev compile .venv
  Time (mean ± σ): 1.279 s ± 0.011 s [User: 13.803 s, System: 2.998 s]
  Range (min … max): 1.261 s … 1.296 s 10 runs

Benchmark 2: target/profiling/uv-dev-dedicated compile .venv
  Time (mean ± σ): 1.220 s ± 0.021 s [User: 13.997 s, System: 3.330 s]
  Range (min … max): 1.198 s … 1.272 s 10 runs

Summary
  target/profiling/uv-dev-dedicated compile .venv ran
    1.05 ± 0.02 times faster than target/profiling/uv-dev compile .venv

$ hyperfine --warmup 1 --prepare "target/profiling/uv-dev clear-compile .venv" "target/profiling/uv-dev compile .venv" "target/profiling/uv-dev-dedicated compile .venv"
Benchmark 1: target/profiling/uv-dev compile .venv
  Time (mean ± σ): 3.631 s ± 0.078 s [User: 47.205 s, System: 4.996 s]
  Range (min … max): 3.564 s … 3.832 s 10 runs

Benchmark 2: target/profiling/uv-dev-dedicated compile .venv
  Time (mean ± σ): 3.521 s ± 0.024 s [User: 48.201 s, System: 5.392 s]
  Range (min … max): 3.484 s … 3.566 s 10 runs

Summary
  target/profiling/uv-dev-dedicated compile .venv ran
    1.03 ± 0.02 times faster than target/profiling/uv-dev compile .venv
```

6afb659... by Charlie Marsh <email address hidden>

Respect `Requires-Python` in universal resolution (#3998)

## Summary

Closes #3982.