uv/crates
konsti 1142a14f4d
Check compatibility for cached unzipped wheels (#501)
**Motivation** Previously, we would install any wheel with the correct
package name and version from the cache, even if it doesn't match the
current python interpreter.

**Summary** The unzipped wheel cache for registries now uses the entire
wheel filename over the name-version (`editables-0.5-py3-none-any.whl`
over `editables-0.5`).

Built wheels are not stored in the `wheels-v0` unzipped wheels cache
anymore. For each source distribution, there can be multiple built
wheels (with different compatibility tags), so i argue that we need a
different cache structure for them (follow up PR).

For `all-kinds.in` with

```bash
rm -rf cache-all-kinds
virtualenv --clear -p 3.12 .venv
cargo run --bin puffin -- pip-sync --cache-dir cache-all-kinds target/all-kinds.txt
```

we get:

**Before**
```
cache-all-kinds/wheels-v0/
├── registry
│   ├── annotated_types-0.6.0
│   ├── asgiref-3.7.2
│   ├── blinker-1.7.0
│   ├── certifi-2023.11.17
│   ├── cffi-1.16.0
│   ├── [...]
│   ├── tzdata-2023.3
│   ├── urllib3-2.1.0
│   └── wheel-0.42.0
└── url
    ├── 4b8be67c801a7ecb
    │   ├── flask
    │   └── flask-3.0.0.dist-info
    ├── 6781bd6440ae72c2
    │   ├── werkzeug
    │   └── werkzeug-3.0.1.dist-info
    └── a67db8ed076e3814
        ├── pydantic_extra_types
        └── pydantic_extra_types-2.1.0.dist-info

48 directories, 0 files
```

**After**

```
cache-all-kinds/wheels-v0/
├── registry
│   ├── annotated_types-0.6.0-py3-none-any.whl
│   ├── asgiref-3.7.2-py3-none-any.whl
│   ├── blinker-1.7.0-py3-none-any.whl
│   ├── certifi-2023.11.17-py3-none-any.whl
│   ├── cffi-1.16.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
│   ├── [...]
│   ├── tzdata-2023.3-py2.py3-none-any.whl
│   ├── urllib3-2.1.0-py3-none-any.whl
│   └── wheel-0.42.0-py3-none-any.whl
└── url
    └── 4b8be67c801a7ecb
        └── flask-3.0.0-py3-none-any.whl

39 directories, 0 files
```

**Outlook** Part of #477 "Fix wheel caching". Further tasks:
* Replace the `CacheShard` with `WheelMetadataCache` which handles urls
properly.
* Delete unzipped wheels when their remote wheel changed
* Store built wheels next to the `metadata.json` in the source dist
directory; delete built wheels when their source dist changed (different
cache bucket, but it's the same problem of fixing wheel caching) I'll
make stacked PRs for those
2023-11-27 16:03:58 -08:00
..
bench Use Clippy lint table over Cargo config (#490) 2023-11-22 15:10:27 +00:00
distribution-filename Use Clippy lint table over Cargo config (#490) 2023-11-22 15:10:27 +00:00
distribution-types Check compatibility for cached unzipped wheels (#501) 2023-11-27 16:03:58 -08:00
gourgeist puffin_interpreter cleanup ahead of #235 (#492) 2023-11-23 08:57:33 +00:00
install-wheel-rs Use Clippy lint table over Cargo config (#490) 2023-11-22 15:10:27 +00:00
pep440-rs Consistent Cargo.toml syntax (#483) 2023-11-22 08:34:08 +00:00
pep508-rs Consistent Cargo.toml syntax (#483) 2023-11-22 08:34:08 +00:00
platform-host Use Clippy lint table over Cargo config (#490) 2023-11-22 15:10:27 +00:00
platform-tags Add Tags::from_interpreter (#498) 2023-11-24 11:36:01 +00:00
puffin-build puffin_interpreter cleanup ahead of #235 (#492) 2023-11-23 08:57:33 +00:00
puffin-cache Avoid clone for WheelMetadataCache (#500) 2023-11-25 23:33:59 +00:00
puffin-cli Check compatibility for cached unzipped wheels (#501) 2023-11-27 16:03:58 -08:00
puffin-client Avoid clone for WheelMetadataCache (#500) 2023-11-25 23:33:59 +00:00
puffin-dev Source dist metadata refactor (#468) 2023-11-24 17:47:58 +00:00
puffin-dispatch Check compatibility for cached unzipped wheels (#501) 2023-11-27 16:03:58 -08:00
puffin-distribution Avoid clone for WheelMetadataCache (#500) 2023-11-25 23:33:59 +00:00
puffin-git Perform a single Git fetch when building source distributions (#499) 2023-11-25 23:29:41 +00:00
puffin-installer Check compatibility for cached unzipped wheels (#501) 2023-11-27 16:03:58 -08:00
puffin-interpreter puffin_interpreter cleanup ahead of #235 (#492) 2023-11-23 08:57:33 +00:00
puffin-macros Use Clippy lint table over Cargo config (#490) 2023-11-22 15:10:27 +00:00
puffin-normalize Split puffin-package into requirements.txt parser and pypi-types (#341) 2023-11-06 18:19:49 +00:00
puffin-resolver Source dist metadata refactor (#468) 2023-11-24 17:47:58 +00:00
puffin-traits puffin_interpreter cleanup ahead of #235 (#492) 2023-11-23 08:57:33 +00:00
puffin-workspace Use Clippy lint table over Cargo config (#490) 2023-11-22 15:10:27 +00:00
pypi-types Use Clippy lint table over Cargo config (#490) 2023-11-22 15:10:27 +00:00
requirements-txt Use Clippy lint table over Cargo config (#490) 2023-11-22 15:10:27 +00:00
README.md Unify distribution operations into a single crate (#460) 2023-11-20 11:22:52 +00:00

Crates

bench

Functionality for benchmarking Puffin.

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

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.

puffin-build

A PEP 517-compatible build frontend for Puffin.

puffin-cache

Functionality for caching Python packages and associated metadata.

puffin-cli

Command-line interface for the Puffin package manager.

puffin-client

Client for interacting with PyPI-compatible HTTP APIs.

puffin-dev

Development utilities for Puffin.

puffin-dispatch

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

puffin-distribution

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

puffin-git

Functionality for interacting with Git repositories.

puffin-installer

Functionality for installing Python packages into a virtual environment.

puffin-interpreter

Functionality for detecting and leveraging the current Python interpreter.

puffin-macros

Reusable procedural macros for Puffin.

puffin-normalize

Normalize package and extra names as per Python specifications.

puffin-package

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

puffin-resolver

Functionality for resolving Python packages and their dependencies.

puffin-traits

Shared traits for Puffin, to avoid circular dependencies.

pypi-types

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

requirements-txt

Functionality for parsing requirements.txt files.