uv/crates
Tom Parker-Shemilt bc963d13cb
Annotate sources of requirements (#3269)
## Summary

Fixes https://github.com/astral-sh/uv/issues/1343. This is kinda a first
draft at the moment, but does at least mostly work locally (barring some
bits of the test suite that seem to not work for me in general).

## Test Plan

Mostly running the existing tests and checking the revised output is
sane

## Outstanding issues

Most of these come down to "AFAIK, the existing tools don't support
these patterns, but `uv` does" and so I'm not sure there's an existing
good answer here! Most of the answers so far are "whatever was easiest
to build"

- [x] ~~Is "-r pyproject.toml" correct? Should it show something else or
get skipped entirely~~ No it wasn't. Fixed in
3044fa8b86
- [ ] If the requirements file is stdin, that just gets skipped. Should
it be recorded?
- [ ] Overrides get shown as "--override<override.txt>". Correct?
- [x] ~~Some of the tests (e.g.
`dependency_excludes_non_contiguous_range_of_compatible_versions`) make
assumptions about the order of package versions being outputted, which
this PR breaks. I'm not sure if the text is fairly arbitrary and can be
replaced or whether the behaviour needs fixing?~~ - fixed by removing
the custom pubgrub PartialEq/Hash
- [ ] Are all the `TrackedFromStr` et al changes needed, or is there an
easier way? I don't think so, I think it's necessary to track these sort
of things fairly comprehensively to make this feature work, and this
sort of invasive change feels necessary, but happy to be proved wrong
there :)
- [x] ~~If you have a requirement coming in from two or more different
requirements files only one turns up. I've got a closed-source example
for this (can go into more detail if needed), mostly consisting of a
complicated set of common deps creating a larger set. It's a rarer case,
but worth considering.~~ 042432b200
- [ ] Doesn't add annotations for `setup.py` yet
- This is pretty hard, as the correct location to insert the path is
`crates/pypi-types/src/metadata.rs`'s `parse_pkg_info`, which as it's
based off a source distribution has entirely thrown away such matters as
"where did this package requirement get built from". Could add "`built
package name`" as a dep, but that's a little odd.
2024-05-08 23:19:22 -04:00
..
bench Add basic tool.uv.sources support (#3263) 2024-05-03 21:10:50 +00:00
cache-key Avoid panic for file url (#3306) 2024-04-29 16:39:16 +02:00
distribution-filename require serde and rkyv everywhere; remove optional serde and rkyv features (#3345) 2024-05-03 10:21:03 -04:00
distribution-types Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
install-wheel-rs Apply normcase to line from easy-install.pth (#3451) 2024-05-08 10:40:21 +02:00
once-map once-map: avoid hard-coding Arc (#3242) 2024-04-24 11:11:46 -04:00
pep440-rs Improve trailing version string error message (#3453) 2024-05-08 14:50:29 +02:00
pep508-rs Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
platform-tags Update Rust to v1.78 (#3361) 2024-05-03 20:07:13 +00:00
pypi-types Use Metadata10 to parse PKG-INFO of legacy editable (#3450) 2024-05-08 10:58:18 +02:00
requirements-txt Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
uv Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
uv-auth Update pre-commit dependencies (#3391) 2024-05-06 02:18:51 +00:00
uv-build Remove unnecessary uses of DashMap and Arc (#3413) 2024-05-06 22:30:43 -04:00
uv-cache Update Rust to v1.78 (#3361) 2024-05-03 20:07:13 +00:00
uv-client Upgrade async_http_range_reader to v0.8.0 (#3460) 2024-05-08 10:54:08 -04:00
uv-configuration Respect MACOSX_DEPLOYMENT_TARGET in --python-platform (#3470) 2024-05-08 20:03:41 +00:00
uv-dev Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
uv-dispatch Remove unnecessary uses of DashMap and Arc (#3413) 2024-05-06 22:30:43 -04:00
uv-distribution Remove unnecessary uses of DashMap and Arc (#3413) 2024-05-06 22:30:43 -04:00
uv-extract Use into_par_iter instead of par_bridge (#3435) 2024-05-07 19:38:35 +00:00
uv-fs Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
uv-git Add branch and tag variants to Git reference (#3374) 2024-05-04 21:13:11 +00:00
uv-installer Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
uv-interpreter Improve JSON Schema and add export script (#3461) 2024-05-08 16:15:16 +00:00
uv-normalize Improve JSON Schema and add export script (#3461) 2024-05-08 16:15:16 +00:00
uv-requirements Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
uv-resolver Annotate sources of requirements (#3269) 2024-05-08 23:19:22 -04:00
uv-trampoline Use c-string literals and update trampolines (#2590) 2024-03-21 15:36:00 +00:00
uv-types Add basic uv sync and uv lock commands (#3436) 2024-05-08 14:51:51 +00:00
uv-version Bump version to v0.1.42 (#3472) 2024-05-08 17:47:16 -04:00
uv-virtualenv Rename --force to --allow-existing (#3416) 2024-05-07 17:11:31 +00:00
uv-warnings Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
uv-workspace Disallow pyproject.toml files for non-project configuration (#3463) 2024-05-08 14:49:52 -04:00
README.md Rename uv-traits and split into separate modules (#2674) 2024-03-26 15:39:43 -05:00

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.

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-types.

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-requirements

Utilities for reading package requirements from pyproject.toml and requirements.txt files.

uv-resolver

Functionality for resolving Python packages and their dependencies.

uv-types

Shared traits for uv, to avoid circular dependencies.

pypi-types

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

uv-virtualenv

A venv replacement to create virtual environments in Rust.

uv-warnings

User-facing warnings for uv.

requirements-txt

Functionality for parsing requirements.txt files.