mirror of
				https://github.com/astral-sh/uv.git
				synced 2025-10-31 12:06:13 +00:00 
			
		
		
		
	Use the proper singular form for workspace member dependencies in resolver errors (#6128)
This commit is contained in:
		
							parent
							
								
									db33497974
								
							
						
					
					
						commit
						fb6b3ff410
					
				
					 2 changed files with 11 additions and 2 deletions
				
			
		|  | @ -1058,6 +1058,15 @@ impl PackageRange<'_> { | |||
|     /// be singular or plural e.g. if false use "<range> depends on <...>" and
 | ||||
|     /// if true use "<range> depend on <...>"
 | ||||
|     fn plural(&self) -> bool { | ||||
|         // If a workspace member, always use the singular form (otherwise, it'd be "all versions of")
 | ||||
|         if self | ||||
|             .formatter | ||||
|             .and_then(|formatter| formatter.format_workspace_member(self.package)) | ||||
|             .is_some() | ||||
|         { | ||||
|             return false; | ||||
|         } | ||||
| 
 | ||||
|         let mut segments = self.range.iter(); | ||||
|         if let Some(segment) = segments.next() { | ||||
|             // A single unbounded compatibility segment is always plural ("all versions of").
 | ||||
|  |  | |||
|  | @ -1381,7 +1381,7 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_extra() -> Result<()> | |||
|     ----- stderr ----- | ||||
|     Using Python 3.12.[X] interpreter at: [PYTHON-3.12] | ||||
|       × No solution found when resolving dependencies: | ||||
|       ╰─▶ Because only bar is available and bar depends on anyio==4.2.0, we can conclude that bar depend on anyio==4.2.0. | ||||
|       ╰─▶ Because only bar is available and bar depends on anyio==4.2.0, we can conclude that bar depends on anyio==4.2.0. | ||||
|           And because foo depends on anyio==4.1.0, we can conclude that foo and bar are incompatible. | ||||
|           And because your workspace requires bar and foo, we can conclude that your workspace's requirements are unsatisfiable. | ||||
|     "###
 | ||||
|  | @ -1440,7 +1440,7 @@ fn workspace_unsatisfiable_member_dependencies_conflicting_dev() -> Result<()> { | |||
|     ----- stderr ----- | ||||
|     Using Python 3.12.[X] interpreter at: [PYTHON-3.12] | ||||
|       × No solution found when resolving dependencies: | ||||
|       ╰─▶ Because bar depends on bar and bar depends on anyio==4.2.0, we can conclude that bar depend on anyio==4.2.0. | ||||
|       ╰─▶ Because bar depends on bar and bar depends on anyio==4.2.0, we can conclude that bar depends on anyio==4.2.0. | ||||
|           And because foo depends on anyio==4.1.0, we can conclude that bar and foo are incompatible. | ||||
|           And because your workspace requires bar and foo, we can conclude that your workspace's requirements are unsatisfiable. | ||||
|     "###
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Zanie Blue
						Zanie Blue