astral-uv:zb/venv-no-venv-reg

Last commit made on 2024-05-22
Get this branch:
git clone -b zb/venv-no-venv-reg https://git.launchpad.net/astral-uv

Branch merges

Branch information

Name:
zb/venv-no-venv-reg
Repository:
lp:astral-uv

Recent commits

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

Do not discover virtual environment interpreters in `uv venv --python ...`

285adae... by Charlie Marsh <email address hidden>

Remove some dependencies on `EditableRequirement` (#3727)

## Summary

Use `LocalEditable` instead throughout the `ResolvedEditable` pipeline.

1379fb7... by Zanie Blue <email address hidden>

Add support for requesting `pypy` interpreters by implementation name (#3706)

Updates our executable name searches to support implementation names
i.e. `cpython` and `pypy` and adds support for PyPy.

We might want to _not_ support searching for `cpython` because that's
non-standard?

84afca2... by Zanie Blue <email address hidden>

Add offline support to `uv tool run` and `uv run` (#3676)

Adds `--offline` support to `uv tool run` and `uv run` because I needed
it on the airplane today.

I think we should move `--offline` to the global settings like
`--native-tls`.

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

Revert "Support editables in `uv sync` (#3692)" (#3696) (#3722)

## Summary

This is just a re-apply of #3696, which @konstin accidentally reverted
in #3585.

Co-authored-by: konsti <email address hidden>

92c7013... by Zanie Blue <email address hidden>

Fix `uv tool run` interpreter lookup (#3721)

558f628... by Charlie Marsh <email address hidden>

Propagate URL errors in verbatim parsing (#3720)

## Summary

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

## Test Plan

```
❯ echo "/../test" | cargo run pip compile -
error: Couldn't parse requirement in `-` at position 0
  Caused by: path could not be normalized: /../test
/../test
^^^^^^^^

❯ echo "-e /../test" | cargo run pip compile -
error: Invalid URL in `-`: `/../test`
  Caused by: path could not be normalized: /../test
  Caused by: cannot normalize a relative path beyond the base directory
```

19df1a4... by Zanie Blue <email address hidden>

Rename all instances of `Cpython` to `CPython` (#3702)

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

Add initial implementation of `uv tool run` (#3657)

This is mostly a shorter version of `uv run` that infers a requirement
name from the command. The main goal here is to do the smallest amount
of work necessary to get #3560 started.

Closes #3613

e.g.
```shell
$ uv tool run -- ruff check
warning: `uv tool run` is experimental and may change without warning.
Resolved 1 package in 34ms
Installed 1 package in 2ms
 + ruff==0.4.4
error: Failed to parse example.py:1:5: Expected an expression
example.py:1:5: E999 SyntaxError: Expected an expression
Found 1 error.
```

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

Rewrite Python interpreter discovery (#3266)

Updates our Python interpreter discovery to conform to the rules
described in #2386, please see that issue for a full description of the
behavior. Briefly, we now will search for interpreters that satisfy a
requested version without stopping at the first Python executable.
Additionally, if retrieving information about an interpreter fails we
will continue to search for a working interpreter. We also add the
plumbing necessary to request Python implementations other than CPython,
though we do not add support for other implementations at this time.

A major internal goal of this work is to prepare for user-facing managed
toolchains i.e. fetching a requested version during `uv run`. These APIs
are not introduced, but there is some managed toolchain handling as
required for our test suite.

Some noteworthy implementation changes:

- The `uv_interpreter::find_python` module has been removed in favor of
a `uv_interpreter::discovery` module.
- There are new types to help structure interpreter requests and track
sources
- Executable discovery is implemented as a big lazy iterator and is a
central authority for source precedence
- `uv_interpreter::Error` variants were split into scoped types in each
module
- There's much more unit test coverage, but not for Windows yet

Remaining work:

- [x] Write new test cases
- [x] Determine correct behavior around executables in the current
directory
- _Future_: Combine `PythonVersion` and `VersionRequest`
- _Future_: Consider splitting `ManagedToolchain` into local and remote
variants
- _Future_: Add Windows unit test coverage
- _Future_: Explore behavior around implementation precedence (i.e.
CPython over PyPy)

Refactors split into:

- #3329
- #3330
- #3331
- #3332

Closes #2386