uv/crates
Charlie Marsh eb21e4bd25
Some checks are pending
CI / check system | alpine (push) Blocked by required conditions
CI / check system | python on macos aarch64 (push) Blocked by required conditions
CI / check system | homebrew python on macos aarch64 (push) Blocked by required conditions
CI / check system | python on macos x86_64 (push) Blocked by required conditions
CI / check system | python3.10 on windows (push) Blocked by required conditions
CI / Determine changes (push) Waiting to run
CI / lint (push) Waiting to run
CI / cargo clippy | ubuntu (push) Blocked by required conditions
CI / cargo clippy | windows (push) Blocked by required conditions
CI / cargo dev generate-all (push) Blocked by required conditions
CI / cargo shear (push) Waiting to run
CI / check windows trampoline | i686 (push) Blocked by required conditions
CI / cargo test | ubuntu (push) Blocked by required conditions
CI / cargo test | macos (push) Blocked by required conditions
CI / cargo test | windows (push) Blocked by required conditions
CI / check windows trampoline | aarch64 (push) Blocked by required conditions
CI / check windows trampoline | x86_64 (push) Blocked by required conditions
CI / test windows trampoline | i686 (push) Blocked by required conditions
CI / test windows trampoline | x86_64 (push) Blocked by required conditions
CI / typos (push) Waiting to run
CI / mkdocs (push) Waiting to run
CI / build binary | linux (push) Blocked by required conditions
CI / build binary | macos aarch64 (push) Blocked by required conditions
CI / build binary | macos x86_64 (push) Blocked by required conditions
CI / build binary | windows (push) Blocked by required conditions
CI / cargo build (msrv) (push) Blocked by required conditions
CI / build binary | freebsd (push) Blocked by required conditions
CI / ecosystem test | prefecthq/prefect (push) Blocked by required conditions
CI / ecosystem test | pallets/flask (push) Blocked by required conditions
CI / integration test | conda on ubuntu (push) Blocked by required conditions
CI / integration test | free-threaded on linux (push) Blocked by required conditions
CI / integration test | free-threaded on windows (push) Blocked by required conditions
CI / integration test | pypy on ubuntu (push) Blocked by required conditions
CI / integration test | pypy on windows (push) Blocked by required conditions
CI / integration test | graalpy on ubuntu (push) Blocked by required conditions
CI / integration test | graalpy on windows (push) Blocked by required conditions
CI / integration test | github actions (push) Blocked by required conditions
CI / integration test | determine publish changes (push) Blocked by required conditions
CI / integration test | uv publish (push) Blocked by required conditions
CI / check cache | ubuntu (push) Blocked by required conditions
CI / check cache | macos aarch64 (push) Blocked by required conditions
CI / check system | python on debian (push) Blocked by required conditions
CI / check system | python on fedora (push) Blocked by required conditions
CI / check system | python on ubuntu (push) Blocked by required conditions
CI / check system | python on opensuse (push) Blocked by required conditions
CI / check system | python on rocky linux 8 (push) Blocked by required conditions
CI / check system | python on rocky linux 9 (push) Blocked by required conditions
CI / check system | pypy on ubuntu (push) Blocked by required conditions
CI / check system | pyston (push) Blocked by required conditions
CI / check system | python3.10 on windows x86 (push) Blocked by required conditions
CI / check system | python3.13 on windows (push) Blocked by required conditions
CI / check system | python3.12 via chocolatey (push) Blocked by required conditions
CI / check system | python3.9 via pyenv (push) Blocked by required conditions
CI / check system | python3.13 (push) Blocked by required conditions
CI / check system | conda3.11 on linux (push) Blocked by required conditions
CI / check system | conda3.8 on linux (push) Blocked by required conditions
CI / check system | conda3.11 on macos (push) Blocked by required conditions
CI / check system | conda3.8 on macos (push) Blocked by required conditions
CI / check system | conda3.11 on windows (push) Blocked by required conditions
CI / check system | conda3.8 on windows (push) Blocked by required conditions
CI / check system | amazonlinux (push) Blocked by required conditions
CI / check system | embedded python3.10 on windows (push) Blocked by required conditions
CI / benchmarks (push) Blocked by required conditions
Retry on tar extraction errors (#9753)
## Summary

So the error here is:

```rust
ExtractError("cpython-3.11.11%2B20241206-aarch64-apple-darwin-install_only_stripped.tar.gz", Io(Custom { kind: UnexpectedEof, error: TarError { desc: "failed to unpack `/Users/crmarsh/.local/share/uv/python/.cache/.tmpkqFzqE/python/lib/libpython3.11.dylib`", io: Custom { kind: UnexpectedEof, error: TarError { desc: "failed to unpack `python/lib/libpython3.11.dylib` into `/Users/crmarsh/.local/share/uv/python/.cache/.tmpkqFzqE/python/lib/libpython3.11.dylib`", io: Custom { kind: UnexpectedEof, error: "unexpected end of file" } } } } }))
```

This isn't a Reqwest error, so we miss it in
`is_extended_transient_error`.

We could add `TarError` or `ExtractError` here, but... should we? This
PR just extends it to any error that has an IO source. I don't see much
of a downside.

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

## Test Plan

First, ran: `uv run ./scripts/create-python-mirror.py --name cpython
--arch aarch64 --os darwin`.

Then, dropped this into `./scripts/mirror/server.py`:

```python
import os
import random
from http.server import SimpleHTTPRequestHandler, HTTPServer


class GlitchyStaticServer(SimpleHTTPRequestHandler):
    def do_GET(self):
        """Handle GET request."""
        file_path = self.translate_path(self.path)
        
        if not os.path.exists(file_path):
            self.send_error(404, "File not found")
            return
        
        try:
            with open(file_path, 'rb') as f:
                file_content = f.read()

            # Introduce an "unexpected end of file" glitch randomly
            if random.random() < 0.75:  # 75% chance of glitch
                glitch_point = random.randint(1, len(file_content) - 1)
                file_content = file_content[:glitch_point]

            self.send_response(200)
            self.send_header("Content-type", self.guess_type(file_path))
            self.send_header("Content-Length", len(file_content))
            self.end_headers()
            self.wfile.write(file_content)
        
        except Exception as e:
            self.send_error(500, f"Internal Server Error: {e}")
        

def run(server_class=HTTPServer, handler_class=GlitchyStaticServer, port=8080):
    """Run the server."""
    server_address = ('', port)
    httpd = server_class(server_address, handler_class)
    print(f"Serving on port {port} with glitchy behavior")
    httpd.serve_forever()


if __name__ == "__main__":
    run()
```

Then ran `python server.py` from that directory.

From there, ran `UV_PYTHON_INSTALL_MIRROR="http://localhost:8080" cargo
run python install 3.11 --reinstall --verbose` to reliably test retries.
2024-12-10 07:33:08 -05:00
..
uv Filter out commit since last tag in tests (#9766) 2024-12-10 11:37:06 +00:00
uv-auth Publish: Warn when keyring has no password (#8827) 2024-11-27 20:54:49 +01:00
uv-bench Build backend: Add direct builds to the resolver and installer (#9621) 2024-12-04 15:57:18 +00:00
uv-build-backend Build backend: Add direct builds to the resolver and installer (#9621) 2024-12-04 15:57:18 +00:00
uv-build-frontend Build backend: Add direct builds to the resolver and installer (#9621) 2024-12-04 15:57:18 +00:00
uv-cache Revert "Upgrade to Rust 1.83 (#9511)" (#9617) 2024-12-03 19:21:05 +00:00
uv-cache-info Improve error message for cache info serialization (#8500) 2024-10-23 13:17:31 +00:00
uv-cache-key Remove separate test files in favor of same-file mod tests (#9199) 2024-11-18 20:11:46 +00:00
uv-cli Fix commits_since_last_tag in version info (#9730) 2024-12-09 09:43:27 -06:00
uv-client Retry on tar extraction errors (#9753) 2024-12-10 07:33:08 -05:00
uv-configuration Build backend: Add template to uv init (#9661) 2024-12-05 15:30:48 +01:00
uv-console Support interactive input in uv publish (#8158) 2024-10-15 10:00:43 +02:00
uv-dev Build backend: Add template to uv init (#9661) 2024-12-05 15:30:48 +01:00
uv-dirs Eliminate dependencies on directores and dirs-sys (#8048) 2024-11-07 14:29:54 -06:00
uv-dispatch Remove derivation chain special casing (#9678) 2024-12-06 13:05:03 +00:00
uv-distribution Show a dedicated error for missing subdirectories (#9761) 2024-12-10 02:48:50 +00:00
uv-distribution-filename Add test coverage for build tag prioritization (#9680) 2024-12-06 09:32:19 -05:00
uv-distribution-types Avoid treating non-existent --find-links as relative URLs (#9720) 2024-12-08 12:22:18 -05:00
uv-extract Revert "Upgrade to Rust 1.83 (#9511)" (#9617) 2024-12-03 19:21:05 +00:00
uv-fs Use copy-on-write when normalizing paths (#9710) 2024-12-07 15:52:41 -05:00
uv-git Remove separate test files in favor of same-file mod tests (#9199) 2024-11-18 20:11:46 +00:00
uv-globfilter Build backend: Revamp include/exclude (#9525) 2024-12-01 11:32:35 +00:00
uv-install-wheel feat: add environment variable to disable writing installer metadata files (#8877) 2024-12-04 01:29:33 +00:00
uv-installer Remove derivation chain special casing (#9678) 2024-12-06 13:05:03 +00:00
uv-macros Generate environment variables doc from code (#8493) 2024-11-03 08:31:38 -06:00
uv-metadata chore: Move all integration tests to a single binary (#8093) 2024-10-11 16:41:35 +02:00
uv-normalize Remove separate test files in favor of same-file mod tests (#9199) 2024-11-18 20:11:46 +00:00
uv-once-map Use shared resolver state between add and lock (#8146) 2024-10-12 14:58:07 +00:00
uv-options-metadata Revert "Upgrade to Rust 1.83 (#9511)" (#9617) 2024-12-03 19:21:05 +00:00
uv-pep440 Revert "Upgrade to Rust 1.83 (#9511)" (#9617) 2024-12-03 19:21:05 +00:00
uv-pep508 Encode mutually-incompatible pairs of markers (#9444) 2024-12-07 01:51:44 +00:00
uv-performance-flate2-backend Use zlib-rs on all platforms (#9264) 2024-11-20 00:01:58 -05:00
uv-performance-memory-allocator Run cargo update (#8703) 2024-11-01 10:26:21 -04:00
uv-platform-tags Fix Python interpreter discovery on non-glibc hosts (#9005) 2024-11-21 12:35:02 +01:00
uv-publish Upload: All metadata incl. PEP 639 (#9442) 2024-11-27 00:25:08 +01:00
uv-pypi-types Respect self-constraints on recursive extras (#9714) 2024-12-08 04:53:42 +00:00
uv-python Omit Windows Store python3.13.exe et al (#9679) 2024-12-10 02:59:32 +00:00
uv-requirements Eagerly error when parsing pyproject.toml requirements (#9704) 2024-12-07 14:14:26 +00:00
uv-requirements-txt Align indoc and base64 workspace dependencies with root project (#9555) 2024-12-01 17:20:22 -05:00
uv-resolver Avoid 403 error hint for PyTorch URLs (#9750) 2024-12-09 22:30:24 +00:00
uv-scripts Revert "Upgrade to Rust 1.83 (#9511)" (#9617) 2024-12-03 19:21:05 +00:00
uv-settings Revert "Upgrade to Rust 1.83 (#9511)" (#9617) 2024-12-03 19:21:05 +00:00
uv-shell Refactor shell quoting (#9055) 2024-11-15 09:06:54 +00:00
uv-state Add uv-dirs to consolidate directory lookup methods (#8453) 2024-10-22 11:33:25 -05:00
uv-static feat: add environment variable to disable writing installer metadata files (#8877) 2024-12-04 01:29:33 +00:00
uv-tool Allow --constraints and --overrides in uv tool install (#9547) 2024-12-03 01:14:41 +00:00
uv-trampoline Update Rust crate thiserror to v2.0.6 (#9727) 2024-12-09 01:15:25 +00:00
uv-trampoline-builder Add support for installing versioned Python executables on Windows (#8663) 2024-10-31 15:58:35 +00:00
uv-types Build backend: Add direct builds to the resolver and installer (#9621) 2024-12-04 15:57:18 +00:00
uv-version Bump version to 0.5.7 (#9698) 2024-12-06 17:50:21 -06:00
uv-virtualenv Allow apostrophe in venv name (#8984) 2024-11-15 10:52:10 +01:00
uv-warnings chore: Move all integration tests to a single binary (#8093) 2024-10-11 16:41:35 +02:00
uv-workspace Model groups as a property of requirements (#9545) 2024-12-04 00:55:51 +00:00
README.md Link to Dependency specifiers instead of PEP 508 (#8411) 2024-10-21 14:43:38 -04:00

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.