File tree Expand file tree Collapse file tree 4 files changed +29
-13
lines changed Expand file tree Collapse file tree 4 files changed +29
-13
lines changed Original file line number Diff line number Diff line change @@ -319,14 +319,20 @@ core
319
319
An array of linking requirement maps. (See below for data format.)
320
320
321
321
extensions
322
- A map of extension names to a map describing the extension .
322
+ A map of extension names to an array of maps describing candidate extensions .
323
323
324
324
Extensions are non-core/non-essential parts of the Python distribution that
325
325
are frequently built as standalone entities.
326
326
327
327
Names in this map denote the name of the extension module.
328
328
329
- Values are maps with the following keys:
329
+ Values are arrays of maps. Each map represents a potential candidate
330
+ providing the extension. There is frequently only a single extension
331
+ candidate. Multiple candidates can occur if there are e.g. varying
332
+ libraries an extension can be linked against to supply underlying
333
+ functionality.
334
+
335
+ Each map has the following keys:
330
336
331
337
in_core
332
338
Boolean indicating if this extension is defined by the core distribution.
@@ -359,6 +365,11 @@ extensions
359
365
The path to a static library defining this extension module. May not
360
366
be defined.
361
367
368
+ variant
369
+ String describing this extension variant. Downstream consumers can key off
370
+ this value to choose an appropriate extension variant when there are
371
+ multiple options.
372
+
362
373
Each entry in a ``links `` array is a map with the following keys:
363
374
364
375
name
Original file line number Diff line number Diff line change @@ -481,12 +481,13 @@ def process_setup_line(line):
481
481
'system' : True ,
482
482
})
483
483
484
- bi ['extensions' ][extension ] = {
484
+ bi ['extensions' ][extension ] = [ {
485
485
'in_core' : False ,
486
486
'init_fn' : 'PyInit_%s' % extension ,
487
487
'links' : links ,
488
488
'objs' : objs ,
489
- }
489
+ 'variant' : 'default' ,
490
+ }]
490
491
491
492
492
493
found_start = False
@@ -516,12 +517,13 @@ def process_setup_line(line):
516
517
# can register their PyInit_ functions.
517
518
for name , init_fn in sorted (config_c_in .items ()):
518
519
log ('adding in-core extension %s' % name )
519
- bi ['extensions' ][name ] = {
520
+ bi ['extensions' ][name ] = [ {
520
521
'in_core' : True ,
521
522
'init_fn' : init_fn ,
522
523
'links' : [],
523
524
'objs' : [],
524
- }
525
+ 'variant' : 'default' ,
526
+ }]
525
527
526
528
# Any paths left in modules_objs are not part of any extension and are
527
529
# instead part of the core distribution.
Original file line number Diff line number Diff line change @@ -237,12 +237,13 @@ def process_setup_line(line):
237
237
'system' : True ,
238
238
})
239
239
240
- bi ['extensions' ][extension ] = {
240
+ bi ['extensions' ][extension ] = [ {
241
241
'in_core' : False ,
242
242
'init_fn' : 'PyInit_%s' % extension ,
243
243
'links' : links ,
244
244
'objs' : objs ,
245
- }
245
+ 'variant' : 'default' ,
246
+ }]
246
247
247
248
found_start = False
248
249
@@ -267,12 +268,13 @@ def process_setup_line(line):
267
268
268
269
for name , init_fn in sorted (config_c_in .items ()):
269
270
log ('adding in-core extension %s' % name )
270
- bi ['extensions' ][name ] = {
271
+ bi ['extensions' ][name ] = [ {
271
272
'in_core' : True ,
272
273
'init_fn' : init_fn ,
273
274
'links' : [],
274
275
'objs' : [],
275
- }
276
+ 'variant' : 'default' ,
277
+ }]
276
278
277
279
# Any paths left in modules_objs are not part of any extensions and
278
280
# are instead part of the core distribution.
Original file line number Diff line number Diff line change @@ -1170,13 +1170,14 @@ def find_additional_dependencies(project: pathlib.Path):
1170
1170
additional_depends = find_additional_dependencies (ext )
1171
1171
additional_depends -= CONVERT_TO_BUILTIN_EXTENSIONS .get (ext , {}).get ('ignore_additional_depends' , set ())
1172
1172
1173
- res ['extensions' ][ext ] = {
1173
+ res ['extensions' ][ext ] = [ {
1174
1174
'in_core' : False ,
1175
1175
'objs' : [],
1176
1176
'init_fn' : 'PyInit_%s' % ext ,
1177
1177
'static_lib' : None ,
1178
1178
'links' : [{'name' : n [:- 4 ], 'system' : True } for n in sorted (additional_depends )],
1179
- }
1179
+ 'variant' : 'default' ,
1180
+ }]
1180
1181
1181
1182
for obj in process_project (ext , dest_dir ):
1182
1183
res ['extensions' ][ext ]['objs' ].append ('build/extensions/%s/%s' % (ext , obj ))
@@ -1196,7 +1197,7 @@ def find_additional_dependencies(project: pathlib.Path):
1196
1197
# Copy the extension static library.
1197
1198
ext_static = outputs_path / ('%s.lib' % ext )
1198
1199
dest = dest_dir / ('%s.lib' % ext )
1199
- res ['extensions' ][ext ]['static_lib' ] = 'build/extensions/%s/%s.lib' % (ext , ext )
1200
+ res ['extensions' ][ext ][0 ][ 'static_lib' ] = 'build/extensions/%s/%s.lib' % (ext , ext )
1200
1201
log ('copying static extension %s' % ext_static )
1201
1202
shutil .copyfile (ext_static , dest )
1202
1203
You can’t perform that action at this time.
0 commit comments