@@ -41,6 +41,8 @@ DEFAULT_RELEASE_BASE_URL = "https://github.com/indygreg/python-build-standalone/
41
41
# "strip_prefix": "python",
42
42
# },
43
43
#
44
+ # It is possible to provide lists in "url".
45
+ #
44
46
# buildifier: disable=unsorted-dict-items
45
47
TOOL_VERSIONS = {
46
48
"3.8.10" : {
@@ -281,19 +283,24 @@ def get_release_info(platform, python_version, base_url = DEFAULT_RELEASE_BASE_U
281
283
if type (url ) == type ({}):
282
284
url = url [platform ]
283
285
286
+ if type (url ) != type ([]):
287
+ url = [url ]
288
+
284
289
strip_prefix = tool_versions [python_version ].get ("strip_prefix" , None )
285
290
if type (strip_prefix ) == type ({}):
286
291
strip_prefix = strip_prefix [platform ]
287
292
288
- release_filename = url .format (
289
- platform = platform ,
290
- python_version = python_version ,
291
- build = "shared-install_only" if (WINDOWS_NAME in platform ) else "install_only" ,
292
- )
293
- if "://" in release_filename : # is absolute url?
294
- url = release_filename
295
- else :
296
- url = "/" .join ([base_url , release_filename ])
293
+ rendered_urls = []
294
+ for u in url :
295
+ release_filename = u .format (
296
+ platform = platform ,
297
+ python_version = python_version ,
298
+ build = "shared-install_only" if (WINDOWS_NAME in platform ) else "install_only" ,
299
+ )
300
+ if "://" in release_filename : # is absolute url?
301
+ rendered_urls .append (release_filename )
302
+ else :
303
+ rendered_urls .append ("/" .join ([base_url , release_filename ]))
297
304
298
305
patches = tool_versions [python_version ].get ("patches" , [])
299
306
if type (patches ) == type ({}):
@@ -302,7 +309,7 @@ def get_release_info(platform, python_version, base_url = DEFAULT_RELEASE_BASE_U
302
309
else :
303
310
patches = []
304
311
305
- return (release_filename , url , strip_prefix , patches )
312
+ return (release_filename , rendered_urls , strip_prefix , patches )
306
313
307
314
def print_toolchains_checksums (name ):
308
315
native .genrule (
@@ -333,10 +340,11 @@ def _commands_for_version(python_version):
333
340
"echo \" {python_version}: {platform}: $$(curl --location --fail {release_url_sha256} 2>/dev/null || curl --location --fail {release_url} 2>/dev/null | shasum -a 256 | awk '{{ print $$1 }}')\" " .format (
334
341
python_version = python_version ,
335
342
platform = platform ,
336
- release_url = get_release_info ( platform , python_version )[ 1 ] ,
337
- release_url_sha256 = get_release_info ( platform , python_version )[ 1 ] + ".sha256" ,
343
+ release_url = release_url ,
344
+ release_url_sha256 = release_url + ".sha256" ,
338
345
)
339
346
for platform in TOOL_VERSIONS [python_version ]["sha256" ].keys ()
347
+ for release_url in get_release_info (platform , python_version )[1 ]
340
348
])
341
349
342
350
def gen_python_config_settings (name = "" ):
0 commit comments