astral-sh/uv

Move environment variable parsing to `EnvironmentOptions`

開放

#14,720 建立於 2025年7月18日

 (25 則留言) (1 個反應) (0 位負責人)Rust (3,111 個分叉)batch import
help wantedinternal

倉庫指標

星標
 (84,934 顆星)
PR 合併指標
 (平均合併 7天 16小時) (30 天內合併 259 個 PR)

描述

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)

貢獻者指南