astral-uv:konsti/offlinepi-reboot

Last commit made on 2024-03-13
Get this branch:
git clone -b konsti/offlinepi-reboot https://git.launchpad.net/astral-uv

Branch merges

Branch information

Name:
konsti/offlinepi-reboot
Repository:
lp:astral-uv

Recent commits

fdef13d... by konstin

Offlinepi reboot

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

Treat non-existent site-packages as empty (#2413)

## Summary

It turns out this doesn't need to exist until something has been
installed into it. See, e.g., https://github.com/astral-sh/uv/pull/2402.

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

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

Add `UV_NATIVE_TLS` environment variable (#2412)

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

7964bfb... by konstin

Move architecture and operating system probing to Python (#2381)

The architecture of uv does not necessarily match that of the python
interpreter (#2326). In cross compiling/testing scenarios the operating
system can also mismatch. To solve this, we move arch and os detection
to python, vendoring the relevant pypa/packaging code, preventing
mismatches between what the python interpreter was compiled for and what
uv was compiled for.

To make the scripts more manageable, they are now a directory in a
tempdir and we run them with `python -m` . I've simplified the
pypa/packaging code since we're still building the tags in rust. A
`Platform` is now instantiated by querying the python interpreter for
its platform. The pypa/packaging files are copied verbatim for easier
updates except a `lru_cache()` python 3.7 backport.

Error handling is done by a `"result": "success|error"` field that allow
passing error details to rust:

```console
$ uv venv --no-cache
  × Can't use Python at `/home/konsti/projects/uv/.venv/bin/python3`
  ╰─▶ Unknown operation system `linux`
```

I've used the [maturin sysconfig
collection](https://github.com/PyO3/maturin/tree/855f6d2cb1fb8fb43c2bb9e500ab0e5e84bd3140/sysconfig)
as reference. I'm unsure how to test these changes across the wide
variety of platforms.

Fixes #2326

e0ac5b4... by samypr100 <email address hidden>

feat: keep backwards compatibility with `SSL_CERT_FILE` without requiring `--native-tls` (#2401)

## Summary

Small follow up to https://github.com/astral-sh/uv/pull/2362 to check if
`SSL_CERT_FILE` is set to enable `--native-tls` functionality. This
maintains backwards compatibility with `0.1.17` and below users
leveraging only `SSL_CERT_FILE`.

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

## Test Plan

<!-- How was it tested? -->
Assuming `SSL_CERT_FILE` is already working via `--native-tls`, this is
simply a shortcut to enable `--native-tls` functionality implicitly
while still being able to let `rustls-native-certs` handle the loading
of `SSL_CERT_FILE` instead of ourselves.

Edit: Manually tested by setting up own self-signed CA certificate
bundle and set `SSL_CERT_FILE` to this and confirmed the loading happens
without having to specify `--native-tls`.

99c992e... by Charlie Marsh <email address hidden>

Run `cargo update` (#2399)

43dc9c8... by Charlie Marsh <email address hidden>

Bump version to v0.1.18 (#2398)

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

Trim injected `python_version` marker to (major, minor) (#2395)

## Summary

Per [PEP 508](https://peps.python.org/pep-0508/), `python_version` is
just major and minor:

![Screenshot 2024-03-12 at 5 15
09 PM](https://github.com/astral-sh/uv/assets/1309177/cc3b8d65-dab3-4229-aed7-c6fe590b8da0)

Right now, we're using the provided version directly, so if it's, e.g.,
`-p 3.11.8`, we'll inject the wrong marker. This was causing `pandas` to
omit `numpy` when `-p 3.11.8` was provided, since its markers look like:

```
Requires-Dist: numpy<2,>=1.22.4; python_version < "3.11"
Requires-Dist: numpy<2,>=1.23.2; python_version == "3.11"
Requires-Dist: numpy<2,>=1.26.0; python_version >= "3.12"
```

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

00ec993... by Zanie Blue <email address hidden>

Fix bug where `--no-binary :all:` prevented build of editable packages (#2393)

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

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

Expand environment variables prior to detecting scheme (#2394)

## Summary

This PR ensures that we expand environment variables _before_ sniffing
for the URL scheme (e.g., `file://` vs. `https://` vs. something else).

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