uv/crates
Charlie Marsh 7eaed07f6c
Move conflicting dependencies into PubGrub (#1796)
## Summary

This revives a PR from long ago
(https://github.com/astral-sh/uv/pull/383 and
https://github.com/zanieb/pubgrub/pull/24) that modifies how we deal
with dependencies that are declared multiple times within a single
package.

To quote from the originating PR:

> Uses an experimental pubgrub branch (#370) that allows us to handle
multiple version ranges for a single dependency to the solver which
results in better error messages because the derivation tree contains
all of the relevant versions. Previously, the version ranges were merged
(by us) in the resolver before handing them to pubgrub since only one
range could be provided per package. Since we don't merge the versions
anymore, we no longer give the solver an empty range for conflicting
requirements; instead the solver comes to that conclusion from the
provided versions. You can see the improved error message for direct
dependencies in [this
snapshot](https://github.com/astral-sh/puffin/pull/383/files#diff-a0437f2c20cde5e2f15199a3bf81a102b92580063268417847ec9c793a115bd0).

The main issue with that PR was around its handling of URL dependencies,
so this PR _also_ refactors how we handle those. Previously, we stored
URL dependencies on `PubGrubPackage`, but they were omitted from the
hash and equality implementations of `PubGrubPackage`. This led to some
really careful codepaths wherein we had to ensure that we always visited
URLs before non-URL packages, so that the URL-inclusive versions were
included in any hashmaps, etc. I considered preserving this approach,
but it would require us to rely on lots of internal details of PubGrub
(since we'd now be relying on PubGrub to merge those packages in the
"right" order).

So, instead, we now _always_ set the URL on a given package, whenever
that package was _given_ a URL upfront. I think this is easier to reason
about: if the user provided a URL for `flask`, then we should just
always add the URL for `flask`. If we see some other URL for `flask`, we
error, like before. If we see some unknown URL for `flask`, we error,
like before.

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

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

Closes https://github.com/astral-sh/uv/issues/1615.
2024-02-21 21:27:58 -05:00
..
bench Rename to `uv` (#1302) 2024-02-15 11:19:46 -06:00
cache-key Retain passwords in Git URLs (#1717) 2024-02-21 00:12:56 +00:00
distribution-filename Rename to `uv` (#1302) 2024-02-15 11:19:46 -06:00
distribution-types Avoid enforcing URL correctness for installed distributions (#1793) 2024-02-21 09:06:31 -05:00
gourgeist Normalize `VIRTUAL_ENV` path in activation scripts (#1817) 2024-02-21 15:52:32 +00:00
install-wheel-rs Stream zip archive when fetching non-range-request metadata (#1792) 2024-02-20 22:12:21 -05:00
once-map Remove unused deps (#1273) 2024-02-11 18:53:58 +00:00
pep440-rs Backport changes from publish crates (#1739) 2024-02-20 19:33:27 +01:00
pep508-rs Fix pep508-rs tests without features (#1778) 2024-02-20 19:35:36 +00:00
platform-host platform-host: check /bin/sh, then /bin/dash and then /bin/ls (#1818) 2024-02-21 11:49:28 -05:00
platform-tags Treat ARM wheels as higher-priority than universal (#1843) 2024-02-22 01:38:56 +00:00
pypi-types Add fixup for `prefect<1.0.0` (#1825) 2024-02-21 19:47:34 +00:00
requirements-txt Backport changes from publish crates (#1739) 2024-02-20 19:33:27 +01:00
uv Move conflicting dependencies into PubGrub (#1796) 2024-02-21 21:27:58 -05:00
uv-build Use async unzip for local source distributions (#1809) 2024-02-21 14:11:37 +00:00
uv-cache Ensure that builds within the cache aren't considered Git repositories (#1782) 2024-02-20 15:37:05 -05:00
uv-client Use redirected URL as base for relative paths (#1816) 2024-02-21 15:10:25 +00:00
uv-dev Move conflicting dependencies into PubGrub (#1796) 2024-02-21 21:27:58 -05:00
uv-dispatch Move conflicting dependencies into PubGrub (#1796) 2024-02-21 21:27:58 -05:00
uv-distribution Allow non-nested archives for `hexdump` and others (#1564) 2024-02-16 23:17:36 -05:00
uv-extract Preserve executable bit when untarring archives (#1790) 2024-02-21 14:18:44 +00:00
uv-fs Apply percent-decoding to file-based URLs (#1541) 2024-02-16 16:11:16 -05:00
uv-git Improve error message when git ref cannot be fetched (#1826) 2024-02-22 01:22:00 +00:00
uv-installer Ensure extras trigger an install (#1727) 2024-02-20 03:37:35 +00:00
uv-interpreter strip trailing `+` from version number of local Python builds (#1771) 2024-02-20 12:57:28 -05:00
uv-normalize Backport changes from publish crates (#1739) 2024-02-20 19:33:27 +01:00
uv-resolver Move conflicting dependencies into PubGrub (#1796) 2024-02-21 21:27:58 -05:00
uv-traits Fix diagram alignment (#1354) 2024-02-15 15:32:33 -06:00
uv-trampoline Add CMD support (#1523) 2024-02-17 16:47:40 -05:00
uv-warnings Rename to `uv` (#1302) 2024-02-15 11:19:46 -06:00
README.md Rename to `uv` (#1302) 2024-02-15 11:19:46 -06:00

README.md

Crates

bench

Functionality for benchmarking uv.

cache-key

Generic functionality for caching paths, URLs, and other resources across platforms.

distribution-filename

Parse built distribution (wheel) and source distribution (sdist) filenames to extract structured metadata.

distribution-types

Abstractions for representing built distributions (wheels) and source distributions (sdists), and the sources from which they can be downloaded.

gourgeist

A venv replacement to create virtual environments in Rust.

install-wheel-rs

Install built distributions (wheels) into a virtual environment.]

once-map

A waitmap-like concurrent hash map for executing tasks exactly once.

pep440-rs

Utilities for interacting with Python version numbers and specifiers.

pep508-rs

Utilities for interacting with PEP 508 dependency specifiers.

platform-host

Functionality for detecting the current platform (operating system, architecture, etc.).

platform-tags

Functionality for parsing and inferring Python platform tags as per PEP 425.

uv

Command-line interface for the uv package manager.

uv-build

A PEP 517-compatible build frontend for uv.

uv-cache

Functionality for caching Python packages and associated metadata.

uv-client

Client for interacting with PyPI-compatible HTTP APIs.

uv-dev

Development utilities for uv.

uv-dispatch

A centralized struct for resolving and building source distributions in isolated environments. Implements the traits defined in uv-traits.

uv-distribution

Client for interacting with built distributions (wheels) and source distributions (sdists). Capable of fetching metadata, distribution contents, etc.

uv-extract

Utilities for extracting files from archives.

uv-fs

Utilities for interacting with the filesystem.

uv-git

Functionality for interacting with Git repositories.

uv-installer

Functionality for installing Python packages into a virtual environment.

uv-interpreter

Functionality for detecting and leveraging the current Python interpreter.

uv-normalize

Normalize package and extra names as per Python specifications.

uv-package

Types and functionality for working with Python packages, e.g., parsing wheel files.

uv-resolver

Functionality for resolving Python packages and their dependencies.

uv-traits

Shared traits for uv, to avoid circular dependencies.

pypi-types

General-purpose type definitions for types used in PyPI-compatible APIs.

uv-warnings

User-facing warnings for uv.

requirements-txt

Functionality for parsing requirements.txt files.