astral-sh/uv

Move environment variable parsing to `EnvironmentOptions`

Open

#14.720 geöffnet am 18. Juli 2025

Auf GitHub ansehen
 (25 Kommentare) (1 Reaktion) (0 zugewiesene Personen)Rust (3.111 Forks)batch import
good first issuehelp wantedinternal

Repository-Metriken

Stars
 (84.934 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 7T 16h) (259 gemergte PRs in 30 T)

Beschreibung

In https://github.com/astral-sh/uv/pull/14662 I added a new EnvironmentOptions abstraction which allows us to express semantics that Clap cannot and perform up-front parsing of non-CLI environment variables, e.g., https://github.com/astral-sh/uv/pull/14544 and https://github.com/astral-sh/uv/pull/14369.

We should move other extraneous environment variables to be parsed there and provided through our usual settings structs.

These changes should be relatively easy. We should probably do it one variable at a time.

  • UV_HTTP_RETRIES
  • UV_COMPILE_BYTECODE_TIMEOUT
  • UV_HTTP_TIMEOUT
  • UV_REQUEST_TIMEOUT
  • HTTP_TIMEOUT
  • UV_RUN_RECURSION_DEPTH
  • UV_RUN_MAX_RECURSION_DEPTH
  • UV_CONCURRENT_DOWNLOADS
  • UV_CONCURRENT_BUILDS
  • UV_CONCURRENT_INSTALLS
  • UV_PYTHON_INSTALL_MIRROR
  • UV_PYPY_INSTALL_MIRROR
  • UV_PYTHON_DOWNLOADS_JSON_URL
  • UV_NO_GITHUB_FAST_PATH
  • UV_GITHUB_FAST_PATH_URL
  • UV_GIT_LFS
  • UV_CUDA_DRIVER_VERSION
  • UV_AMD_GPU_ARCHITECTURE
  • UV_STACK_SIZE
  • UV_LOG_CONTEXT
  • TRACING_DURATIONS_FILE
  • UV_LOCK_TIMEOUT (https://github.com/astral-sh/uv/pull/16342#discussion_r2448547512)

Contributor Guide