astral-uv:konsti/warn-on-slow-resolve

Last commit made on 2024-03-01
Get this branch:
git clone -b konsti/warn-on-slow-resolve https://git.launchpad.net/astral-uv

Branch merges

Branch information

Name:
konsti/warn-on-slow-resolve
Repository:
lp:astral-uv

Recent commits

4385b10... by konstin

Fix windows stack overflows

687239c... by konstin

Warn when trying many versions

In pathological cases, it's hard to follow why the resolution is slow. This is an attempt to give the user an indication what is slow (boto3) and how to fix this (add a manual boto3 constraint). This also helps to determine if this is a pathological case or a server that doesn't support range requests.

The values i picked are somewhat arbitrary.

```
$ uv pip install bio_embeddings
  ⠸ pytest==8.0.2
warning: Downloading metadata for more than 50 different versions of boto3. Consider adding a stricter version constraint for this package to speed up resolution.
  warning: Downloading metadata for more than 50 different versions of botocore. Consider adding a stricter version constraint for this package to speed up resolution.
  ⠼ boto3==1.26.85
```

`warn_user!` interacts badly with the `Reporter`, do we have a way to pause-and-restart the restart the reporter when showing our own messages, similar to tqdm or `IndicatifLayer`?

995fba8... by Charlie Marsh <email address hidden>

Surface the `EXTERNALLY-MANAGED` message to users (#2032)

## Summary

Per the
[spec](https://packaging.python.org/en/latest/specifications/externally-managed-environments/),
this message should be surfaced to users:

![Screenshot 2024-02-27 at 10 42
52 PM](https://github.com/astral-sh/uv/assets/1309177/dac3bd6b-dd05-4146-8faa-f046492e8a26)

3116c37... by Charlie Marsh <email address hidden>

Add `uv pip install --python` to README (#2030)

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

Add a `--python` flag to allow installation into arbitrary Python interpreters (#2000)

## Summary

This PR adds a `--python` flag that allows users to provide a specific
Python interpreter into which `uv` should install packages. This would
replace the `VIRTUAL_ENV=` workaround that folks have been using to
install into arbitrary, system environments, while _also_ actually being
correct for installing into non-virtual environments, where the bin and
site-packages paths can differ.

The approach taken here is to use `sysconfig.get_paths()` to get the
correct paths from the interpreter, and then use those for determining
the `bin` and `site-packages` directories, rather than constructing them
based on hard-coded expectations for each platform.

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

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

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

## Test Plan

- Verified that, on my Windows machine, I was able to install `requests`
into a global environment with: `cargo run pip install requests --python
'C:\\Users\\crmarsh\\AppData\\Local\\Programs\\Python\\Python3.12\\python.exe`,
then `python` and `import requests`.
- Verified that, on macOS, I was able to install `requests` into a
global environment installed via Homebrew with: `cargo run pip install
requests --python $(which python3.8)`.

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

Un-cache editable requirements with dynamic metadata (#2029)

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

8214bfe... by konstin

Always remove color codes from output file (#2018)

Always strip color codes when we're writing to a file.

I don't really know how to test this.

Fixes #2017

30e903e... by Andrew Gallant <email address hidden>

pep440: remove redundant `without_local()` (#2019)

In this context, we already know (as the comment says) that `self` does
not have a local segment, so we don't need to strip it.

This change isn't motivated by anything other than making the code and
comment in sync. For example, when I first looked at it, I wondered
whether the extra stripping was somehow necessary. But it isn't.

cd484d5... by Tim de Jager <email address hidden>

fix: make query method of interpreter public (#2016)

## Summary

Made the `query` method public again, as I believe this currently the
only way to query a intepreter with a custom location.

Closes: #2015

f487b2e... by konstin

Extend contributing instructions (#1983)

* Document good first issues
* Document `scripts` directory, as far as useful for contributors
* Remove compare with pip script, we don't need it anymore

I think this closes #817.

---------

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