uv/crates
Eric Mark Martin d57bb90499
explicitly handle ctrl-c in confirmation prompt instead of signal handler (#11897)
<!--
Thank you for contributing to uv! To help us out with reviewing, please
consider the following:

- Does this pull request include a summary of the change? (See below.)
- Does this pull request include a descriptive title?
- Does this pull request include references to any relevant issues?
-->

## Summary

Follow on to #11706. In the original PR, I tried to solve the issue by
getting rid of the `ctrlc::set_handler` call. Unfortunately, this didn't
work on windows due to an issue with the console crate. console 0.15.11
includes https://github.com/console-rs/console/pull/235, which resolves
the issue, so now we can get rid of the call.

<!-- What's the purpose of the change? What does it do, and why? -->

This change is not super important but I still think it's worthwhile.
For one, spinning up a background thread to handle `SIGINT`s when we're
going to be raising the `SIGINT` from within the function is more
technical complexity than needed, now that there's an easy way to
explicitly catch the Ctrl-C from the terminal input. Secondly,
`ctrlc::set_handler`'s
[docs](https://docs.rs/ctrlc/3.4.5/ctrlc/fn.set_handler.html) advise
that you set the handler just once, at the beginning of the program, so
this use seems somewhat error prone. In fact, uv already has a second
[callsite](461f4d9007/crates/uv/src/commands/project/add.rs (L596-L611))
for this function (though I'm not sure if the two callsites could
currently ever both occur on the same run of uv)

## Test Plan

I've tested this manually on linux (WSL ubuntu) and windows, though not
on aarch64-apple-darwin as I don't have a machine running that. I would
appreciate if someone would double-check that it works on such machines.

As discussed in the original PR, this change is pretty hard to test due
to the fact that the behavior only occurs if stderr is connected to a
tty. I experimented with using pseudoterminals to test this but it's
still quite tricky due to the lack of x-platform non-blocking reads on
the pty.

<!-- How was it tested? -->
2025-03-03 10:30:48 -05:00
..
uv Improve test behavior with custom installation directory (#10048) 2025-03-02 22:58:50 -05:00
uv-auth Migrate from urlencoding to percent-encoding (#11144) 2025-01-31 16:29:46 -05:00
uv-bench Remove warnings for missing lower bounds (#11195) 2025-02-03 16:03:31 -06:00
uv-build-backend Remove unused thiserror variants (#11713) 2025-02-22 12:12:22 -10:00
uv-build-frontend Remove unused thiserror variants (#11713) 2025-02-22 12:12:22 -10:00
uv-cache Avoid silently dropping errors in directory enumeration (#11890) 2025-03-03 02:39:17 +00:00
uv-cache-info Fix git-tag cache-key reader in case of slashes (#10467) (#10500) 2025-01-11 21:30:46 -05:00
uv-cache-key Use hash instead of full wheel name in wheels bucket (#11738) 2025-02-26 22:41:57 +00:00
uv-cli Upgrade Rust toolchain to 1.85 (#11720) 2025-02-23 16:52:34 +01:00
uv-client Use hash instead of full wheel name in wheels bucket (#11738) 2025-02-26 22:41:57 +00:00
uv-configuration Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-console explicitly handle ctrl-c in confirmation prompt instead of signal handler (#11897) 2025-03-03 10:30:48 -05:00
uv-dev Add anchor links to arguments and options in the CLI reference (#11754) 2025-02-24 15:48:14 -06:00
uv-dirs Eliminate dependencies on directores and dirs-sys (#8048) 2024-11-07 14:29:54 -06:00
uv-dispatch Add uv sync --dry-run (#11299) 2025-02-06 23:52:49 +00:00
uv-distribution Avoid silently dropping errors in directory enumeration (#11890) 2025-03-03 02:39:17 +00:00
uv-distribution-filename Fix version string truncation while generating cache_key (#11830) 2025-02-27 08:48:43 -05:00
uv-distribution-types Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-extract Use SmallString on Hashes (#11756) 2025-02-24 10:32:00 -10:00
uv-fs Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-git Move GIT_TERMINAL_PROMPT to env vars (#11789) 2025-02-26 03:56:24 +00:00
uv-git-types Avoid using owned String in deserializers (#11764) 2025-02-25 14:28:16 +00:00
uv-globfilter Build backend: Revamp include/exclude (#9525) 2024-12-01 11:32:35 +00:00
uv-install-wheel Remove unused thiserror variants (#11713) 2025-02-22 12:12:22 -10:00
uv-installer Use hash instead of full wheel name in wheels bucket (#11738) 2025-02-26 22:41:57 +00:00
uv-macros Remove unnecessary prefixes (#10158) 2024-12-25 14:18:01 -05:00
uv-metadata chore: Move all integration tests to a single binary (#8093) 2024-10-11 16:41:35 +02:00
uv-normalize Avoid using owned String in deserializers (#11764) 2025-02-25 14:28:16 +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 Upgrade minimum Rust version to 1.83 (#9815) 2024-12-11 10:06:19 -06:00
uv-pep440 Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-pep508 Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-performance-flate2-backend Update Rust crate flate2 to v1.1.0 (#11917) 2025-03-03 04:22:06 +00:00
uv-performance-memory-allocator Run cargo update (#10173) 2024-12-26 12:00:58 -05:00
uv-platform-tags Allow installation of manylinux wheels on loongarch64 (#10927) 2025-01-24 14:36:03 +01:00
uv-publish Use SmallString on Hashes (#11756) 2025-02-24 10:32:00 -10:00
uv-pypi-types Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-python Discover registry PEP 514 Pythons cross 32/64-bit (#11801) 2025-03-03 14:46:00 +00:00
uv-requirements Don't panic on Ctrl-C in confirm prompt (#11706) 2025-02-26 11:10:04 +01:00
uv-requirements-txt Skip unquote allocation for non-quoted strings (#11813) 2025-02-26 21:56:31 +00:00
uv-resolver Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-scripts Add tool.uv.build-constraint-dependencies to pyproject.toml (#11585) 2025-02-17 20:58:36 -05:00
uv-settings Fix reference to macOS cache path (#11845) 2025-02-28 02:14:09 +00:00
uv-shell Suggest uv tool update-shell in PowerShell (#11846) 2025-02-28 22:32:48 -05:00
uv-small-str Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +00:00
uv-state Add uv-dirs to consolidate directory lookup methods (#8453) 2024-10-22 11:33:25 -05:00
uv-static rework log verbosity (-vvv) (#11758) 2025-02-28 18:49:27 -05:00
uv-tool Avoid string allocation when enumerating tool names (#11910) 2025-03-03 10:13:54 -05:00
uv-trampoline Upgrade Rust toolchain to 1.85 (#11720) 2025-02-23 16:52:34 +01:00
uv-trampoline-builder Upgrade Rust toolchain to 1.84.0 (#10533) 2025-01-11 22:19:33 -05:00
uv-types Use boxed slices for hash vector (#11714) 2025-02-24 11:11:44 -06:00
uv-version Bump version to 0.6.3 (#11759) 2025-02-24 17:25:01 -05:00
uv-virtualenv Update code page to 65001 before setting environment variables, fix #11828 (#11831) 2025-02-27 16:14:34 -05:00
uv-warnings chore: Move all integration tests to a single binary (#8093) 2024-10-11 16:41:35 +02:00
uv-workspace Edition 2024 prep: Escape r#gen and remove redundant ref (#11922) 2025-03-03 11:13:56 +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.