@@ -66,6 +66,7 @@ class _PackageInfo(NamedTuple):
66
66
author : str
67
67
author_email : str
68
68
license : str
69
+ license_expression : str
69
70
entry_points : List [str ]
70
71
files : Optional [List [str ]]
71
72
@@ -161,6 +162,7 @@ def _get_requiring_packages(current_dist: BaseDistribution) -> Iterator[str]:
161
162
author = metadata .get ("Author" , "" ),
162
163
author_email = metadata .get ("Author-email" , "" ),
163
164
license = metadata .get ("License" , "" ),
165
+ license_expression = metadata .get ("License-Expression" , "" ),
164
166
entry_points = entry_points ,
165
167
files = files ,
166
168
)
@@ -180,13 +182,18 @@ def print_results(
180
182
if i > 0 :
181
183
write_output ("---" )
182
184
185
+ metadata_version_tuple = tuple (map (int , dist .metadata_version .split ("." )))
186
+
183
187
write_output ("Name: %s" , dist .name )
184
188
write_output ("Version: %s" , dist .version )
185
189
write_output ("Summary: %s" , dist .summary )
186
190
write_output ("Home-page: %s" , dist .homepage )
187
191
write_output ("Author: %s" , dist .author )
188
192
write_output ("Author-email: %s" , dist .author_email )
189
- write_output ("License: %s" , dist .license )
193
+ if metadata_version_tuple >= (2 , 4 ) and dist .license_expression :
194
+ write_output ("License-Expression: %s" , dist .license_expression )
195
+ else :
196
+ write_output ("License: %s" , dist .license )
190
197
write_output ("Location: %s" , dist .location )
191
198
if dist .editable_project_location is not None :
192
199
write_output (
0 commit comments