astral-uv:zb/unusable-versions

Last commit made on 2023-12-12
Get this branch:
git clone -b zb/unusable-versions https://git.launchpad.net/astral-uv

Branch merges

Branch information

Name:
zb/unusable-versions
Repository:
lp:astral-uv

Recent commits

844dd0a... by Zanie <email address hidden>

Add handling for formatting `UnusableVersions` incompatibility

4fb2e09... by Charlie Marsh <email address hidden>

Add a fast-path to skip resolution when installation is complete (#613)

For a very large resolution (a few hundred packages), I see 13ms vs.
400ms for a no-op. It's worth optimizing this case, in my opinion.

3aaab32... by Charlie Marsh <email address hidden>

Omit extra in resolver progress (#623)

Closes #621.

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

Validate installed packages in virtual environment (#611)

## Summary

Now, after running `pip-install`, we validate that the set of installed
packages is consistent -- that is, that we don't have any packages that
are missing dependencies, or incompatible versions of installed
dependencies.

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

Avoid double-resolving during `pip-install` (#610)

## Summary

At present, when performing a `pip-install`, we first do a resolution,
then take the set of requirements and basically run them through our
`pip-sync`, which itself includes re-resolving the dependencies to get a
specific `Dist` for each package. (E.g., the set of requirements might
say `flask==3.0.0`, but the installer needs a specific _wheel_ or source
distribution to install.)

This PR removes this second resolution by exposing the set of pinned
packages from the resolution. The main challenge here is that we have an
optimization in the resolver such that we let the resolver read metadata
from an incompatible wheel as long as a source distribution exists for a
given package. This lets us avoid building source distributions in the
resolver under the assumption that we'll be able to install the package
later on, if needed. As such, the resolver now needs to track the
resolution and installation filenames separately.

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

Respect existing versions when pip-installing (#608)

## Summary

When running `puffin pip-install`, we should respect versions that are
already installed in the environment. For example, if you run `puffin
pip-install flask==2.0.0` and then `puffin pip-install flask`, we should
avoid upgrading Flask. The most natural way to model this is to mark
them as "preferences".

(It's not enough to just filter those requirements out prior to
resolving, since we may not have the _dependencies_ of those packages
installed. We _could_ recursively verify this across the
`site-packages`, but that would be a larger PR.)

974cb4c... by Charlie Marsh <email address hidden>

Add a `pip-install` subcommand (#607)

## Summary

This PR adds a `pip-install` command that operates like, well, `pip
install`. In short, it resolves the provided dependency, then makes sure
they're all installed in the environment. The primary differences with
`pip-sync` are that (1) `pip-sync` ignores dependencies, and assumes
that the packages represent a complete set; and (2) `pip-sync`
uninstalls any unlisted packages.

There are a bunch of TODOs that I'll resolve in subsequent PRs.

Closes https://github.com/astral-sh/puffin/issues/129.

fd5544b... by konstin

Add transformers extra requirements (#618)

I use those a lot for testing

3e837da... by Charlie Marsh <email address hidden>

Avoid unicode decoding in name normalization (#617)

5ae4023... by konstin

Activate venv before source dist build (#567)

Fixes #552