uv/crates
Skyler Hawthorne 9214855109
fix compile error on missing uv-python metadata (#16154)
The `uv-python` crate reads the checked-in download metadata to write
out a minified version to be statically included into the binary.

Sometimes, the resulting `download-metadata-minified.json` can go
missing, such as when `uv` is installed via `cargo` as a git source, and
there is an update; `cargo` will do a hard reset on the git repo it
stores in the cache, causing it to be deleted. In these instances, the
`uv-python` crate does not currently re-run its build script, because as
it happens, there was no change to the `download-metadata.json` since it
was last compiled. This causes a build error like:

```
            Updating git repository `https://github.com/astral-sh/uv`
          Installing uv v0.8.24 (https://github.com/astral-sh/uv?tag=0.8.24#252f8873)
            Updating crates.io index
           Compiling uv-version v0.8.24 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-version)
           Compiling uv-git v0.0.1 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-git)
           Compiling uv-build-backend v0.1.0 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-build-backend)
           Compiling uv-configuration v0.0.1 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-configuration)
           Compiling uv-client v0.0.1 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-client)
           Compiling uv-extract v0.0.1 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-extract)
           Compiling uv-workspace v0.0.1 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-workspace)
           Compiling uv-python v0.0.1 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-python)
           Compiling uv-requirements-txt v0.0.1 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-requirements-txt)
           Compiling uv-bin-install v0.0.1 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-bin-install)
           Compiling uv-publish v0.1.0 (/home/skhawtho/.cargo/git/checkouts/uv-c9e40703e19509a8/252f887/crates/uv-publish)
        error: couldn't read `crates/uv-python/src/download-metadata-minified.json`: No such file or directory (os error 2)
           --> crates/uv-python/src/downloads.rs:795:45
            |
        795 | const BUILTIN_PYTHON_DOWNLOADS_JSON: &str = include_str!("download-metadata-minified.json");
            |                                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

        error: could not compile `uv-python` (lib) due to 1 previous error
        error: failed to compile `uv v0.8.24 (https://github.com/astral-sh/uv?tag=0.8.24#252f8873)`, intermediate artifacts can be found at `/home/skhawtho/.cache/cargo`.
        To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
```

This fixes the issue by also adding a `rerun-if-changed` on the
resulting minified JSON file.

Separately, this revision also changes the output directory of the
minified file to the build script's output directory via the `OUT_DIR`
environment variable, so as not to pollute the source code.
2025-10-07 12:33:04 -05:00
..
uv Allow use of free-threaded variants in Python 3.14+ without explicit opt-in (#16142) 2025-10-07 11:24:05 -05:00
uv-auth Make cache control lookups robust to username (#16088) 2025-10-01 16:57:50 -04:00
uv-bench Use a global `BaseClientBuilder` (#15548) 2025-08-29 13:30:51 -05:00
uv-bin-install Retry streaming Python and bin download errors (#15567) 2025-08-31 15:07:22 +00:00
uv-build Bump version to 0.8.24 (#16146) 2025-10-07 03:03:01 +00:00
uv-build-backend Better warning for no direct build (#15898) 2025-09-17 13:18:41 +02:00
uv-build-frontend fix misleading debug message in uv sync (#15881) 2025-09-16 18:39:08 +00:00
uv-cache Add `--force` flag for `uv cache clean` (#15992) 2025-09-22 22:15:14 +00:00
uv-cache-info Follow links when cache-key is a glob (#13438) 2025-07-14 11:35:34 -04:00
uv-cache-key Add `DisplaySafeUrl` newtype to prevent leaking of credentials by default (#13560) 2025-05-27 00:05:30 +02:00
uv-cli Add `--force` flag for `uv cache prune` (#16137) 2025-10-06 11:36:58 -05:00
uv-client Use `EnvVars` in linehaul (#15931) 2025-09-18 14:08:58 +00:00
uv-configuration Allow escaping spaces in --env-file handling (#15815) 2025-09-12 18:11:51 -04:00
uv-console Bump MSRV to 1.88 (#15935) 2025-09-18 14:00:39 -04:00
uv-dev Sync latest Python releases (#15958) 2025-09-20 02:25:21 +00:00
uv-dirs Use workspace dependencies for crate dev-dependencies (#14903) 2025-07-25 13:57:49 -05:00
uv-dispatch Fix `uv sync --no-sources` not switching from editable to registry installations (#15234) 2025-09-17 06:35:32 -05:00
uv-distribution Add S3 request signing (#15925) 2025-09-22 23:59:52 +00:00
uv-distribution-filename Add logging of incompatible tags on satisfies check (#15663) 2025-09-03 11:45:49 -05:00
uv-distribution-types Make cache control lookups robust to username (#16088) 2025-10-01 16:57:50 -04:00
uv-extract Respect `UV_INSECURE_NO_ZIP_VALIDATION=1` in duplicate header errors (#15912) 2025-09-17 14:34:49 +00:00
uv-flags Use a global flags instance for wheel check (#16047) 2025-09-30 00:10:11 +00:00
uv-fs Add `--force` flag for `uv cache clean` (#15992) 2025-09-22 22:15:14 +00:00
uv-git Update Rust toolchain to 1.89 (#15157) 2025-08-08 13:01:52 +00:00
uv-git-types Include SHA when listing lockfile changes (#15817) 2025-09-12 17:57:58 +00:00
uv-globfilter additional use of Self, remove * and & where not needed (#15091) 2025-08-05 15:19:56 -05:00
uv-install-wheel Use a global flags instance for wheel check (#16047) 2025-09-30 00:10:11 +00:00
uv-installer Avoid ANSI codes in debug! messages (#15843) 2025-09-17 14:30:43 +00:00
uv-keyring Use the `windows` crate facade consistently (#15737) 2025-09-09 15:07:14 +00:00
uv-logging Add logging to the uv build backend (#15533) 2025-08-27 09:14:00 +02:00
uv-macros Fix typo in `_CONDA_ROOT` docs (#16114) 2025-10-03 10:38:00 -05:00
uv-metadata Harden ZIP streaming to reject repeated entries and other malformed ZIP files (#15136) 2025-08-07 15:31:48 +01:00
uv-normalize Add `rkyv` implementation for Core Metadata (#15532) 2025-08-26 10:22:50 -04:00
uv-once-map Make the use of `Self` consistent. (#15074) 2025-08-05 20:17:12 +01:00
uv-options-metadata Make the use of `Self` consistent. (#15074) 2025-08-05 20:17:12 +01:00
uv-pep440 Update Rust toolchain to 1.89 (#15157) 2025-08-08 13:01:52 +00:00
uv-pep508 Add `rkyv` implementation for Core Metadata (#15532) 2025-08-26 10:22:50 -04:00
uv-performance-memory-allocator Update Rust crate mimalloc to v0.1.48 (#15724) 2025-09-08 07:08:37 +00:00
uv-platform Don't trace logs all architectures (#15710) 2025-09-07 17:31:50 +02:00
uv-platform-tags Improve BSD tag construction (#15829) 2025-09-14 10:48:37 -04:00
uv-preview Add S3 request signing (#15925) 2025-09-22 23:59:52 +00:00
uv-publish Rename `provides_extras` to `provides_extra` (#15825) 2025-09-14 13:27:45 +00:00
uv-pypi-types Remove tracking of inferred dependency conflicts (#15909) 2025-10-01 10:03:42 -05:00
uv-python fix compile error on missing uv-python metadata (#16154) 2025-10-07 12:33:04 -05:00
uv-redacted Make the use of `Self` consistent. (#15074) 2025-08-05 20:17:12 +01:00
uv-requirements Avoid re-parsing `pyproject.toml` when provided as a source (#15851) 2025-09-15 10:07:38 -04:00
uv-requirements-txt Support recursive requirements and constraints inclusion (#15657) 2025-09-05 11:20:12 +02:00
uv-resolver Don't warn when dependency is constraint by other dependency (#16149) 2025-10-07 17:59:01 +02:00
uv-scripts Import `PackageName` from `uv-normalize` (#15439) 2025-08-21 23:15:40 +00:00
uv-settings Move `TRACING_DURATIONS_FILE` to `EnvironmentOptions` (#16109) 2025-10-04 00:09:55 -05:00
uv-shell Use the `windows` crate facade consistently (#15737) 2025-09-09 15:07:14 +00:00
uv-small-str Update schemars 1.0.0 (#13693) 2025-06-24 21:43:31 +02:00
uv-state Add pyx support to `uv auth` commands (#15636) 2025-09-02 18:18:09 -04:00
uv-static Use a global flags instance for wheel check (#16047) 2025-09-30 00:10:11 +00:00
uv-tool fix misleading debug message in uv sync (#15881) 2025-09-16 18:39:08 +00:00
uv-torch Add PyG packages to torch backend (#15911) 2025-09-17 14:18:30 +00:00
uv-trampoline Update trampoline to ~1.87 nightly (#15052) 2025-08-06 12:45:04 +00:00
uv-trampoline-builder Use workspace dependencies for crate dev-dependencies (#14903) 2025-07-25 13:57:49 -05:00
uv-types Import `PackageName` from `uv-normalize` (#15439) 2025-08-21 23:15:40 +00:00
uv-version Bump version to 0.8.24 (#16146) 2025-10-07 03:03:01 +00:00
uv-virtualenv fix misleading debug message in uv sync (#15881) 2025-09-16 18:39:08 +00:00
uv-warnings Better warning chain styling (#14934) 2025-07-28 16:23:39 +00:00
uv-workspace Allow `[project]` to be missing from a `pyproject.toml` (#14113) 2025-09-17 10:48:56 -05:00
README.md Link to Dependency specifiers instead of PEP 508 (#8411) 2024-10-21 14:43:38 -04:00

README.md

Crates

uv-bench

Functionality for benchmarking uv.

uv-cache-key

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

uv-distribution-filename

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

uv-distribution-types

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

uv-install-wheel-rs

Install built distributions (wheels) into a virtual environment.

uv-once-map

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

uv-pep440-rs

Utilities for interacting with Python version numbers and specifiers.

uv-pep508-rs

Utilities for parsing and evaluating dependency specifiers, previously known as PEP 508.

uv-platform-tags

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

uv-cli

Command-line interface for the uv package manager.

uv-build-frontend

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

Functionality for detecting and leveraging the current Python interpreter.

uv-normalize

Normalize package and extra names as per Python specifications.

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

Utilities for detecting and manipulating shell environments.

uv-types

Shared traits for uv, to avoid circular dependencies.

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

uv-workspace

Workspace abstractions for uv.

uv-requirements-txt

Functionality for parsing requirements.txt files.