@@ -68,6 +68,7 @@ def _create_whl_repos(
68
68
pip_attr ,
69
69
whl_overrides ,
70
70
simpleapi_cache ,
71
+ whl_mods ,
71
72
available_interpreters = INTERPRETER_LABELS ,
72
73
simpleapi_download = simpleapi_download ):
73
74
"""create all of the whl repositories
@@ -104,6 +105,7 @@ def _create_whl_repos(
104
105
# containers to aggregate outputs from this function
105
106
whl_map = {}
106
107
exposed_packages = {}
108
+ extra_aliases = {}
107
109
whl_libraries = {}
108
110
109
111
# if we do not have the python_interpreter set in the attributes
@@ -138,6 +140,14 @@ def _create_whl_repos(
138
140
for mod , whl_name in pip_attr .whl_modifications .items ():
139
141
whl_modifications [normalize_name (whl_name )] = mod
140
142
143
+ annotation = json .decode (module_ctx .read (mod ))
144
+ if annotation .additive_build_content :
145
+ extra_aliases .setdefault (whl_name , {}).update ({
146
+ line .partition ("name = " )[- 1 ].strip ("\" '," ): True
147
+ for line in annotation .build_content .split ("\n " )
148
+ if line .lstrip ().beginswith ("name = " )
149
+ })
150
+
141
151
if pip_attr .experimental_requirement_cycles :
142
152
requirement_cycles = {
143
153
name : [normalize_name (whl_name ) for whl_name in whls ]
@@ -349,6 +359,7 @@ def _create_whl_repos(
349
359
is_reproducible = is_reproducible ,
350
360
whl_map = whl_map ,
351
361
exposed_packages = exposed_packages ,
362
+ extra_aliases = extra_aliases ,
352
363
whl_libraries = whl_libraries ,
353
364
)
354
365
@@ -433,6 +444,7 @@ You cannot use both the additive_build_content and additive_build_content_file a
433
444
hub_whl_map = {}
434
445
hub_group_map = {}
435
446
exposed_packages = {}
447
+ extra_aliases = {}
436
448
whl_libraries = {}
437
449
438
450
is_reproducible = True
@@ -477,11 +489,15 @@ You cannot use both the additive_build_content and additive_build_content_file a
477
489
pip_attr = pip_attr ,
478
490
simpleapi_cache = simpleapi_cache ,
479
491
whl_overrides = whl_overrides ,
492
+ whl_mods = whl_mods ,
480
493
** kwargs
481
494
)
482
495
hub_whl_map .setdefault (hub_name , {})
483
496
for key , settings in out .whl_map .items ():
484
497
hub_whl_map [hub_name ].setdefault (key , []).extend (settings )
498
+ extra_aliases .setdefault (hub_name , {})
499
+ for whl_name , extra_aliases in out .extra_aliases .items ():
500
+ extra_aliases [hub_name ].setdefault (whl_name , {}).update (extra_aliases )
485
501
exposed_packages .setdefault (hub_name , {}).update (out .exposed_packages )
486
502
whl_libraries .update (out .whl_libraries )
487
503
is_reproducible = is_reproducible and out .is_reproducible
@@ -510,6 +526,13 @@ You cannot use both the additive_build_content and additive_build_content_file a
510
526
for hub_name , group_map in sorted (hub_group_map .items ())
511
527
},
512
528
exposed_packages = {k : sorted (v ) for k , v in sorted (exposed_packages .items ())},
529
+ extra_aliases = {
530
+ hub_name : {
531
+ whl_name : sorted (aliases )
532
+ for whl_name , aliases in extra_whl_aliases .items ()
533
+ }
534
+ for hub_name , extra_whl_aliases in extra_aliases .items ()
535
+ },
513
536
whl_libraries = dict (sorted (whl_libraries .items ())),
514
537
is_reproducible = is_reproducible ,
515
538
)
0 commit comments