From 64977b4adc06561b1624e05c5a625b39faee0755 Mon Sep 17 00:00:00 2001 From: adisbladis Date: Wed, 6 Nov 2024 04:53:14 +0000 Subject: [PATCH] feat: add environment variable to disable writing extra dist-info files This change introduces the `UV_NO_EXTRA_DIST_INFO` environment variable as a way to opt out of the extra dist-info files that `uv` is creating. This is important to achieve reproducible builds in distribution packaging, allowing to replace usage of [installer](https://pypi.org/project/installer) with `uv pip install`. At the time of writing these files are: - `uv_cache.json` Contains timestamps which are non-reproducible. These hashes also leak in to the `RECORD` file. - `direct_url.json` Contains the path to the installed wheel. While not non-reproducible it's not required for distribution packaging. - `INSTALLER` Again, not non-reproducible, but of no value in distribution packaging. --- crates/uv-install-wheel/src/linker.rs | 27 +++++++++------- crates/uv-install-wheel/src/wheel.rs | 4 +-- crates/uv-installer/src/installer.rs | 16 ++++++++++ crates/uv-static/src/env_vars.rs | 3 ++ crates/uv/src/commands/pip/install.rs | 2 ++ crates/uv/src/commands/pip/operations.rs | 2 ++ crates/uv/src/commands/pip/sync.rs | 2 ++ crates/uv/src/commands/project/add.rs | 4 +++ crates/uv/src/commands/project/environment.rs | 2 ++ crates/uv/src/commands/project/mod.rs | 4 +++ crates/uv/src/commands/project/remove.rs | 2 ++ crates/uv/src/commands/project/run.rs | 4 +++ crates/uv/src/commands/project/sync.rs | 4 +++ crates/uv/src/commands/tool/install.rs | 4 +++ crates/uv/src/commands/tool/run.rs | 6 ++++ crates/uv/src/commands/tool/upgrade.rs | 5 +++ crates/uv/src/lib.rs | 9 ++++++ crates/uv/src/settings.rs | 5 +++ crates/uv/tests/it/pip_install.rs | 32 +++++++++++++++++++ crates/uv/tests/it/show_settings.rs | 29 +++++++++++++++++ docs/configuration/environment.md | 1 + 21 files changed, 153 insertions(+), 14 deletions(-) diff --git a/crates/uv-install-wheel/src/linker.rs b/crates/uv-install-wheel/src/linker.rs index af00dc6122e4..125ee1d5cd02 100644 --- a/crates/uv-install-wheel/src/linker.rs +++ b/crates/uv-install-wheel/src/linker.rs @@ -7,8 +7,8 @@ use std::time::SystemTime; use crate::script::{scripts_from_ini, Script}; use crate::wheel::{ - extra_dist_info, install_data, parse_wheel_file, read_record_file, write_script_entrypoints, - LibKind, + install_data, parse_wheel_file, read_record_file, write_extra_dist_info, + write_script_entrypoints, LibKind, }; use crate::{Error, Layout}; use fs_err as fs; @@ -45,6 +45,7 @@ pub fn install_wheel( installer: Option<&str>, link_mode: LinkMode, locks: &Locks, + extra_dist_info: bool, ) -> Result<(), Error> { let dist_info_prefix = find_dist_info(&wheel)?; let metadata = dist_info_metadata(&dist_info_prefix, &wheel)?; @@ -140,16 +141,18 @@ pub fn install_wheel( trace!(?name, "No data"); } - trace!(?name, "Writing extra metadata"); - extra_dist_info( - site_packages, - &dist_info_prefix, - true, - direct_url, - cache_info, - installer, - &mut record, - )?; + if extra_dist_info { + trace!(?name, "Writing extra metadata"); + write_extra_dist_info( + site_packages, + &dist_info_prefix, + true, + direct_url, + cache_info, + installer, + &mut record, + )?; + } trace!(?name, "Writing record"); let mut record_writer = csv::WriterBuilder::new() diff --git a/crates/uv-install-wheel/src/wheel.rs b/crates/uv-install-wheel/src/wheel.rs index cf640348e7fc..a284e5da4861 100644 --- a/crates/uv-install-wheel/src/wheel.rs +++ b/crates/uv-install-wheel/src/wheel.rs @@ -616,7 +616,7 @@ pub(crate) fn write_file_recorded( } /// Adds `INSTALLER`, `REQUESTED` and `direct_url.json` to the .dist-info dir -pub(crate) fn extra_dist_info( +pub(crate) fn write_extra_dist_info( site_packages: &Path, dist_info_prefix: &str, requested: bool, @@ -767,7 +767,7 @@ mod test { Wheel-Version: 1.0 Generator: bdist_wheel (0.37.1) Root-Is-Purelib: false - Tag: cp38-cp38-manylinux_2_17_x86_64 + Tag: cp38-cp38-manylinux_2_17_x86_64 "}; let wheel = parse_email_message_file(&mut text.as_bytes(), "WHEEL").unwrap(); diff --git a/crates/uv-installer/src/installer.rs b/crates/uv-installer/src/installer.rs index 1b059bb725f7..6be15c2f830c 100644 --- a/crates/uv-installer/src/installer.rs +++ b/crates/uv-installer/src/installer.rs @@ -15,6 +15,7 @@ pub struct Installer<'a> { cache: Option<&'a Cache>, reporter: Option>, installer_name: Option, + extra_dist_info: bool, } impl<'a> Installer<'a> { @@ -26,6 +27,7 @@ impl<'a> Installer<'a> { cache: None, reporter: None, installer_name: Some("uv".to_string()), + extra_dist_info: true, } } @@ -62,6 +64,15 @@ impl<'a> Installer<'a> { } } + /// Set the whether to link Uv specific files in dist-info + #[must_use] + pub fn with_extra_dist_info(self, extra_dist_info: bool) -> Self { + Self { + extra_dist_info, + ..self + } + } + /// Install a set of wheels into a Python virtual environment. #[instrument(skip_all, fields(num_wheels = %wheels.len()))] pub async fn install(self, wheels: Vec) -> Result> { @@ -71,6 +82,7 @@ impl<'a> Installer<'a> { link_mode, reporter, installer_name, + extra_dist_info, } = self; if cache.is_some_and(Cache::is_temporary) { @@ -93,6 +105,7 @@ impl<'a> Installer<'a> { link_mode, reporter, relocatable, + extra_dist_info, ); // This may fail if the main task was cancelled. @@ -122,6 +135,7 @@ impl<'a> Installer<'a> { self.link_mode, self.reporter, self.venv.relocatable(), + self.extra_dist_info, ) } } @@ -135,6 +149,7 @@ fn install( link_mode: LinkMode, reporter: Option>, relocatable: bool, + extra_dist_info: bool, ) -> Result> { let locks = uv_install_wheel::linker::Locks::default(); wheels.par_iter().try_for_each(|wheel| { @@ -157,6 +172,7 @@ fn install( installer_name.as_deref(), link_mode, &locks, + extra_dist_info, ) .with_context(|| format!("Failed to install: {} ({wheel})", wheel.filename()))?; diff --git a/crates/uv-static/src/env_vars.rs b/crates/uv-static/src/env_vars.rs index 124e9d416a40..5b86eb030cc1 100644 --- a/crates/uv-static/src/env_vars.rs +++ b/crates/uv-static/src/env_vars.rs @@ -525,4 +525,7 @@ impl EnvVars { /// Ignore `.env` files when executing `uv run` commands. pub const UV_NO_ENV_FILE: &'static str = "UV_NO_ENV_FILE"; + + /// Skip writing `uv` cache & installer files to site-packages dist-info. + pub const UV_NO_EXTRA_DIST_INFO: &'static str = "UV_NO_EXTRA_DIST_INFO"; } diff --git a/crates/uv/src/commands/pip/install.rs b/crates/uv/src/commands/pip/install.rs index 7f45f3001f99..b64e2b31e869 100644 --- a/crates/uv/src/commands/pip/install.rs +++ b/crates/uv/src/commands/pip/install.rs @@ -82,6 +82,7 @@ pub(crate) async fn pip_install( cache: Cache, dry_run: bool, printer: Printer, + extra_dist_info: bool, ) -> anyhow::Result { let start = std::time::Instant::now(); @@ -449,6 +450,7 @@ pub(crate) async fn pip_install( Box::new(DefaultInstallLogger), dry_run, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/commands/pip/operations.rs b/crates/uv/src/commands/pip/operations.rs index 88d06a2be6f3..982f7234c2b6 100644 --- a/crates/uv/src/commands/pip/operations.rs +++ b/crates/uv/src/commands/pip/operations.rs @@ -399,6 +399,7 @@ pub(crate) async fn install( logger: Box, dry_run: bool, printer: Printer, + extra_dist_info: bool, ) -> Result { let start = std::time::Instant::now(); @@ -514,6 +515,7 @@ pub(crate) async fn install( installs = uv_installer::Installer::new(venv) .with_link_mode(link_mode) .with_cache(cache) + .with_extra_dist_info(extra_dist_info) .with_reporter(InstallReporter::from(printer).with_length(installs.len() as u64)) // This technically can block the runtime, but we are on the main thread and // have no other running tasks at this point, so this lets us avoid spawning a blocking diff --git a/crates/uv/src/commands/pip/sync.rs b/crates/uv/src/commands/pip/sync.rs index 22d73d09417b..bb8e8f254a73 100644 --- a/crates/uv/src/commands/pip/sync.rs +++ b/crates/uv/src/commands/pip/sync.rs @@ -70,6 +70,7 @@ pub(crate) async fn pip_sync( cache: Cache, dry_run: bool, printer: Printer, + extra_dist_info: bool, ) -> Result { let client_builder = BaseClientBuilder::new() .connectivity(connectivity) @@ -393,6 +394,7 @@ pub(crate) async fn pip_sync( Box::new(DefaultInstallLogger), dry_run, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/commands/project/add.rs b/crates/uv/src/commands/project/add.rs index 3a5dfbf6b3d3..d5db576d82f8 100644 --- a/crates/uv/src/commands/project/add.rs +++ b/crates/uv/src/commands/project/add.rs @@ -76,6 +76,7 @@ pub(crate) async fn add( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> Result { for source in &requirements { match source { @@ -638,6 +639,7 @@ pub(crate) async fn add( native_tls, cache, printer, + extra_dist_info, ) .await { @@ -698,6 +700,7 @@ async fn lock_and_sync( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> Result<(), ProjectError> { let mode = if locked { LockMode::Locked(venv.interpreter()) @@ -897,6 +900,7 @@ async fn lock_and_sync( native_tls, cache, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/commands/project/environment.rs b/crates/uv/src/commands/project/environment.rs index c49711576174..98e747ba68ac 100644 --- a/crates/uv/src/commands/project/environment.rs +++ b/crates/uv/src/commands/project/environment.rs @@ -39,6 +39,7 @@ impl CachedEnvironment { native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> Result { // When caching, always use the base interpreter, rather than that of the virtual // environment. @@ -118,6 +119,7 @@ impl CachedEnvironment { native_tls, cache, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/commands/project/mod.rs b/crates/uv/src/commands/project/mod.rs index 7e2dfdd0a3e9..8b1dc4a70323 100644 --- a/crates/uv/src/commands/project/mod.rs +++ b/crates/uv/src/commands/project/mod.rs @@ -955,6 +955,7 @@ pub(crate) async fn sync_environment( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> anyhow::Result { let InstallerSettingsRef { index_locations, @@ -1070,6 +1071,7 @@ pub(crate) async fn sync_environment( logger, dry_run, printer, + extra_dist_info, ) .await?; @@ -1108,6 +1110,7 @@ pub(crate) async fn update_environment( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> anyhow::Result { warn_on_requirements_txt_setting(&spec, settings.as_ref().into()); @@ -1310,6 +1313,7 @@ pub(crate) async fn update_environment( install, dry_run, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/commands/project/remove.rs b/crates/uv/src/commands/project/remove.rs index 7cbf0cf15e16..9bc8361ec250 100644 --- a/crates/uv/src/commands/project/remove.rs +++ b/crates/uv/src/commands/project/remove.rs @@ -47,6 +47,7 @@ pub(crate) async fn remove( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> Result { let target = if let Some(script) = script { // If we found a PEP 723 script and the user provided a project-only setting, warn. @@ -264,6 +265,7 @@ pub(crate) async fn remove( native_tls, cache, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/commands/project/run.rs b/crates/uv/src/commands/project/run.rs index e308610463ed..317e43311af8 100644 --- a/crates/uv/src/commands/project/run.rs +++ b/crates/uv/src/commands/project/run.rs @@ -83,6 +83,7 @@ pub(crate) async fn run( printer: Printer, env_file: Vec, no_env_file: bool, + extra_dist_info: bool, ) -> anyhow::Result { // These cases seem quite complex because (in theory) they should change the "current package". // Let's ban them entirely for now. @@ -317,6 +318,7 @@ pub(crate) async fn run( native_tls, cache, printer, + extra_dist_info, ) .await; @@ -709,6 +711,7 @@ pub(crate) async fn run( native_tls, cache, printer, + extra_dist_info, ) .await?; @@ -836,6 +839,7 @@ pub(crate) async fn run( native_tls, cache, printer, + extra_dist_info, ) .await; diff --git a/crates/uv/src/commands/project/sync.rs b/crates/uv/src/commands/project/sync.rs index 36f8935fd275..3d6dd2a804dc 100644 --- a/crates/uv/src/commands/project/sync.rs +++ b/crates/uv/src/commands/project/sync.rs @@ -60,6 +60,7 @@ pub(crate) async fn sync( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> Result { // Identify the project. let project = if frozen { @@ -211,6 +212,7 @@ pub(crate) async fn sync( native_tls, cache, printer, + extra_dist_info, ) .await?; @@ -234,6 +236,7 @@ pub(super) async fn do_sync( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> Result<(), ProjectError> { // Use isolated state for universal resolution. When resolving, we don't enforce that the // prioritized distributions match the current platform. So if we lock here, then try to @@ -421,6 +424,7 @@ pub(super) async fn do_sync( logger, dry_run, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/commands/tool/install.rs b/crates/uv/src/commands/tool/install.rs index adb6f884ef3e..80746921f1a2 100644 --- a/crates/uv/src/commands/tool/install.rs +++ b/crates/uv/src/commands/tool/install.rs @@ -35,6 +35,7 @@ use crate::printer::Printer; use crate::settings::ResolverInstallerSettings; /// Install a tool. +#[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn install( package: String, editable: bool, @@ -51,6 +52,7 @@ pub(crate) async fn install( native_tls: bool, cache: Cache, printer: Printer, + extra_dist_info: bool, ) -> Result { let client_builder = BaseClientBuilder::new() .connectivity(connectivity) @@ -354,6 +356,7 @@ pub(crate) async fn install( native_tls, &cache, printer, + extra_dist_info, ) .await? .into_environment(); @@ -402,6 +405,7 @@ pub(crate) async fn install( native_tls, &cache, printer, + extra_dist_info, ) .await .inspect_err(|_| { diff --git a/crates/uv/src/commands/tool/run.rs b/crates/uv/src/commands/tool/run.rs index 1f2145a95ee6..9ba16c0f0ab8 100644 --- a/crates/uv/src/commands/tool/run.rs +++ b/crates/uv/src/commands/tool/run.rs @@ -63,6 +63,7 @@ impl Display for ToolRunCommand { } /// Run a command. +#[allow(clippy::fn_params_excessive_bools)] pub(crate) async fn run( command: Option, from: Option, @@ -79,6 +80,7 @@ pub(crate) async fn run( native_tls: bool, cache: Cache, printer: Printer, + extra_dist_info: bool, ) -> anyhow::Result { let Some(command) = command else { // When a command isn't provided, we'll show a brief help including available tools @@ -120,6 +122,7 @@ pub(crate) async fn run( native_tls, &cache, printer, + extra_dist_info, ) .await; @@ -390,6 +393,7 @@ fn warn_executable_not_provided_by_package( /// /// If the target tool is already installed in a compatible environment, returns that /// [`PythonEnvironment`]. Otherwise, gets or creates a [`CachedEnvironment`]. +#[allow(clippy::fn_params_excessive_bools)] async fn get_or_create_environment( target: &Target<'_>, with: &[RequirementsSource], @@ -404,6 +408,7 @@ async fn get_or_create_environment( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> Result<(Requirement, PythonEnvironment), ProjectError> { let client_builder = BaseClientBuilder::new() .connectivity(connectivity) @@ -582,6 +587,7 @@ async fn get_or_create_environment( native_tls, cache, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/commands/tool/upgrade.rs b/crates/uv/src/commands/tool/upgrade.rs index e575a341ef72..db076057fdb0 100644 --- a/crates/uv/src/commands/tool/upgrade.rs +++ b/crates/uv/src/commands/tool/upgrade.rs @@ -42,6 +42,7 @@ pub(crate) async fn upgrade( native_tls: bool, cache: &Cache, printer: Printer, + extra_dist_info: bool, ) -> Result { let installed_tools = InstalledTools::from_settings()?.init()?; let _lock = installed_tools.lock().await?; @@ -110,6 +111,7 @@ pub(crate) async fn upgrade( connectivity, concurrency, native_tls, + extra_dist_info, ) .await; @@ -197,6 +199,7 @@ async fn upgrade_tool( connectivity: Connectivity, concurrency: Concurrency, native_tls: bool, + extra_dist_info: bool, ) -> Result { // Ensure the tool is installed. let existing_tool_receipt = match installed_tools.get_tool_receipt(name) { @@ -286,6 +289,7 @@ async fn upgrade_tool( native_tls, cache, printer, + extra_dist_info, ) .await?; @@ -309,6 +313,7 @@ async fn upgrade_tool( native_tls, cache, printer, + extra_dist_info, ) .await?; diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index aa28abbbf811..14e02d6e9341 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -443,6 +443,7 @@ async fn run(mut cli: Cli) -> Result { cache, args.dry_run, printer, + globals.extra_dist_info, ) .await } @@ -531,6 +532,7 @@ async fn run(mut cli: Cli) -> Result { cache, args.dry_run, printer, + globals.extra_dist_info, ) .await } @@ -912,6 +914,7 @@ async fn run(mut cli: Cli) -> Result { globals.native_tls, cache, printer, + globals.extra_dist_info, ) .await } @@ -961,6 +964,7 @@ async fn run(mut cli: Cli) -> Result { globals.native_tls, cache, printer, + globals.extra_dist_info, )) .await } @@ -1004,6 +1008,7 @@ async fn run(mut cli: Cli) -> Result { globals.native_tls, &cache, printer, + globals.extra_dist_info, )) .await } @@ -1333,6 +1338,7 @@ async fn run_project( printer, args.env_file, args.no_env_file, + globals.extra_dist_info, )) .await } @@ -1368,6 +1374,7 @@ async fn run_project( globals.native_tls, &cache, printer, + globals.extra_dist_info, ) .await } @@ -1447,6 +1454,7 @@ async fn run_project( globals.native_tls, &cache, printer, + globals.extra_dist_info, )) .await } @@ -1487,6 +1495,7 @@ async fn run_project( globals.native_tls, &cache, printer, + globals.extra_dist_info, ) .await } diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index e8de6a339cca..1bbb9c6bbe4b 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -60,6 +60,7 @@ pub(crate) struct GlobalSettings { pub(crate) python_preference: PythonPreference, pub(crate) python_downloads: PythonDownloads, pub(crate) no_progress: bool, + pub(crate) extra_dist_info: bool, } impl GlobalSettings { @@ -128,6 +129,7 @@ impl GlobalSettings { .combine(workspace.and_then(|workspace| workspace.globals.python_downloads)) .unwrap_or_default(), no_progress: args.no_progress, + extra_dist_info: !env(env::NO_EXTRA_DIST_INFO).unwrap_or(false), } } } @@ -2718,6 +2720,9 @@ mod env { EnvVars::UV_PYTHON_DOWNLOADS, "one of 'auto', 'true', 'manual', 'never', or 'false'", ); + + pub(super) const NO_EXTRA_DIST_INFO: (&str, &str) = + (EnvVars::UV_NO_EXTRA_DIST_INFO, "either 'true' or 'false'"); } /// Attempt to load and parse an environment variable with the given name. diff --git a/crates/uv/tests/it/pip_install.rs b/crates/uv/tests/it/pip_install.rs index 1862e80e7759..0c8a61077347 100644 --- a/crates/uv/tests/it/pip_install.rs +++ b/crates/uv/tests/it/pip_install.rs @@ -7307,3 +7307,35 @@ fn sklearn() { "# ); } + +/// Ensure that `UV_NO_EXTRA_DIST_INFO` env var is respected. +#[test] +fn respect_no_extra_dist_info_env_var() { + let context = TestContext::new("3.12"); + + // Install urllib3. + uv_snapshot!(context.pip_install() + .arg("urllib3==2.2.1") + .arg("--strict") + .env(EnvVars::UV_NO_EXTRA_DIST_INFO, "true"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + + ----- stderr ----- + Resolved 1 package in [TIME] + Prepared 1 package in [TIME] + Installed 1 package in [TIME] + + urllib3==2.2.1 + "### + ); + + context.assert_command("import urllib3").success(); + + // Assert INSTALLER file was _not_ created. + let installer_file = context + .site_packages() + .join("urllib3-2.2.3.dist-info") + .join("INSTALLER"); + assert!(!installer_file.exists()); +} diff --git a/crates/uv/tests/it/show_settings.rs b/crates/uv/tests/it/show_settings.rs index 4275db0ac491..9f712bf2737a 100644 --- a/crates/uv/tests/it/show_settings.rs +++ b/crates/uv/tests/it/show_settings.rs @@ -59,6 +59,7 @@ fn resolve_uv_toml() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -206,6 +207,7 @@ fn resolve_uv_toml() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -354,6 +356,7 @@ fn resolve_uv_toml() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -534,6 +537,7 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -683,6 +687,7 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -812,6 +817,7 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -984,6 +990,7 @@ fn resolve_index_url() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -1161,6 +1168,7 @@ fn resolve_index_url() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -1391,6 +1399,7 @@ fn resolve_find_links() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -1562,6 +1571,7 @@ fn resolve_top_level() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -1697,6 +1707,7 @@ fn resolve_top_level() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -1872,6 +1883,7 @@ fn resolve_top_level() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -2071,6 +2083,7 @@ fn resolve_user_configuration() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -2196,6 +2209,7 @@ fn resolve_user_configuration() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -2321,6 +2335,7 @@ fn resolve_user_configuration() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -2448,6 +2463,7 @@ fn resolve_user_configuration() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -2594,6 +2610,7 @@ fn resolve_tool() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -2752,6 +2769,7 @@ fn resolve_poetry_toml() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -2905,6 +2923,7 @@ fn resolve_both() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -3079,6 +3098,7 @@ fn resolve_config_file() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -3327,6 +3347,7 @@ fn resolve_skip_empty() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -3455,6 +3476,7 @@ fn resolve_skip_empty() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -3591,6 +3613,7 @@ fn allow_insecure_host() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -3741,6 +3764,7 @@ fn index_priority() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -3918,6 +3942,7 @@ fn index_priority() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -4101,6 +4126,7 @@ fn index_priority() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -4279,6 +4305,7 @@ fn index_priority() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -4464,6 +4491,7 @@ fn index_priority() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, @@ -4642,6 +4670,7 @@ fn index_priority() -> anyhow::Result<()> { python_preference: Managed, python_downloads: Automatic, no_progress: false, + extra_dist_info: true, } CacheSettings { no_cache: false, diff --git a/docs/configuration/environment.md b/docs/configuration/environment.md index 06002d38780b..cc60ff312656 100644 --- a/docs/configuration/environment.md +++ b/docs/configuration/environment.md @@ -176,3 +176,4 @@ uv respects the following environment variables: for more. - [`UV_ENV_FILE`](#UV_ENV_FILE): `.env` files from which to load environment variables when executing `uv run` commands. - [`UV_NO_ENV_FILE`](#UV_NO_ENV_FILE): Ignore `.env` files when executing `uv run` commands. +- [`UV_NO_EXTRA_DIST_INFO`](#UV_NO_EXTRA_DIST_INFO): Skip writing `uv` cache & installer files to site-packages dist-info.