astral-uv:zb/toolchain-vii

Last commit made on 2024-06-10
Get this branch:
git clone -b zb/toolchain-vii https://git.launchpad.net/astral-uv

Branch merges

Branch information

Name:
zb/toolchain-vii
Repository:
lp:astral-uv

Recent commits

f838a1b... by Zanie Blue <email address hidden>

Add support for musl Python toolchain fetches

c6da4f1... by Zanie Blue <email address hidden>

Add `uv toolchain list` (#4163)

Adds the `uv toolchain` namespace and a `list` command to get us
started.

```
❯ cargo run -q -- toolchain list
warning: `uv toolchain list` is experimental and may change without warning.
3.8.12 (cpython-3.8.12-macos-aarch64-none)
3.8.13 (cpython-3.8.13-macos-aarch64-none)
3.8.14 (cpython-3.8.14-macos-aarch64-none)
3.8.15 (cpython-3.8.15-macos-aarch64-none)
3.8.16 (cpython-3.8.16-macos-aarch64-none)
3.8.17 (cpython-3.8.17-macos-aarch64-none)
3.8.18 (cpython-3.8.18-macos-aarch64-none)
3.8.18 (cpython-3.8.18-macos-aarch64-none)
3.8.19 (cpython-3.8.19-macos-aarch64-none)
3.9.2 (cpython-3.9.2-macos-aarch64-none)
3.9.3 (cpython-3.9.3-macos-aarch64-none)
3.9.4 (cpython-3.9.4-macos-aarch64-none)
3.9.5 (cpython-3.9.5-macos-aarch64-none)
3.9.6 (cpython-3.9.6-macos-aarch64-none)
3.9.7 (cpython-3.9.7-macos-aarch64-none)
3.9.10 (cpython-3.9.10-macos-aarch64-none)
3.9.11 (cpython-3.9.11-macos-aarch64-none)
3.9.12 (cpython-3.9.12-macos-aarch64-none)
3.9.13 (cpython-3.9.13-macos-aarch64-none)
3.9.14 (cpython-3.9.14-macos-aarch64-none)
3.9.15 (cpython-3.9.15-macos-aarch64-none)
3.9.16 (cpython-3.9.16-macos-aarch64-none)
3.9.17 (cpython-3.9.17-macos-aarch64-none)
3.9.18 (cpython-3.9.18-macos-aarch64-none)
3.9.19 (cpython-3.9.19-macos-aarch64-none)
3.10.0 (cpython-3.10.0-macos-aarch64-none)
3.10.2 (cpython-3.10.2-macos-aarch64-none)
3.10.3 (cpython-3.10.3-macos-aarch64-none)
3.10.4 (cpython-3.10.4-macos-aarch64-none)
3.10.5 (cpython-3.10.5-macos-aarch64-none)
3.10.6 (cpython-3.10.6-macos-aarch64-none)
3.10.7 (cpython-3.10.7-macos-aarch64-none)
3.10.8 (cpython-3.10.8-macos-aarch64-none)
3.10.9 (cpython-3.10.9-macos-aarch64-none)
3.10.11 (cpython-3.10.11-macos-aarch64-none)
3.10.12 (cpython-3.10.12-macos-aarch64-none)
3.10.13 (cpython-3.10.13-macos-aarch64-none)
3.10.14 (cpython-3.10.14-macos-aarch64-none)
3.11.1 (cpython-3.11.1-macos-aarch64-none)
3.11.3 (cpython-3.11.3-macos-aarch64-none)
3.11.4 (cpython-3.11.4-macos-aarch64-none)
3.11.5 (cpython-3.11.5-macos-aarch64-none)
3.11.6 (cpython-3.11.6-macos-aarch64-none)
3.11.7 (cpython-3.11.7-macos-aarch64-none)
3.11.8 (cpython-3.11.8-macos-aarch64-none)
3.11.9 (cpython-3.11.9-macos-aarch64-none)
3.12.0 (cpython-3.12.0-macos-aarch64-none)
3.12.1 (cpython-3.12.1-macos-aarch64-none)
3.12.2 (cpython-3.12.2-macos-aarch64-none)
3.12.3 (cpython-3.12.3-macos-aarch64-none)
```

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

a2e6aaa... by Zanie Blue <email address hidden>

Fetch managed toolchains in `uv run` (#4143)

45df889... by Zanie Blue <email address hidden>

Implement `Toolchain::find_or_fetch` and use in `uv venv --preview` (#4138)

Extends https://github.com/astral-sh/uv/pull/4121
Part of #2607

Adds support for managed toolchain fetching to `uv venv`, e.g.

```
❯ cargo run -q -- venv --python 3.9.18 --preview -v
DEBUG Searching for Python 3.9.18 in search path or managed toolchains
DEBUG Searching for managed toolchains at `/Users/zb/Library/Application Support/uv/toolchains`
DEBUG Found CPython 3.12.3 at `/opt/homebrew/bin/python3` (search path)
DEBUG Found CPython 3.9.6 at `/usr/bin/python3` (search path)
DEBUG Found CPython 3.12.3 at `/opt/homebrew/bin/python3` (search path)
DEBUG Requested Python not found, checking for available download...
DEBUG Using registry request timeout of 30s
INFO Fetching requested toolchain...
DEBUG Downloading https://github.com/indygreg/python-build-standalone/releases/download/20240224/cpython-3.9.18%2B20240224-aarch64-apple-darwin-pgo%2Blto-full.tar.zst to temporary location /Users/zb/Library/Application Support/uv/toolchains/.tmpgohKwp
DEBUG Extracting cpython-3.9.18%2B20240224-aarch64-apple-darwin-pgo%2Blto-full.tar.zst
DEBUG Moving /Users/zb/Library/Application Support/uv/toolchains/.tmpgohKwp/python to /Users/zb/Library/Application Support/uv/toolchains/cpython-3.9.18-macos-aarch64-none
Using Python 3.9.18 interpreter at: /Users/zb/Library/Application Support/uv/toolchains/cpython-3.9.18-macos-aarch64-none/install/bin/python3
Creating virtualenv at: .venv
INFO Removing existing directory
Activate with: source .venv/bin/activate
```

The preview flag is required. The fetch is performed if we can't find an
interpreter that satisfies the request. Once fetched, the toolchain will
be available for later invocations that include the `--preview` flag.
There will be follow-ups to improve toolchain management in general,
there is still outstanding work from the initial implementation.

04c4da4... by Charlie Marsh <email address hidden>

Fix `>=` to `==` typo in `is_contained_by` docs (#4196)

163f328... by Charlie Marsh <email address hidden>

Document bytecode compilation in pip compatibility guide (#4195)

## Summary

Closes #4188.

72bc739... by Charlie Marsh <email address hidden>

Remove `PubGrubPackage` dependency from `ResolutionGraph` (#4168)

## Summary

Similar to how we abstracted the dependencies into
`ResolutionDependencyNames`, I think it makes sense to abstract the base
packages into a `ResolutionPackage`. This also avoids leaking details
about the various `PubGrubPackage` enum variants to `ResolutionGraph`.

18b40b0... by konstin

Don't panic with invalid wheel source (#4191)

Remove the panic when there is an invalid wheel source, instead surface
the error. This error can only occur when manually editing the lock
file, but since it's an external file, we should error and not panic.

This change is helpful since the method needs to be able to error for
relative path support.

763e2d2... by Charlie Marsh <email address hidden>

Add markers to edges rather than distributions (#4166)

## Summary

We've debated this a bit but the thing that tipped me over the edge is
https://github.com/astral-sh/uv/issues/4157. As-is, there's no way to
represent "a package should be installed, but the extra should only be
installed conditionally based on the markers", because the markers sit
on the _distribution_. By placing the markers on the edge, we can now
represent scenarios that weren't previously representable.

Closes https://github.com/astral-sh/uv/issues/4137.
Closes https://github.com/astral-sh/uv/issues/4125.
Closes https://github.com/astral-sh/uv/issues/4157.

5269a0d... by Charlie Marsh <email address hidden>

Ignore tags in universal resolution (#4174)

## Summary

If a package lacks a source distribution, and we can't find a compatible
wheel for the current platform, we need to just _assume_ that the
package will have a valid wheel on all platforms on which it's
requested; if not, we raise an error at install time.

It's possible that we can be smarter about this over time. For example,
if the package was requested _only_ for macOS, we could verify that
there's at least one macOS-compatible wheel. See the linked issue for
more details.

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