mirror of
				https://github.com/astral-sh/uv.git
				synced 2025-10-31 12:06:13 +00:00 
			
		
		
		
	Use common routines for pip install and pip sync (#3737)
				
					
				
			## Summary This PR takes the functions used in `pip install`, moves them into a common module, and then replaces all the `pip sync` logic with calls into those functions. The net effect is that `pip install` and `pip sync` share far more code and demonstrate much more consistent behavior. Closes https://github.com/astral-sh/uv/issues/3555.
This commit is contained in:
		
							parent
							
								
									b8ef436c42
								
							
						
					
					
						commit
						0313e7d78b
					
				
					 14 changed files with 1078 additions and 1031 deletions
				
			
		|  | @ -139,7 +139,7 @@ impl Manifest { | |||
| 
 | ||||
|             // Include direct requirements, with constraints and overrides applied.
 | ||||
|             DependencyMode::Direct => Either::Right( | ||||
|                 self.overrides.apply(&   self.requirements) | ||||
|                 self.overrides.apply(&self.requirements) | ||||
|                 .chain(self.constraints.requirements()) | ||||
|                 .chain(self.overrides.requirements()) | ||||
|                 .filter(move |requirement| requirement.evaluate_markers(markers, &[]))), | ||||
|  | @ -210,4 +210,9 @@ impl Manifest { | |||
|     ) -> impl Iterator<Item = &Requirement> { | ||||
|         self.constraints.apply(self.overrides.apply(requirements)) | ||||
|     } | ||||
| 
 | ||||
|     /// Returns the number of input requirements.
 | ||||
|     pub fn num_requirements(&self) -> usize { | ||||
|         self.requirements.len() + self.editables.len() | ||||
|     } | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Charlie Marsh
						Charlie Marsh