Skip to main content

uv_static/
env_vars.rs

1//! Environment variables used or supported by uv.
2//! Used to generate `docs/reference/environment.md`.
3use uv_macros::{attr_added_in, attr_env_var_pattern, attr_hidden, attribute_env_vars_metadata};
4
5/// Declares all environment variable used throughout `uv` and its crates.
6pub struct EnvVars;
7
8#[attribute_env_vars_metadata]
9impl EnvVars {
10    /// The path to the binary that was used to invoke uv.
11    ///
12    /// This is propagated to all subprocesses spawned by uv.
13    ///
14    /// If the executable was invoked through a symbolic link, some platforms will return the path
15    /// of the symbolic link and other platforms will return the path of the symbolic link’s target.
16    ///
17    /// See <https://doc.rust-lang.org/std/env/fn.current_exe.html#security> for security
18    /// considerations.
19    #[attr_added_in("0.6.0")]
20    pub const UV: &'static str = "UV";
21
22    /// Equivalent to the `--offline` command-line argument. If set, uv will disable network access.
23    #[attr_added_in("0.5.9")]
24    pub const UV_OFFLINE: &'static str = "UV_OFFLINE";
25
26    /// Equivalent to the `--default-index` command-line argument. If set, uv will use
27    /// this URL as the default index when searching for packages.
28    #[attr_added_in("0.4.23")]
29    pub const UV_DEFAULT_INDEX: &'static str = "UV_DEFAULT_INDEX";
30
31    /// Equivalent to the `--index` command-line argument. If set, uv will use this
32    /// space-separated list of URLs as additional indexes when searching for packages.
33    #[attr_added_in("0.4.23")]
34    pub const UV_INDEX: &'static str = "UV_INDEX";
35
36    /// Equivalent to the `--index-url` command-line argument. If set, uv will use this
37    /// URL as the default index when searching for packages.
38    /// (Deprecated: use `UV_DEFAULT_INDEX` instead.)
39    #[attr_added_in("0.0.5")]
40    pub const UV_INDEX_URL: &'static str = "UV_INDEX_URL";
41
42    /// Equivalent to the `--extra-index-url` command-line argument. If set, uv will
43    /// use this space-separated list of URLs as additional indexes when searching for packages.
44    /// (Deprecated: use `UV_INDEX` instead.)
45    #[attr_added_in("0.1.3")]
46    pub const UV_EXTRA_INDEX_URL: &'static str = "UV_EXTRA_INDEX_URL";
47
48    /// Equivalent to the `--find-links` command-line argument. If set, uv will use this
49    /// comma-separated list of additional locations to search for packages.
50    #[attr_added_in("0.4.19")]
51    pub const UV_FIND_LINKS: &'static str = "UV_FIND_LINKS";
52
53    /// Equivalent to the `--no-sources` command-line argument. If set, uv will ignore
54    /// `[tool.uv.sources]` annotations when resolving dependencies.
55    #[attr_added_in("0.9.8")]
56    pub const UV_NO_SOURCES: &'static str = "UV_NO_SOURCES";
57
58    /// Equivalent to the `--cache-dir` command-line argument. If set, uv will use this
59    /// directory for caching instead of the default cache directory.
60    #[attr_added_in("0.0.5")]
61    pub const UV_CACHE_DIR: &'static str = "UV_CACHE_DIR";
62
63    /// The directory for storage of credentials when using a plain text backend.
64    #[attr_added_in("0.8.15")]
65    pub const UV_CREDENTIALS_DIR: &'static str = "UV_CREDENTIALS_DIR";
66
67    /// Equivalent to the `--no-cache` command-line argument. If set, uv will not use the
68    /// cache for any operations.
69    #[attr_added_in("0.1.2")]
70    pub const UV_NO_CACHE: &'static str = "UV_NO_CACHE";
71
72    /// Equivalent to the `--resolution` command-line argument. For example, if set to
73    /// `lowest-direct`, uv will install the lowest compatible versions of all direct dependencies.
74    #[attr_added_in("0.1.27")]
75    pub const UV_RESOLUTION: &'static str = "UV_RESOLUTION";
76
77    /// Equivalent to the `--prerelease` command-line argument. For example, if set to
78    /// `allow`, uv will allow pre-release versions for all dependencies.
79    #[attr_added_in("0.1.16")]
80    pub const UV_PRERELEASE: &'static str = "UV_PRERELEASE";
81
82    /// Equivalent to the `--fork-strategy` argument. Controls version selection during universal
83    /// resolution.
84    #[attr_added_in("0.5.9")]
85    pub const UV_FORK_STRATEGY: &'static str = "UV_FORK_STRATEGY";
86
87    /// Equivalent to the `--system` command-line argument. If set to `true`, uv will
88    /// use the first Python interpreter found in the system `PATH`.
89    ///
90    /// WARNING: `UV_SYSTEM_PYTHON=true` is intended for use in continuous integration (CI)
91    /// or containerized environments and should be used with caution, as modifying the system
92    /// Python can lead to unexpected behavior.
93    #[attr_added_in("0.1.18")]
94    pub const UV_SYSTEM_PYTHON: &'static str = "UV_SYSTEM_PYTHON";
95
96    /// Equivalent to the `--python` command-line argument. If set to a path, uv will use
97    /// this Python interpreter for all operations.
98    #[attr_added_in("0.1.40")]
99    pub const UV_PYTHON: &'static str = "UV_PYTHON";
100
101    /// Equivalent to the `--break-system-packages` command-line argument. If set to `true`,
102    /// uv will allow the installation of packages that conflict with system-installed packages.
103    ///
104    /// WARNING: `UV_BREAK_SYSTEM_PACKAGES=true` is intended for use in continuous integration
105    /// (CI) or containerized environments and should be used with caution, as modifying the system
106    /// Python can lead to unexpected behavior.
107    #[attr_added_in("0.1.32")]
108    pub const UV_BREAK_SYSTEM_PACKAGES: &'static str = "UV_BREAK_SYSTEM_PACKAGES";
109
110    /// Equivalent to the `--native-tls` command-line argument. If set to `true`, uv will
111    /// use the system's trust store instead of the bundled `webpki-roots` crate.
112    #[attr_added_in("0.1.19")]
113    pub const UV_NATIVE_TLS: &'static str = "UV_NATIVE_TLS";
114
115    /// Equivalent to the `--index-strategy` command-line argument.
116    ///
117    /// For example, if set to `unsafe-best-match`, uv will consider versions of a given package
118    /// available across all index URLs, rather than limiting its search to the first index URL
119    /// that contains the package.
120    #[attr_added_in("0.1.29")]
121    pub const UV_INDEX_STRATEGY: &'static str = "UV_INDEX_STRATEGY";
122
123    /// Equivalent to the `--require-hashes` command-line argument. If set to `true`,
124    /// uv will require that all dependencies have a hash specified in the requirements file.
125    #[attr_added_in("0.1.34")]
126    pub const UV_REQUIRE_HASHES: &'static str = "UV_REQUIRE_HASHES";
127
128    /// Equivalent to the `--constraints` command-line argument. If set, uv will use this
129    /// file as the constraints file. Uses space-separated list of files.
130    #[attr_added_in("0.1.36")]
131    pub const UV_CONSTRAINT: &'static str = "UV_CONSTRAINT";
132
133    /// Equivalent to the `--build-constraints` command-line argument. If set, uv will use this file
134    /// as constraints for any source distribution builds. Uses space-separated list of files.
135    #[attr_added_in("0.2.34")]
136    pub const UV_BUILD_CONSTRAINT: &'static str = "UV_BUILD_CONSTRAINT";
137
138    /// Equivalent to the `--overrides` command-line argument. If set, uv will use this file
139    /// as the overrides file. Uses space-separated list of files.
140    #[attr_added_in("0.2.22")]
141    pub const UV_OVERRIDE: &'static str = "UV_OVERRIDE";
142
143    /// Equivalent to the `--excludes` command-line argument. If set, uv will use this
144    /// as the excludes file. Uses space-separated list of files.
145    #[attr_added_in("0.9.8")]
146    pub const UV_EXCLUDE: &'static str = "UV_EXCLUDE";
147
148    /// Equivalent to the `--link-mode` command-line argument. If set, uv will use this as
149    /// a link mode.
150    #[attr_added_in("0.1.40")]
151    pub const UV_LINK_MODE: &'static str = "UV_LINK_MODE";
152
153    /// Equivalent to the `--no-build-isolation` command-line argument. If set, uv will
154    /// skip isolation when building source distributions.
155    #[attr_added_in("0.1.40")]
156    pub const UV_NO_BUILD_ISOLATION: &'static str = "UV_NO_BUILD_ISOLATION";
157
158    /// Equivalent to the `--custom-compile-command` command-line argument.
159    ///
160    /// Used to override uv in the output header of the `requirements.txt` files generated by
161    /// `uv pip compile`. Intended for use-cases in which `uv pip compile` is called from within a wrapper
162    /// script, to include the name of the wrapper script in the output file.
163    #[attr_added_in("0.1.23")]
164    pub const UV_CUSTOM_COMPILE_COMMAND: &'static str = "UV_CUSTOM_COMPILE_COMMAND";
165
166    /// Equivalent to the `--keyring-provider` command-line argument. If set, uv
167    /// will use this value as the keyring provider.
168    #[attr_added_in("0.1.19")]
169    pub const UV_KEYRING_PROVIDER: &'static str = "UV_KEYRING_PROVIDER";
170
171    /// Equivalent to the `--config-file` command-line argument. Expects a path to a
172    /// local `uv.toml` file to use as the configuration file.
173    #[attr_added_in("0.1.34")]
174    pub const UV_CONFIG_FILE: &'static str = "UV_CONFIG_FILE";
175
176    /// Equivalent to the `--no-config` command-line argument. If set, uv will not read
177    /// any configuration files from the current directory, parent directories, or user configuration
178    /// directories.
179    #[attr_added_in("0.2.30")]
180    pub const UV_NO_CONFIG: &'static str = "UV_NO_CONFIG";
181
182    /// Equivalent to the `--isolated` command-line argument. If set, uv will avoid discovering
183    /// a `pyproject.toml` or `uv.toml` file.
184    #[attr_added_in("0.8.14")]
185    pub const UV_ISOLATED: &'static str = "UV_ISOLATED";
186
187    /// Equivalent to the `--exclude-newer` command-line argument. If set, uv will
188    /// exclude distributions published after the specified date.
189    #[attr_added_in("0.2.12")]
190    pub const UV_EXCLUDE_NEWER: &'static str = "UV_EXCLUDE_NEWER";
191
192    /// Whether uv should prefer system or managed Python versions.
193    #[attr_added_in("0.3.2")]
194    pub const UV_PYTHON_PREFERENCE: &'static str = "UV_PYTHON_PREFERENCE";
195
196    /// Require use of uv-managed Python versions.
197    #[attr_added_in("0.6.8")]
198    pub const UV_MANAGED_PYTHON: &'static str = "UV_MANAGED_PYTHON";
199
200    /// Disable use of uv-managed Python versions.
201    #[attr_added_in("0.6.8")]
202    pub const UV_NO_MANAGED_PYTHON: &'static str = "UV_NO_MANAGED_PYTHON";
203
204    /// Equivalent to the
205    /// [`python-downloads`](../reference/settings.md#python-downloads) setting and, when disabled, the
206    /// `--no-python-downloads` option. Whether uv should allow Python downloads.
207    #[attr_added_in("0.3.2")]
208    pub const UV_PYTHON_DOWNLOADS: &'static str = "UV_PYTHON_DOWNLOADS";
209
210    /// Overrides the environment-determined libc on linux systems when filling in the current platform
211    /// within Python version requests. Options are: `gnu`, `gnueabi`, `gnueabihf`, `musl`, and `none`.
212    #[attr_added_in("0.7.22")]
213    pub const UV_LIBC: &'static str = "UV_LIBC";
214
215    /// Equivalent to the `--compile-bytecode` command-line argument. If set, uv
216    /// will compile Python source files to bytecode after installation.
217    #[attr_added_in("0.3.3")]
218    pub const UV_COMPILE_BYTECODE: &'static str = "UV_COMPILE_BYTECODE";
219
220    /// Timeout (in seconds) for bytecode compilation.
221    #[attr_added_in("0.7.22")]
222    pub const UV_COMPILE_BYTECODE_TIMEOUT: &'static str = "UV_COMPILE_BYTECODE_TIMEOUT";
223
224    /// Equivalent to the `--no-editable` command-line argument. If set, uv
225    /// installs or exports any editable dependencies, including the project and any workspace
226    /// members, as non-editable.
227    #[attr_added_in("0.6.15")]
228    pub const UV_NO_EDITABLE: &'static str = "UV_NO_EDITABLE";
229
230    /// Equivalent to the `--dev` command-line argument. If set, uv will include
231    /// development dependencies.
232    #[attr_added_in("0.8.7")]
233    pub const UV_DEV: &'static str = "UV_DEV";
234
235    /// Equivalent to the `--no-dev` command-line argument. If set, uv will exclude
236    /// development dependencies.
237    #[attr_added_in("0.8.7")]
238    pub const UV_NO_DEV: &'static str = "UV_NO_DEV";
239
240    /// Equivalent to the `--no-group` command-line argument. If set, uv will disable
241    /// the specified dependency groups for the given space-delimited list of packages.
242    #[attr_added_in("0.9.8")]
243    pub const UV_NO_GROUP: &'static str = "UV_NO_GROUP";
244
245    /// Equivalent to the `--no-default-groups` command-line argument. If set, uv will
246    /// not select the default dependency groups defined in `tool.uv.default-groups`.
247    #[attr_added_in("0.9.9")]
248    pub const UV_NO_DEFAULT_GROUPS: &'static str = "UV_NO_DEFAULT_GROUPS";
249
250    /// Equivalent to the `--no-binary` command-line argument. If set, uv will install
251    /// all packages from source. The resolver will still use pre-built wheels to
252    /// extract package metadata, if available.
253    #[attr_added_in("0.5.30")]
254    pub const UV_NO_BINARY: &'static str = "UV_NO_BINARY";
255
256    /// Equivalent to the `--no-binary-package` command line argument. If set, uv will
257    /// not use pre-built wheels for the given space-delimited list of packages.
258    #[attr_added_in("0.5.30")]
259    pub const UV_NO_BINARY_PACKAGE: &'static str = "UV_NO_BINARY_PACKAGE";
260
261    /// Equivalent to the `--no-build` command-line argument. If set, uv will not build
262    /// source distributions.
263    #[attr_added_in("0.1.40")]
264    pub const UV_NO_BUILD: &'static str = "UV_NO_BUILD";
265
266    /// Equivalent to the `--no-build-package` command line argument. If set, uv will
267    /// not build source distributions for the given space-delimited list of packages.
268    #[attr_added_in("0.6.5")]
269    pub const UV_NO_BUILD_PACKAGE: &'static str = "UV_NO_BUILD_PACKAGE";
270
271    /// Equivalent to the `--no-sources-package` command line argument. If set, uv will
272    /// ignore the `tool.uv.sources` table for the given space-delimited list of packages.
273    #[attr_added_in("0.9.26")]
274    pub const UV_NO_SOURCES_PACKAGE: &'static str = "UV_NO_SOURCES_PACKAGE";
275
276    /// Equivalent to the `--publish-url` command-line argument. The URL of the upload
277    /// endpoint of the index to use with `uv publish`.
278    #[attr_added_in("0.4.16")]
279    pub const UV_PUBLISH_URL: &'static str = "UV_PUBLISH_URL";
280
281    /// Equivalent to the `--token` command-line argument in `uv publish`. If set, uv
282    /// will use this token (with the username `__token__`) for publishing.
283    #[attr_added_in("0.4.16")]
284    pub const UV_PUBLISH_TOKEN: &'static str = "UV_PUBLISH_TOKEN";
285
286    /// Equivalent to the `--index` command-line argument in `uv publish`. If
287    /// set, uv will use the index with this name in the configuration for publishing.
288    #[attr_added_in("0.5.8")]
289    pub const UV_PUBLISH_INDEX: &'static str = "UV_PUBLISH_INDEX";
290
291    /// Equivalent to the `--username` command-line argument in `uv publish`. If
292    /// set, uv will use this username for publishing.
293    #[attr_added_in("0.4.16")]
294    pub const UV_PUBLISH_USERNAME: &'static str = "UV_PUBLISH_USERNAME";
295
296    /// Equivalent to the `--password` command-line argument in `uv publish`. If
297    /// set, uv will use this password for publishing.
298    #[attr_added_in("0.4.16")]
299    pub const UV_PUBLISH_PASSWORD: &'static str = "UV_PUBLISH_PASSWORD";
300
301    /// Don't upload a file if it already exists on the index. The value is the URL of the index.
302    #[attr_added_in("0.4.30")]
303    pub const UV_PUBLISH_CHECK_URL: &'static str = "UV_PUBLISH_CHECK_URL";
304
305    /// Equivalent to the `--no-attestations` command-line argument in `uv publish`. If set,
306    /// uv will skip uploading any collected attestations for the published distributions.
307    #[attr_added_in("0.9.12")]
308    pub const UV_PUBLISH_NO_ATTESTATIONS: &'static str = "UV_PUBLISH_NO_ATTESTATIONS";
309
310    /// Equivalent to the `--no-sync` command-line argument. If set, uv will skip updating
311    /// the environment.
312    #[attr_added_in("0.4.18")]
313    pub const UV_NO_SYNC: &'static str = "UV_NO_SYNC";
314
315    /// Equivalent to the `--locked` command-line argument. If set, uv will assert that the
316    /// `uv.lock` remains unchanged.
317    #[attr_added_in("0.4.25")]
318    pub const UV_LOCKED: &'static str = "UV_LOCKED";
319
320    /// Equivalent to the `--frozen` command-line argument. If set, uv will run without
321    /// updating the `uv.lock` file.
322    #[attr_added_in("0.4.25")]
323    pub const UV_FROZEN: &'static str = "UV_FROZEN";
324
325    /// Equivalent to the `--preview` argument. Enables preview mode.
326    #[attr_added_in("0.1.37")]
327    pub const UV_PREVIEW: &'static str = "UV_PREVIEW";
328
329    /// Equivalent to the `--preview-features` argument. Enables specific preview features.
330    #[attr_added_in("0.8.4")]
331    pub const UV_PREVIEW_FEATURES: &'static str = "UV_PREVIEW_FEATURES";
332
333    /// Equivalent to the `--token` argument for self update. A GitHub token for authentication.
334    #[attr_added_in("0.4.10")]
335    pub const UV_GITHUB_TOKEN: &'static str = "UV_GITHUB_TOKEN";
336
337    /// Equivalent to the `--no-verify-hashes` argument. Disables hash verification for
338    /// `requirements.txt` files.
339    #[attr_added_in("0.5.3")]
340    pub const UV_NO_VERIFY_HASHES: &'static str = "UV_NO_VERIFY_HASHES";
341
342    /// Equivalent to the `--allow-insecure-host` argument.
343    #[attr_added_in("0.3.5")]
344    pub const UV_INSECURE_HOST: &'static str = "UV_INSECURE_HOST";
345
346    /// Disable ZIP validation for streamed wheels and ZIP-based source distributions.
347    ///
348    /// WARNING: Disabling ZIP validation can expose your system to security risks by bypassing
349    /// integrity checks and allowing uv to install potentially malicious ZIP files. If uv rejects
350    /// a ZIP file due to failing validation, it is likely that the file is malformed; consider
351    /// filing an issue with the package maintainer.
352    #[attr_added_in("0.8.6")]
353    pub const UV_INSECURE_NO_ZIP_VALIDATION: &'static str = "UV_INSECURE_NO_ZIP_VALIDATION";
354
355    /// Sets the maximum number of in-flight concurrent downloads that uv will
356    /// perform at any given time.
357    #[attr_added_in("0.1.43")]
358    pub const UV_CONCURRENT_DOWNLOADS: &'static str = "UV_CONCURRENT_DOWNLOADS";
359
360    /// Sets the maximum number of source distributions that uv will build
361    /// concurrently at any given time.
362    #[attr_added_in("0.1.43")]
363    pub const UV_CONCURRENT_BUILDS: &'static str = "UV_CONCURRENT_BUILDS";
364
365    /// Controls the number of threads used when installing and unzipping
366    /// packages.
367    #[attr_added_in("0.1.45")]
368    pub const UV_CONCURRENT_INSTALLS: &'static str = "UV_CONCURRENT_INSTALLS";
369
370    /// Equivalent to the `--no-progress` command-line argument. Disables all progress output. For
371    /// example, spinners and progress bars.
372    #[attr_added_in("0.2.28")]
373    pub const UV_NO_PROGRESS: &'static str = "UV_NO_PROGRESS";
374
375    /// Specifies the directory where uv stores managed tools.
376    #[attr_added_in("0.2.16")]
377    pub const UV_TOOL_DIR: &'static str = "UV_TOOL_DIR";
378
379    /// Specifies the "bin" directory for installing tool executables.
380    #[attr_added_in("0.3.0")]
381    pub const UV_TOOL_BIN_DIR: &'static str = "UV_TOOL_BIN_DIR";
382
383    /// Equivalent to the `--bare` argument for `uv init`. If set, uv will only create a
384    /// `pyproject.toml`.
385    #[attr_added_in("0.10.7")]
386    pub const UV_INIT_BARE: &'static str = "UV_INIT_BARE";
387
388    /// Equivalent to the `--build-backend` argument for `uv init`. Determines the default backend
389    /// to use when creating a new project.
390    #[attr_added_in("0.8.2")]
391    pub const UV_INIT_BUILD_BACKEND: &'static str = "UV_INIT_BUILD_BACKEND";
392
393    /// Specifies the path to the directory to use for a project virtual environment.
394    ///
395    /// See the [project documentation](../concepts/projects/config.md#project-environment-path)
396    /// for more details.
397    #[attr_added_in("0.4.4")]
398    pub const UV_PROJECT_ENVIRONMENT: &'static str = "UV_PROJECT_ENVIRONMENT";
399
400    /// Specifies the directory to place links to installed, managed Python executables.
401    #[attr_added_in("0.4.29")]
402    pub const UV_PYTHON_BIN_DIR: &'static str = "UV_PYTHON_BIN_DIR";
403
404    /// Specifies the directory for storing managed Python installations.
405    #[attr_added_in("0.2.22")]
406    pub const UV_PYTHON_INSTALL_DIR: &'static str = "UV_PYTHON_INSTALL_DIR";
407
408    /// Whether to install the Python executable into the `UV_PYTHON_BIN_DIR` directory.
409    #[attr_added_in("0.8.0")]
410    pub const UV_PYTHON_INSTALL_BIN: &'static str = "UV_PYTHON_INSTALL_BIN";
411
412    /// Whether to install the Python executable into the Windows registry.
413    #[attr_added_in("0.8.0")]
414    pub const UV_PYTHON_INSTALL_REGISTRY: &'static str = "UV_PYTHON_INSTALL_REGISTRY";
415
416    /// Managed Python installations information is hardcoded in the `uv` binary.
417    ///
418    /// This variable can be set to a local path or URL pointing to
419    /// a JSON list of Python installations to override the hardcoded list.
420    ///
421    /// This allows customizing the URLs for downloads or using slightly older or newer versions
422    /// of Python than the ones hardcoded into this build of `uv`.
423    #[attr_added_in("0.6.13")]
424    pub const UV_PYTHON_DOWNLOADS_JSON_URL: &'static str = "UV_PYTHON_DOWNLOADS_JSON_URL";
425
426    /// Specifies the directory for caching the archives of managed Python installations before
427    /// installation.
428    #[attr_added_in("0.7.0")]
429    pub const UV_PYTHON_CACHE_DIR: &'static str = "UV_PYTHON_CACHE_DIR";
430
431    /// Managed Python installations are downloaded from the Astral
432    /// [`python-build-standalone`](https://github.com/astral-sh/python-build-standalone) project.
433    ///
434    /// This variable can be set to a mirror URL to use a different source for Python installations.
435    /// The provided URL will replace `https://github.com/astral-sh/python-build-standalone/releases/download` in, e.g.,
436    /// `https://github.com/astral-sh/python-build-standalone/releases/download/20240713/cpython-3.12.4%2B20240713-aarch64-apple-darwin-install_only.tar.gz`.
437    /// Distributions can be read from a local directory by using the `file://` URL scheme.
438    #[attr_added_in("0.2.35")]
439    pub const UV_PYTHON_INSTALL_MIRROR: &'static str = "UV_PYTHON_INSTALL_MIRROR";
440
441    /// Managed PyPy installations are downloaded from [python.org](https://downloads.python.org/).
442    ///
443    /// This variable can be set to a mirror URL to use a
444    /// different source for PyPy installations. The provided URL will replace
445    /// `https://downloads.python.org/pypy` in, e.g.,
446    /// `https://downloads.python.org/pypy/pypy3.8-v7.3.7-osx64.tar.bz2`.
447    /// Distributions can be read from a local directory by using the `file://` URL scheme.
448    #[attr_added_in("0.2.35")]
449    pub const UV_PYPY_INSTALL_MIRROR: &'static str = "UV_PYPY_INSTALL_MIRROR";
450
451    /// Pin managed CPython versions to a specific build version.
452    ///
453    /// For CPython, this should be the build date (e.g., "20250814").
454    #[attr_added_in("0.8.14")]
455    pub const UV_PYTHON_CPYTHON_BUILD: &'static str = "UV_PYTHON_CPYTHON_BUILD";
456
457    /// Pin managed PyPy versions to a specific build version.
458    ///
459    /// For PyPy, this should be the PyPy version (e.g., "7.3.20").
460    #[attr_added_in("0.8.14")]
461    pub const UV_PYTHON_PYPY_BUILD: &'static str = "UV_PYTHON_PYPY_BUILD";
462
463    /// Pin managed GraalPy versions to a specific build version.
464    ///
465    /// For GraalPy, this should be the GraalPy version (e.g., "24.2.2").
466    #[attr_added_in("0.8.14")]
467    pub const UV_PYTHON_GRAALPY_BUILD: &'static str = "UV_PYTHON_GRAALPY_BUILD";
468
469    /// Pin managed Pyodide versions to a specific build version.
470    ///
471    /// For Pyodide, this should be the Pyodide version (e.g., "0.28.1").
472    #[attr_added_in("0.8.14")]
473    pub const UV_PYTHON_PYODIDE_BUILD: &'static str = "UV_PYTHON_PYODIDE_BUILD";
474
475    /// Equivalent to the `--clear` command-line argument. If set, uv will remove any
476    /// existing files or directories at the target path.
477    #[attr_added_in("0.8.0")]
478    pub const UV_VENV_CLEAR: &'static str = "UV_VENV_CLEAR";
479
480    /// Equivalent to the `--relocatable` command-line argument. If set, the virtual
481    /// environment will be relocatable.
482    #[attr_added_in("0.10.8")]
483    pub const UV_VENV_RELOCATABLE: &'static str = "UV_VENV_RELOCATABLE";
484
485    /// Install seed packages (one or more of: `pip`, `setuptools`, and `wheel`) into the virtual environment
486    /// created by `uv venv`.
487    ///
488    /// Note that `setuptools` and `wheel` are not included in Python 3.12+ environments.
489    #[attr_added_in("0.5.21")]
490    pub const UV_VENV_SEED: &'static str = "UV_VENV_SEED";
491
492    /// Used to override `PATH` to limit Python executable availability in the test suite.
493    #[attr_hidden]
494    #[attr_added_in("0.0.5")]
495    pub const UV_TEST_PYTHON_PATH: &'static str = "UV_TEST_PYTHON_PATH";
496
497    /// Include resolver and installer output related to environment modifications.
498    #[attr_hidden]
499    #[attr_added_in("0.2.32")]
500    pub const UV_SHOW_RESOLUTION: &'static str = "UV_SHOW_RESOLUTION";
501
502    /// Use to update the json schema files.
503    #[attr_hidden]
504    #[attr_added_in("0.1.34")]
505    pub const UV_UPDATE_SCHEMA: &'static str = "UV_UPDATE_SCHEMA";
506
507    /// Use to disable line wrapping for diagnostics.
508    #[attr_added_in("0.0.5")]
509    pub const UV_NO_WRAP: &'static str = "UV_NO_WRAP";
510
511    /// Provides the HTTP Basic authentication username for a named index.
512    ///
513    /// The `name` parameter is the name of the index. For example, given an index named `foo`,
514    /// the environment variable key would be `UV_INDEX_FOO_USERNAME`.
515    #[attr_added_in("0.4.23")]
516    #[attr_env_var_pattern("UV_INDEX_{name}_USERNAME")]
517    pub fn index_username(name: &str) -> String {
518        format!("UV_INDEX_{name}_USERNAME")
519    }
520
521    /// Provides the HTTP Basic authentication password for a named index.
522    ///
523    /// The `name` parameter is the name of the index. For example, given an index named `foo`,
524    /// the environment variable key would be `UV_INDEX_FOO_PASSWORD`.
525    #[attr_added_in("0.4.23")]
526    #[attr_env_var_pattern("UV_INDEX_{name}_PASSWORD")]
527    pub fn index_password(name: &str) -> String {
528        format!("UV_INDEX_{name}_PASSWORD")
529    }
530
531    /// Used to set the uv commit hash at build time via `build.rs`.
532    #[attr_hidden]
533    #[attr_added_in("0.1.11")]
534    pub const UV_COMMIT_HASH: &'static str = "UV_COMMIT_HASH";
535
536    /// Used to set the uv commit short hash at build time via `build.rs`.
537    #[attr_hidden]
538    #[attr_added_in("0.1.11")]
539    pub const UV_COMMIT_SHORT_HASH: &'static str = "UV_COMMIT_SHORT_HASH";
540
541    /// Used to set the uv commit date at build time via `build.rs`.
542    #[attr_hidden]
543    #[attr_added_in("0.1.11")]
544    pub const UV_COMMIT_DATE: &'static str = "UV_COMMIT_DATE";
545
546    /// Used to set the uv tag at build time via `build.rs`.
547    #[attr_hidden]
548    #[attr_added_in("0.1.11")]
549    pub const UV_LAST_TAG: &'static str = "UV_LAST_TAG";
550
551    /// Used to set the uv tag distance from head at build time via `build.rs`.
552    #[attr_hidden]
553    #[attr_added_in("0.1.11")]
554    pub const UV_LAST_TAG_DISTANCE: &'static str = "UV_LAST_TAG_DISTANCE";
555
556    /// Used to set the spawning/parent interpreter when using --system in the test suite.
557    #[attr_hidden]
558    #[attr_added_in("0.2.0")]
559    pub const UV_INTERNAL__PARENT_INTERPRETER: &'static str = "UV_INTERNAL__PARENT_INTERPRETER";
560
561    /// Used to force showing the derivation tree during resolver error reporting.
562    #[attr_hidden]
563    #[attr_added_in("0.3.0")]
564    pub const UV_INTERNAL__SHOW_DERIVATION_TREE: &'static str = "UV_INTERNAL__SHOW_DERIVATION_TREE";
565
566    /// Used to set a temporary directory for some tests.
567    #[attr_hidden]
568    #[attr_added_in("0.3.4")]
569    pub const UV_INTERNAL__TEST_DIR: &'static str = "UV_INTERNAL__TEST_DIR";
570
571    /// Path to a directory on a filesystem that supports copy-on-write, e.g., btrfs or APFS.
572    ///
573    /// When populated, uv will run additional tests that require this functionality.
574    #[attr_hidden]
575    #[attr_added_in("0.10.5")]
576    pub const UV_INTERNAL__TEST_COW_FS: &'static str = "UV_INTERNAL__TEST_COW_FS";
577
578    /// Path to a directory on a filesystem that does **not** support copy-on-write.
579    ///
580    /// When populated, uv will run additional tests that verify fallback behavior
581    /// when copy-on-write is unavailable.
582    #[attr_hidden]
583    #[attr_added_in("0.10.5")]
584    pub const UV_INTERNAL__TEST_NOCOW_FS: &'static str = "UV_INTERNAL__TEST_NOCOW_FS";
585
586    /// Path to a directory on an alternative filesystem for testing.
587    ///
588    /// This filesystem must be a different device than the default for the test suite.
589    ///
590    /// When populated, uv will run additional tests that cover cross-filesystem linking.
591    #[attr_hidden]
592    #[attr_added_in("0.10.5")]
593    pub const UV_INTERNAL__TEST_ALT_FS: &'static str = "UV_INTERNAL__TEST_ALT_FS";
594
595    /// Path to a directory on a filesystem with a low hardlink limit (e.g., minix with ~250).
596    ///
597    /// When populated, uv will run additional tests that exercise EMLINK recovery.
598    #[attr_hidden]
599    #[attr_added_in("0.10.9")]
600    pub const UV_INTERNAL__TEST_LOWLINKS_FS: &'static str = "UV_INTERNAL__TEST_LOWLINKS_FS";
601
602    /// Used to force treating an interpreter as "managed" during tests.
603    #[attr_hidden]
604    #[attr_added_in("0.8.0")]
605    pub const UV_INTERNAL__TEST_PYTHON_MANAGED: &'static str = "UV_INTERNAL__TEST_PYTHON_MANAGED";
606
607    /// Used to force ignoring Git LFS commands as `git-lfs` detection cannot be overridden via PATH.
608    #[attr_hidden]
609    #[attr_added_in("0.9.15")]
610    pub const UV_INTERNAL__TEST_LFS_DISABLED: &'static str = "UV_INTERNAL__TEST_LFS_DISABLED";
611
612    /// Marker variable to track whether `PYTHONHOME` was set by uv.
613    /// Used by the Windows trampoline to distinguish uv-set values from user-set values.
614    #[attr_hidden]
615    #[attr_added_in("0.9.29")]
616    pub const UV_INTERNAL__PYTHONHOME: &'static str = "UV_INTERNAL__PYTHONHOME";
617
618    /// Path to system-level configuration directory on Unix systems.
619    #[attr_added_in("0.4.26")]
620    pub const XDG_CONFIG_DIRS: &'static str = "XDG_CONFIG_DIRS";
621
622    /// Path to system-level configuration directory on Windows systems.
623    #[attr_added_in("0.4.26")]
624    pub const SYSTEMDRIVE: &'static str = "SYSTEMDRIVE";
625
626    /// Path to user-level configuration directory on Windows systems.
627    #[attr_added_in("0.1.42")]
628    pub const APPDATA: &'static str = "APPDATA";
629
630    /// Path to root directory of user's profile on Windows systems.
631    #[attr_added_in("0.0.5")]
632    pub const USERPROFILE: &'static str = "USERPROFILE";
633
634    /// Path to user-level configuration directory on Unix systems.
635    #[attr_added_in("0.1.34")]
636    pub const XDG_CONFIG_HOME: &'static str = "XDG_CONFIG_HOME";
637
638    /// Path to cache directory on Unix systems.
639    #[attr_added_in("0.1.17")]
640    pub const XDG_CACHE_HOME: &'static str = "XDG_CACHE_HOME";
641
642    /// Path to directory for storing managed Python installations and tools.
643    #[attr_added_in("0.2.16")]
644    pub const XDG_DATA_HOME: &'static str = "XDG_DATA_HOME";
645
646    /// Path to directory where executables are installed.
647    #[attr_added_in("0.2.16")]
648    pub const XDG_BIN_HOME: &'static str = "XDG_BIN_HOME";
649
650    /// Custom certificate bundle file path for SSL connections.
651    ///
652    /// Takes precedence over `UV_NATIVE_TLS` when set.
653    #[attr_added_in("0.1.14")]
654    pub const SSL_CERT_FILE: &'static str = "SSL_CERT_FILE";
655
656    /// Custom path for certificate bundles for SSL connections.
657    /// Multiple entries are supported separated using a platform-specific
658    /// delimiter (`:` on Unix, `;` on Windows).
659    ///
660    /// Takes precedence over `UV_NATIVE_TLS` when set.
661    #[attr_added_in("0.9.10")]
662    pub const SSL_CERT_DIR: &'static str = "SSL_CERT_DIR";
663
664    /// If set, uv will use this file for mTLS authentication.
665    /// This should be a single file containing both the certificate and the private key in PEM format.
666    #[attr_added_in("0.2.11")]
667    pub const SSL_CLIENT_CERT: &'static str = "SSL_CLIENT_CERT";
668
669    /// Proxy for HTTP requests.
670    #[attr_added_in("0.1.38")]
671    pub const HTTP_PROXY: &'static str = "HTTP_PROXY";
672
673    /// Proxy for HTTPS requests.
674    #[attr_added_in("0.1.38")]
675    pub const HTTPS_PROXY: &'static str = "HTTPS_PROXY";
676
677    /// General proxy for all network requests.
678    #[attr_added_in("0.1.38")]
679    pub const ALL_PROXY: &'static str = "ALL_PROXY";
680
681    /// Comma-separated list of hostnames (e.g., `example.com`) and/or patterns (e.g., `192.168.1.0/24`) that should bypass the proxy.
682    #[attr_added_in("0.1.38")]
683    pub const NO_PROXY: &'static str = "NO_PROXY";
684
685    /// Timeout (in seconds) for only upload HTTP requests. (default: 900 s)
686    #[attr_added_in("0.9.1")]
687    pub const UV_UPLOAD_HTTP_TIMEOUT: &'static str = "UV_UPLOAD_HTTP_TIMEOUT";
688
689    /// Timeout (in seconds) for HTTP reads. (default: 30 s)
690    #[attr_added_in("0.1.7")]
691    pub const UV_HTTP_TIMEOUT: &'static str = "UV_HTTP_TIMEOUT";
692
693    /// Timeout (in seconds) to connect to a server. (default: 10 s)
694    ///
695    /// If `UV_HTTP_TIMEOUT` is lower than this value, `UV_HTTP_TIMEOUT` will be used instead.
696    #[attr_added_in("0.10.0")]
697    pub const UV_HTTP_CONNECT_TIMEOUT: &'static str = "UV_HTTP_CONNECT_TIMEOUT";
698
699    /// The number of retries for HTTP requests. (default: 3)
700    #[attr_added_in("0.7.21")]
701    pub const UV_HTTP_RETRIES: &'static str = "UV_HTTP_RETRIES";
702
703    /// Timeout (in seconds) for HTTP requests. Equivalent to `UV_HTTP_TIMEOUT`.
704    #[attr_added_in("0.1.6")]
705    pub const UV_REQUEST_TIMEOUT: &'static str = "UV_REQUEST_TIMEOUT";
706
707    /// Timeout (in seconds) for HTTP requests. Equivalent to `UV_HTTP_TIMEOUT`.
708    #[attr_added_in("0.1.7")]
709    pub const HTTP_TIMEOUT: &'static str = "HTTP_TIMEOUT";
710
711    /// The validation modes to use when run with `--compile`.
712    ///
713    /// See [`PycInvalidationMode`](https://docs.python.org/3/library/py_compile.html#py_compile.PycInvalidationMode).
714    #[attr_added_in("0.1.7")]
715    pub const PYC_INVALIDATION_MODE: &'static str = "PYC_INVALIDATION_MODE";
716
717    /// Used to detect an activated virtual environment.
718    #[attr_added_in("0.0.5")]
719    pub const VIRTUAL_ENV: &'static str = "VIRTUAL_ENV";
720
721    /// Used to detect the path of an active Conda environment.
722    #[attr_added_in("0.0.5")]
723    pub const CONDA_PREFIX: &'static str = "CONDA_PREFIX";
724
725    /// Used to determine the name of the active Conda environment.
726    #[attr_added_in("0.5.0")]
727    pub const CONDA_DEFAULT_ENV: &'static str = "CONDA_DEFAULT_ENV";
728
729    /// Used to determine the root install path of Conda.
730    #[attr_added_in("0.8.18")]
731    pub const CONDA_ROOT: &'static str = "_CONDA_ROOT";
732
733    /// Used to determine if we're running in Dependabot.
734    #[attr_added_in("0.9.11")]
735    pub const DEPENDABOT: &'static str = "DEPENDABOT";
736
737    /// If set to `1` before a virtual environment is activated, then the
738    /// virtual environment name will not be prepended to the terminal prompt.
739    #[attr_added_in("0.0.5")]
740    pub const VIRTUAL_ENV_DISABLE_PROMPT: &'static str = "VIRTUAL_ENV_DISABLE_PROMPT";
741
742    /// Used to detect the use of the Windows Command Prompt (as opposed to PowerShell).
743    #[attr_added_in("0.1.16")]
744    pub const PROMPT: &'static str = "PROMPT";
745
746    /// Used to detect `NuShell` usage.
747    #[attr_added_in("0.1.16")]
748    pub const NU_VERSION: &'static str = "NU_VERSION";
749
750    /// Used to detect Fish shell usage.
751    #[attr_added_in("0.1.28")]
752    pub const FISH_VERSION: &'static str = "FISH_VERSION";
753
754    /// Used to detect Bash shell usage.
755    #[attr_added_in("0.1.28")]
756    pub const BASH_VERSION: &'static str = "BASH_VERSION";
757
758    /// Used to detect Zsh shell usage.
759    #[attr_added_in("0.1.28")]
760    pub const ZSH_VERSION: &'static str = "ZSH_VERSION";
761
762    /// Used to determine which `.zshenv` to use when Zsh is being used.
763    #[attr_added_in("0.2.25")]
764    pub const ZDOTDIR: &'static str = "ZDOTDIR";
765
766    /// Used to detect Ksh shell usage.
767    #[attr_added_in("0.2.33")]
768    pub const KSH_VERSION: &'static str = "KSH_VERSION";
769
770    /// Used to detect PowerShell usage (set by PowerShell on all platforms).
771    #[attr_added_in("next version")]
772    pub const PS_MODULE_PATH: &'static str = "PSModulePath";
773
774    /// Used with `--python-platform macos` and related variants to set the
775    /// deployment target (i.e., the minimum supported macOS version).
776    ///
777    /// Defaults to `13.0`, the least-recent non-EOL macOS version at time of writing.
778    #[attr_added_in("0.1.42")]
779    pub const MACOSX_DEPLOYMENT_TARGET: &'static str = "MACOSX_DEPLOYMENT_TARGET";
780
781    /// Used with `--python-platform arm64-apple-ios` and related variants to set the
782    /// deployment target (i.e., the minimum supported iOS version).
783    ///
784    /// Defaults to `13.0`.
785    #[attr_added_in("0.8.16")]
786    pub const IPHONEOS_DEPLOYMENT_TARGET: &'static str = "IPHONEOS_DEPLOYMENT_TARGET";
787
788    /// Used with `--python-platform aarch64-linux-android` and related variants to set the
789    /// Android API level. (i.e., the minimum supported Android API level).
790    ///
791    /// Defaults to `24`.
792    #[attr_added_in("0.8.16")]
793    pub const ANDROID_API_LEVEL: &'static str = "ANDROID_API_LEVEL";
794
795    /// Disables colored output (takes precedence over `FORCE_COLOR`).
796    ///
797    /// See [no-color.org](https://no-color.org).
798    #[attr_added_in("0.2.7")]
799    pub const NO_COLOR: &'static str = "NO_COLOR";
800
801    /// Forces colored output regardless of terminal support.
802    ///
803    /// See [force-color.org](https://force-color.org).
804    #[attr_added_in("0.2.7")]
805    pub const FORCE_COLOR: &'static str = "FORCE_COLOR";
806
807    /// Use to control color via `anstyle`.
808    #[attr_added_in("0.1.32")]
809    pub const CLICOLOR_FORCE: &'static str = "CLICOLOR_FORCE";
810
811    /// The standard `PATH` env var.
812    #[attr_added_in("0.0.5")]
813    pub const PATH: &'static str = "PATH";
814
815    /// The standard `HOME` env var.
816    #[attr_added_in("0.0.5")]
817    pub const HOME: &'static str = "HOME";
818
819    /// The standard `SHELL` posix env var.
820    #[attr_added_in("0.1.16")]
821    pub const SHELL: &'static str = "SHELL";
822
823    /// The standard `PWD` posix env var.
824    #[attr_added_in("0.0.5")]
825    pub const PWD: &'static str = "PWD";
826
827    /// Used to look for Microsoft Store Pythons installations.
828    #[attr_added_in("0.3.3")]
829    pub const LOCALAPPDATA: &'static str = "LOCALAPPDATA";
830
831    /// Path to the `.git` directory. Ignored by `uv` when performing fetch.
832    #[attr_hidden]
833    #[attr_added_in("0.0.5")]
834    pub const GIT_DIR: &'static str = "GIT_DIR";
835
836    /// Path to the git working tree. Ignored by `uv` when performing fetch.
837    #[attr_hidden]
838    #[attr_added_in("0.0.5")]
839    pub const GIT_WORK_TREE: &'static str = "GIT_WORK_TREE";
840
841    /// Path to the index file for staged changes. Ignored by `uv` when performing fetch.
842    #[attr_hidden]
843    #[attr_added_in("0.0.5")]
844    pub const GIT_INDEX_FILE: &'static str = "GIT_INDEX_FILE";
845
846    /// Path to where git object files are located. Ignored by `uv` when performing fetch.
847    #[attr_hidden]
848    #[attr_added_in("0.0.5")]
849    pub const GIT_OBJECT_DIRECTORY: &'static str = "GIT_OBJECT_DIRECTORY";
850
851    /// Alternate locations for git objects. Ignored by `uv` when performing fetch.
852    #[attr_hidden]
853    #[attr_added_in("0.0.5")]
854    pub const GIT_ALTERNATE_OBJECT_DIRECTORIES: &'static str = "GIT_ALTERNATE_OBJECT_DIRECTORIES";
855
856    /// Disables SSL verification for git operations.
857    #[attr_hidden]
858    #[attr_added_in("0.5.28")]
859    pub const GIT_SSL_NO_VERIFY: &'static str = "GIT_SSL_NO_VERIFY";
860
861    /// Sets allowed protocols for git operations.
862    ///
863    /// When uv is in "offline" mode, only the "file" protocol is allowed.
864    #[attr_hidden]
865    #[attr_added_in("0.6.13")]
866    pub const GIT_ALLOW_PROTOCOL: &'static str = "GIT_ALLOW_PROTOCOL";
867
868    /// Sets the SSH command used when Git tries to establish a connection using SSH.
869    #[attr_hidden]
870    #[attr_added_in("0.7.11")]
871    pub const GIT_SSH_COMMAND: &'static str = "GIT_SSH_COMMAND";
872
873    /// Disable interactive git prompts in terminals, e.g., for credentials. Does not disable
874    /// GUI prompts.
875    #[attr_hidden]
876    #[attr_added_in("0.6.4")]
877    pub const GIT_TERMINAL_PROMPT: &'static str = "GIT_TERMINAL_PROMPT";
878
879    /// Skip Smudge LFS Filter.
880    #[attr_hidden]
881    #[attr_added_in("0.9.15")]
882    pub const GIT_LFS_SKIP_SMUDGE: &'static str = "GIT_LFS_SKIP_SMUDGE";
883
884    /// Used in tests to set the user global git config location.
885    #[attr_hidden]
886    #[attr_added_in("0.9.15")]
887    pub const GIT_CONFIG_GLOBAL: &'static str = "GIT_CONFIG_GLOBAL";
888
889    /// Used in tests for better git isolation.
890    ///
891    /// For example, we run some tests in ~/.local/share/uv/tests.
892    /// And if the user's `$HOME` directory is a git repository,
893    /// this will change the behavior of some tests. Setting
894    /// `GIT_CEILING_DIRECTORIES=/home/andrew/.local/share/uv/tests` will
895    /// prevent git from crawling up the directory tree past that point to find
896    /// parent git repositories.
897    #[attr_hidden]
898    #[attr_added_in("0.4.29")]
899    pub const GIT_CEILING_DIRECTORIES: &'static str = "GIT_CEILING_DIRECTORIES";
900
901    /// Indicates that the current process is running in GitHub Actions.
902    ///
903    /// `uv publish` may attempt trusted publishing flows when set
904    /// to `true`.
905    #[attr_added_in("0.4.16")]
906    pub const GITHUB_ACTIONS: &'static str = "GITHUB_ACTIONS";
907
908    /// Indicates that the current process is running in GitLab CI.
909    ///
910    /// `uv publish` may attempt trusted publishing flows when set
911    /// to `true`.
912    #[attr_added_in("0.8.18")]
913    pub const GITLAB_CI: &'static str = "GITLAB_CI";
914
915    /// Used for testing GitLab CI trusted publishing.
916    #[attr_hidden]
917    #[attr_added_in("0.8.18")]
918    pub const PYPI_ID_TOKEN: &'static str = "PYPI_ID_TOKEN";
919
920    /// Used for testing GitLab CI trusted publishing.
921    #[attr_hidden]
922    #[attr_added_in("0.8.18")]
923    pub const TESTPYPI_ID_TOKEN: &'static str = "TESTPYPI_ID_TOKEN";
924
925    /// Sets the encoding for standard I/O streams (e.g., PYTHONIOENCODING=utf-8).
926    #[attr_hidden]
927    #[attr_added_in("0.4.18")]
928    pub const PYTHONIOENCODING: &'static str = "PYTHONIOENCODING";
929
930    /// Forces unbuffered I/O streams, equivalent to `-u` in Python.
931    #[attr_hidden]
932    #[attr_added_in("0.1.15")]
933    pub const PYTHONUNBUFFERED: &'static str = "PYTHONUNBUFFERED";
934
935    /// Enables UTF-8 mode for Python, equivalent to `-X utf8`.
936    #[attr_hidden]
937    #[attr_added_in("0.4.19")]
938    pub const PYTHONUTF8: &'static str = "PYTHONUTF8";
939
940    /// Adds directories to Python module search path (e.g., `PYTHONPATH=/path/to/modules`).
941    #[attr_added_in("0.1.22")]
942    pub const PYTHONPATH: &'static str = "PYTHONPATH";
943
944    /// Used to set the location of Python stdlib when using trampolines.
945    #[attr_hidden]
946    #[attr_added_in("0.7.13")]
947    pub const PYTHONHOME: &'static str = "PYTHONHOME";
948
949    /// Used to correctly detect virtual environments when using trampolines.
950    #[attr_hidden]
951    #[attr_added_in("0.7.13")]
952    pub const PYVENV_LAUNCHER: &'static str = "__PYVENV_LAUNCHER__";
953
954    /// Used in tests to enforce a consistent locale setting.
955    #[attr_hidden]
956    #[attr_added_in("0.4.28")]
957    pub const LC_ALL: &'static str = "LC_ALL";
958
959    /// Typically set by CI runners, used to detect a CI runner.
960    #[attr_hidden]
961    #[attr_added_in("0.0.5")]
962    pub const CI: &'static str = "CI";
963
964    /// Azure DevOps build identifier, used to detect CI environments.
965    #[attr_hidden]
966    #[attr_added_in("0.1.22")]
967    pub const BUILD_BUILDID: &'static str = "BUILD_BUILDID";
968
969    /// Generic build identifier, used to detect CI environments.
970    #[attr_hidden]
971    #[attr_added_in("0.1.22")]
972    pub const BUILD_ID: &'static str = "BUILD_ID";
973
974    /// Pip environment variable to indicate CI environment.
975    #[attr_hidden]
976    #[attr_added_in("0.1.22")]
977    pub const PIP_IS_CI: &'static str = "PIP_IS_CI";
978
979    /// Use to set the .netrc file location.
980    #[attr_added_in("0.1.16")]
981    pub const NETRC: &'static str = "NETRC";
982
983    /// The standard `PAGER` posix env var. Used by `uv` to configure the appropriate pager.
984    #[attr_added_in("0.4.18")]
985    pub const PAGER: &'static str = "PAGER";
986
987    /// Used to detect when running inside a Jupyter notebook.
988    #[attr_added_in("0.2.6")]
989    pub const JPY_SESSION_NAME: &'static str = "JPY_SESSION_NAME";
990
991    /// Use to create the tracing root directory via the `tracing-durations-export` feature.
992    #[attr_hidden]
993    #[attr_added_in("0.1.32")]
994    pub const TRACING_DURATIONS_TEST_ROOT: &'static str = "TRACING_DURATIONS_TEST_ROOT";
995
996    /// Use to create the tracing durations file via the `tracing-durations-export` feature.
997    #[attr_added_in("0.0.5")]
998    pub const TRACING_DURATIONS_FILE: &'static str = "TRACING_DURATIONS_FILE";
999
1000    /// Used to set `RUST_HOST_TARGET` at build time via `build.rs`.
1001    #[attr_hidden]
1002    #[attr_added_in("0.1.11")]
1003    pub const TARGET: &'static str = "TARGET";
1004
1005    /// If set, uv will use this value as the log level for its `--verbose` output. Accepts
1006    /// any filter compatible with the `tracing_subscriber` crate.
1007    ///
1008    /// For example:
1009    ///
1010    /// * `RUST_LOG=uv=debug` is the equivalent of adding `--verbose` to the command line
1011    /// * `RUST_LOG=trace` will enable trace-level logging.
1012    ///
1013    /// See the [tracing documentation](https://docs.rs/tracing-subscriber/latest/tracing_subscriber/filter/struct.EnvFilter.html#example-syntax)
1014    /// for more.
1015    #[attr_added_in("0.0.5")]
1016    pub const RUST_LOG: &'static str = "RUST_LOG";
1017
1018    /// If set, it can be used to display more stack trace details when a panic occurs.
1019    /// This is used by uv particularly on windows to show more details during a platform exception.
1020    ///
1021    /// For example:
1022    ///
1023    /// * `RUST_BACKTRACE=1` will print a short backtrace.
1024    /// * `RUST_BACKTRACE=full` will print a full backtrace.
1025    ///
1026    /// See the [Rust backtrace documentation](https://doc.rust-lang.org/std/backtrace/index.html)
1027    /// for more.
1028    #[attr_added_in("0.7.22")]
1029    pub const RUST_BACKTRACE: &'static str = "RUST_BACKTRACE";
1030
1031    /// Add additional context and structure to log messages.
1032    ///
1033    /// If logging is not enabled, e.g., with `RUST_LOG` or `-v`, this has no effect.
1034    #[attr_added_in("0.6.4")]
1035    pub const UV_LOG_CONTEXT: &'static str = "UV_LOG_CONTEXT";
1036
1037    /// Use to set the stack size used by uv.
1038    ///
1039    /// The value is in bytes, and if both `UV_STACK_SIZE` are `RUST_MIN_STACK` unset, uv uses a 4MB
1040    /// (4194304) stack. `UV_STACK_SIZE` takes precedence over `RUST_MIN_STACK`.
1041    ///
1042    /// Unlike the normal `RUST_MIN_STACK` semantics, this can affect main thread
1043    /// stack size, because we actually spawn our own main2 thread to work around
1044    /// the fact that Windows' real main thread is only 1MB. That thread has size
1045    /// `max(UV_STACK_SIZE, 1MB)`.
1046    #[attr_added_in("0.0.5")]
1047    pub const UV_STACK_SIZE: &'static str = "UV_STACK_SIZE";
1048
1049    /// Use to set the stack size used by uv.
1050    ///
1051    /// The value is in bytes, and if both `UV_STACK_SIZE` are `RUST_MIN_STACK` unset, uv uses a 4MB
1052    /// (4194304) stack. `UV_STACK_SIZE` takes precedence over `RUST_MIN_STACK`.
1053    ///
1054    /// Prefer setting `UV_STACK_SIZE`, since `RUST_MIN_STACK` also affects subprocesses, such as
1055    /// build backends that use Rust code.
1056    ///
1057    /// Unlike the normal `RUST_MIN_STACK` semantics, this can affect main thread
1058    /// stack size, because we actually spawn our own main2 thread to work around
1059    /// the fact that Windows' real main thread is only 1MB. That thread has size
1060    /// `max(RUST_MIN_STACK, 1MB)`.
1061    #[attr_added_in("0.5.19")]
1062    pub const RUST_MIN_STACK: &'static str = "RUST_MIN_STACK";
1063
1064    /// The directory containing the `Cargo.toml` manifest for a package.
1065    #[attr_hidden]
1066    #[attr_added_in("0.1.11")]
1067    pub const CARGO_MANIFEST_DIR: &'static str = "CARGO_MANIFEST_DIR";
1068
1069    /// Specifies the directory where Cargo stores build artifacts (target directory).
1070    #[attr_hidden]
1071    #[attr_added_in("0.0.5")]
1072    pub const CARGO_TARGET_DIR: &'static str = "CARGO_TARGET_DIR";
1073
1074    /// Set by cargo when compiling for Windows-like platforms.
1075    #[attr_hidden]
1076    #[attr_added_in("0.0.5")]
1077    pub const CARGO_CFG_WINDOWS: &'static str = "CARGO_CFG_WINDOWS";
1078
1079    /// Specifies the directory where Cargo stores intermediate build artifacts.
1080    #[attr_hidden]
1081    #[attr_added_in("0.8.25")]
1082    pub const OUT_DIR: &'static str = "OUT_DIR";
1083
1084    /// Used in tests for environment substitution testing in `requirements.in`.
1085    #[attr_hidden]
1086    #[attr_added_in("0.1.18")]
1087    pub const URL: &'static str = "URL";
1088
1089    /// Used in tests for environment substitution testing in `requirements.in`.
1090    #[attr_hidden]
1091    #[attr_added_in("0.1.18")]
1092    pub const FILE_PATH: &'static str = "FILE_PATH";
1093
1094    /// Used in tests for environment substitution testing in `requirements.in`.
1095    #[attr_hidden]
1096    #[attr_added_in("0.1.25")]
1097    pub const HATCH_PATH: &'static str = "HATCH_PATH";
1098
1099    /// Used in tests for environment substitution testing in `requirements.in`.
1100    #[attr_hidden]
1101    #[attr_added_in("0.1.25")]
1102    pub const BLACK_PATH: &'static str = "BLACK_PATH";
1103
1104    /// Used in testing Hatch's root.uri feature
1105    ///
1106    /// See: <https://hatch.pypa.io/dev/config/dependency/#local>.
1107    #[attr_hidden]
1108    #[attr_added_in("0.1.22")]
1109    pub const ROOT_PATH: &'static str = "ROOT_PATH";
1110
1111    /// Used in testing extra build dependencies.
1112    #[attr_hidden]
1113    #[attr_added_in("0.8.5")]
1114    pub const EXPECTED_ANYIO_VERSION: &'static str = "EXPECTED_ANYIO_VERSION";
1115
1116    /// Used to set test credentials for keyring tests.
1117    #[attr_hidden]
1118    #[attr_added_in("0.1.34")]
1119    pub const KEYRING_TEST_CREDENTIALS: &'static str = "KEYRING_TEST_CREDENTIALS";
1120
1121    /// Used to disable delay for HTTP retries in tests.
1122    #[attr_added_in("0.7.21")]
1123    pub const UV_TEST_NO_HTTP_RETRY_DELAY: &'static str = "UV_TEST_NO_HTTP_RETRY_DELAY";
1124
1125    /// Used to set a packse index url for tests.
1126    #[attr_hidden]
1127    #[attr_added_in("0.2.12")]
1128    pub const UV_TEST_PACKSE_INDEX: &'static str = "UV_TEST_PACKSE_INDEX";
1129
1130    /// Used for testing named indexes in tests.
1131    #[attr_hidden]
1132    #[attr_added_in("0.5.21")]
1133    pub const UV_INDEX_MY_INDEX_USERNAME: &'static str = "UV_INDEX_MY_INDEX_USERNAME";
1134
1135    /// Used for testing named indexes in tests.
1136    #[attr_hidden]
1137    #[attr_added_in("0.5.21")]
1138    pub const UV_INDEX_MY_INDEX_PASSWORD: &'static str = "UV_INDEX_MY_INDEX_PASSWORD";
1139
1140    /// Used to set the GitHub fast-path url for tests.
1141    #[attr_hidden]
1142    #[attr_added_in("0.7.15")]
1143    pub const UV_GITHUB_FAST_PATH_URL: &'static str = "UV_GITHUB_FAST_PATH_URL";
1144
1145    /// Hide progress messages with non-deterministic order in tests.
1146    #[attr_hidden]
1147    #[attr_added_in("0.5.29")]
1148    pub const UV_TEST_NO_CLI_PROGRESS: &'static str = "UV_TEST_NO_CLI_PROGRESS";
1149
1150    /// Used to mock the current timestamp for relative `--exclude-newer` times in tests.
1151    /// Should be set to an RFC 3339 timestamp (e.g., `2025-11-21T12:00:00Z`).
1152    #[attr_hidden]
1153    #[attr_added_in("0.9.8")]
1154    pub const UV_TEST_CURRENT_TIMESTAMP: &'static str = "UV_TEST_CURRENT_TIMESTAMP";
1155
1156    /// `.env` files from which to load environment variables when executing `uv run` commands.
1157    #[attr_added_in("0.4.30")]
1158    pub const UV_ENV_FILE: &'static str = "UV_ENV_FILE";
1159
1160    /// Ignore `.env` files when executing `uv run` commands.
1161    #[attr_added_in("0.4.30")]
1162    pub const UV_NO_ENV_FILE: &'static str = "UV_NO_ENV_FILE";
1163
1164    /// The URL from which to download uv using the standalone installer and `self update` feature,
1165    /// in lieu of the default GitHub URL.
1166    #[attr_added_in("0.5.0")]
1167    pub const UV_INSTALLER_GITHUB_BASE_URL: &'static str = "UV_INSTALLER_GITHUB_BASE_URL";
1168
1169    /// The URL from which to download uv using the standalone installer and `self update` feature,
1170    /// in lieu of the default GitHub Enterprise URL.
1171    #[attr_added_in("0.5.0")]
1172    pub const UV_INSTALLER_GHE_BASE_URL: &'static str = "UV_INSTALLER_GHE_BASE_URL";
1173
1174    /// The directory in which to install uv using the standalone installer and `self update` feature.
1175    /// Defaults to `~/.local/bin`.
1176    #[attr_added_in("0.5.0")]
1177    pub const UV_INSTALL_DIR: &'static str = "UV_INSTALL_DIR";
1178
1179    /// Used ephemeral environments like CI to install uv to a specific path while preventing
1180    /// the installer from modifying shell profiles or environment variables.
1181    #[attr_added_in("0.5.0")]
1182    pub const UV_UNMANAGED_INSTALL: &'static str = "UV_UNMANAGED_INSTALL";
1183
1184    /// The URL from which to download uv using the standalone installer. By default, installs from
1185    /// uv's GitHub Releases. `INSTALLER_DOWNLOAD_URL` is also supported as an alias, for backwards
1186    /// compatibility.
1187    #[attr_added_in("0.8.4")]
1188    pub const UV_DOWNLOAD_URL: &'static str = "UV_DOWNLOAD_URL";
1189
1190    /// Avoid modifying the `PATH` environment variable when installing uv using the standalone
1191    /// installer and `self update` feature. `INSTALLER_NO_MODIFY_PATH` is also supported as an
1192    /// alias, for backwards compatibility.
1193    #[attr_added_in("0.8.4")]
1194    pub const UV_NO_MODIFY_PATH: &'static str = "UV_NO_MODIFY_PATH";
1195
1196    /// Skip writing `uv` installer metadata files (e.g., `INSTALLER`, `REQUESTED`, and `direct_url.json`) to site-packages `.dist-info` directories.
1197    #[attr_added_in("0.5.7")]
1198    pub const UV_NO_INSTALLER_METADATA: &'static str = "UV_NO_INSTALLER_METADATA";
1199
1200    /// Enables fetching files stored in Git LFS when installing a package from a Git repository.
1201    #[attr_added_in("0.5.19")]
1202    pub const UV_GIT_LFS: &'static str = "UV_GIT_LFS";
1203
1204    /// Number of times that `uv run` has been recursively invoked. Used to guard against infinite
1205    /// recursion, e.g., when `uv run`` is used in a script shebang.
1206    #[attr_hidden]
1207    #[attr_added_in("0.5.31")]
1208    pub const UV_RUN_RECURSION_DEPTH: &'static str = "UV_RUN_RECURSION_DEPTH";
1209
1210    /// Number of times that `uv run` will allow recursive invocations, before exiting with an
1211    /// error.
1212    #[attr_hidden]
1213    #[attr_added_in("0.5.31")]
1214    pub const UV_RUN_MAX_RECURSION_DEPTH: &'static str = "UV_RUN_MAX_RECURSION_DEPTH";
1215
1216    /// Overrides terminal width used for wrapping. This variable is not read by uv directly.
1217    ///
1218    /// This is a quasi-standard variable, described, e.g., in `ncurses(3x)`.
1219    #[attr_added_in("0.6.2")]
1220    pub const COLUMNS: &'static str = "COLUMNS";
1221
1222    /// The CUDA driver version to assume when inferring the PyTorch backend (e.g., `550.144.03`).
1223    #[attr_hidden]
1224    #[attr_added_in("0.6.9")]
1225    pub const UV_CUDA_DRIVER_VERSION: &'static str = "UV_CUDA_DRIVER_VERSION";
1226
1227    /// The AMD GPU architecture to assume when inferring the PyTorch backend (e.g., `gfx1100`).
1228    #[attr_hidden]
1229    #[attr_added_in("0.7.14")]
1230    pub const UV_AMD_GPU_ARCHITECTURE: &'static str = "UV_AMD_GPU_ARCHITECTURE";
1231
1232    /// Equivalent to the `--torch-backend` command-line argument (e.g., `cpu`, `cu126`, or `auto`).
1233    #[attr_added_in("0.6.9")]
1234    pub const UV_TORCH_BACKEND: &'static str = "UV_TORCH_BACKEND";
1235
1236    /// Equivalent to the `--project` command-line argument.
1237    #[attr_added_in("0.4.4")]
1238    pub const UV_PROJECT: &'static str = "UV_PROJECT";
1239
1240    /// Equivalent to the `--directory` command-line argument. `UV_WORKING_DIRECTORY` (added in
1241    /// v0.9.1) is also supported for backwards compatibility.
1242    #[attr_added_in("next version")]
1243    pub const UV_WORKING_DIR: &'static str = "UV_WORKING_DIR";
1244
1245    /// Equivalent to the `--directory` command-line argument.
1246    #[attr_hidden]
1247    #[attr_added_in("0.9.1")]
1248    pub const UV_WORKING_DIRECTORY: &'static str = "UV_WORKING_DIRECTORY";
1249
1250    /// Disable GitHub-specific requests that allow uv to skip `git fetch` in some circumstances.
1251    #[attr_added_in("0.7.13")]
1252    pub const UV_NO_GITHUB_FAST_PATH: &'static str = "UV_NO_GITHUB_FAST_PATH";
1253
1254    /// Authentication token for Hugging Face requests. When set, uv will use this token
1255    /// when making requests to `https://huggingface.co/` and any subdomains.
1256    #[attr_added_in("0.8.1")]
1257    pub const HF_TOKEN: &'static str = "HF_TOKEN";
1258
1259    /// Disable Hugging Face authentication, even if `HF_TOKEN` is set.
1260    #[attr_added_in("0.8.1")]
1261    pub const UV_NO_HF_TOKEN: &'static str = "UV_NO_HF_TOKEN";
1262
1263    /// The URL to treat as an S3-compatible storage endpoint. Requests to this endpoint
1264    /// will be signed using AWS Signature Version 4 based on the `AWS_ACCESS_KEY_ID`,
1265    /// `AWS_SECRET_ACCESS_KEY`, `AWS_PROFILE`, and `AWS_CONFIG_FILE` environment variables.
1266    #[attr_added_in("0.8.21")]
1267    pub const UV_S3_ENDPOINT_URL: &'static str = "UV_S3_ENDPOINT_URL";
1268
1269    /// The URL to treat as a GCS-compatible storage endpoint. Requests to this endpoint
1270    /// will be signed using Google Cloud authentication based on the `GOOGLE_APPLICATION_CREDENTIALS`
1271    /// environment variable or Application Default Credentials.
1272    #[attr_added_in("0.9.26")]
1273    pub const UV_GCS_ENDPOINT_URL: &'static str = "UV_GCS_ENDPOINT_URL";
1274
1275    /// The URL of the pyx Simple API server.
1276    #[attr_added_in("0.8.15")]
1277    pub const PYX_API_URL: &'static str = "PYX_API_URL";
1278
1279    /// The domain of the pyx CDN.
1280    #[attr_added_in("0.8.15")]
1281    pub const PYX_CDN_DOMAIN: &'static str = "PYX_CDN_DOMAIN";
1282
1283    /// The pyx API key (e.g., `sk-pyx-...`).
1284    #[attr_added_in("0.8.15")]
1285    pub const PYX_API_KEY: &'static str = "PYX_API_KEY";
1286
1287    /// The pyx API key, for backwards compatibility.
1288    #[attr_hidden]
1289    #[attr_added_in("0.8.15")]
1290    pub const UV_API_KEY: &'static str = "UV_API_KEY";
1291
1292    /// The pyx authentication token (e.g., `eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...`), as output by `uv auth token`.
1293    #[attr_added_in("0.8.15")]
1294    pub const PYX_AUTH_TOKEN: &'static str = "PYX_AUTH_TOKEN";
1295
1296    /// The pyx authentication token, for backwards compatibility.
1297    #[attr_hidden]
1298    #[attr_added_in("0.8.15")]
1299    pub const UV_AUTH_TOKEN: &'static str = "UV_AUTH_TOKEN";
1300
1301    /// Specifies the directory where uv stores pyx credentials.
1302    #[attr_added_in("0.8.15")]
1303    pub const PYX_CREDENTIALS_DIR: &'static str = "PYX_CREDENTIALS_DIR";
1304
1305    /// The AWS region to use when signing S3 requests.
1306    #[attr_added_in("0.8.21")]
1307    pub const AWS_REGION: &'static str = "AWS_REGION";
1308
1309    /// The default AWS region to use when signing S3 requests, if `AWS_REGION` is not set.
1310    #[attr_added_in("0.8.21")]
1311    pub const AWS_DEFAULT_REGION: &'static str = "AWS_DEFAULT_REGION";
1312
1313    /// The AWS access key ID to use when signing S3 requests.
1314    #[attr_added_in("0.8.21")]
1315    pub const AWS_ACCESS_KEY_ID: &'static str = "AWS_ACCESS_KEY_ID";
1316
1317    /// The AWS secret access key to use when signing S3 requests.
1318    #[attr_added_in("0.8.21")]
1319    pub const AWS_SECRET_ACCESS_KEY: &'static str = "AWS_SECRET_ACCESS_KEY";
1320
1321    /// The AWS session token to use when signing S3 requests.
1322    #[attr_added_in("0.8.21")]
1323    pub const AWS_SESSION_TOKEN: &'static str = "AWS_SESSION_TOKEN";
1324
1325    /// The AWS profile to use when signing S3 requests.
1326    #[attr_added_in("0.8.21")]
1327    pub const AWS_PROFILE: &'static str = "AWS_PROFILE";
1328
1329    /// The AWS config file to use when signing S3 requests.
1330    #[attr_added_in("0.8.21")]
1331    pub const AWS_CONFIG_FILE: &'static str = "AWS_CONFIG_FILE";
1332
1333    /// The AWS shared credentials file to use when signing S3 requests.
1334    #[attr_added_in("0.8.21")]
1335    pub const AWS_SHARED_CREDENTIALS_FILE: &'static str = "AWS_SHARED_CREDENTIALS_FILE";
1336
1337    /// Avoid verifying that wheel filenames match their contents when installing wheels. This
1338    /// is not recommended, as wheels with inconsistent filenames should be considered invalid and
1339    /// corrected by the relevant package maintainers; however, this option can be used to work
1340    /// around invalid artifacts in rare cases.
1341    #[attr_added_in("0.8.23")]
1342    pub const UV_SKIP_WHEEL_FILENAME_CHECK: &'static str = "UV_SKIP_WHEEL_FILENAME_CHECK";
1343
1344    /// Suppress output from the build backend when building source distributions, even in the event
1345    /// of build failures.
1346    #[attr_added_in("0.9.15")]
1347    pub const UV_HIDE_BUILD_OUTPUT: &'static str = "UV_HIDE_BUILD_OUTPUT";
1348
1349    /// The time in seconds uv waits for a file lock to become available.
1350    ///
1351    /// Defaults to 300s (5 min).
1352    #[attr_added_in("0.9.4")]
1353    pub const UV_LOCK_TIMEOUT: &'static str = "UV_LOCK_TIMEOUT";
1354}