mirror of
				https://github.com/astral-sh/uv.git
				synced 2025-10-31 12:06:13 +00:00 
			
		
		
		
	Respect --no-build-isolation in uv add (#6368)
				
					
				
			## Summary We still had the default encoded here. Closes https://github.com/astral-sh/uv/issues/6367.
This commit is contained in:
		
							parent
							
								
									e7fb452552
								
							
						
					
					
						commit
						7fdd26c81f
					
				
					 1 changed files with 18 additions and 7 deletions
				
			
		|  | @ -3,12 +3,13 @@ use std::fmt::Write; | |||
| use std::path::{Path, PathBuf}; | ||||
| 
 | ||||
| use anyhow::{bail, Context, Result}; | ||||
| use cache_key::RepositoryUrl; | ||||
| use owo_colors::OwoColorize; | ||||
| use pep508_rs::{ExtraName, Requirement, VersionOrUrl}; | ||||
| use pypi_types::redact_git_credentials; | ||||
| use rustc_hash::{FxBuildHasher, FxHashMap}; | ||||
| use tracing::debug; | ||||
| 
 | ||||
| use cache_key::RepositoryUrl; | ||||
| use pep508_rs::{ExtraName, Requirement, VersionOrUrl}; | ||||
| use pypi_types::redact_git_credentials; | ||||
| use uv_auth::{store_credentials_from_url, Credentials}; | ||||
| use uv_cache::Cache; | ||||
| use uv_client::{BaseClientBuilder, Connectivity, FlatIndexClient, RegistryClientBuilder}; | ||||
|  | @ -235,7 +236,8 @@ pub(crate) async fn add( | |||
|     let python_version = None; | ||||
|     let python_platform = None; | ||||
|     let hasher = HashStrategy::default(); | ||||
|     let build_isolation = BuildIsolation::default(); | ||||
|     let build_constraints = []; | ||||
|     let sources = SourceStrategy::Enabled; | ||||
| 
 | ||||
|     // Determine the environment for the resolution.
 | ||||
|     let (tags, markers) = | ||||
|  | @ -254,6 +256,18 @@ pub(crate) async fn add( | |||
|         .platform(target.interpreter().platform()) | ||||
|         .build(); | ||||
| 
 | ||||
|     // Determine whether to enable build isolation.
 | ||||
|     let environment; | ||||
|     let build_isolation = if settings.no_build_isolation { | ||||
|         environment = PythonEnvironment::from_interpreter(target.interpreter().clone()); | ||||
|         BuildIsolation::Shared(&environment) | ||||
|     } else if settings.no_build_isolation_package.is_empty() { | ||||
|         BuildIsolation::Isolated | ||||
|     } else { | ||||
|         environment = PythonEnvironment::from_interpreter(target.interpreter().clone()); | ||||
|         BuildIsolation::SharedPackage(&environment, &settings.no_build_isolation_package) | ||||
|     }; | ||||
| 
 | ||||
|     // Initialize any shared state.
 | ||||
|     let state = SharedState::default(); | ||||
| 
 | ||||
|  | @ -264,9 +278,6 @@ pub(crate) async fn add( | |||
|         FlatIndex::from_entries(entries, Some(&tags), &hasher, &settings.build_options) | ||||
|     }; | ||||
| 
 | ||||
|     let build_constraints = []; | ||||
|     let sources = SourceStrategy::Enabled; | ||||
| 
 | ||||
|     // Create a build dispatch.
 | ||||
|     let build_dispatch = BuildDispatch::new( | ||||
|         &client, | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Charlie Marsh
						Charlie Marsh