Skip to content

Commit b53073a

Browse files
committed
simplify
1 parent 66a102a commit b53073a

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

python/versions.bzl

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -762,26 +762,28 @@ def get_release_info(platform, python_version, base_url = DEFAULT_RELEASE_BASE_U
762762
rendered_urls = []
763763
for u in url:
764764
p, _, _ = platform.partition("-freethreaded")
765+
765766
if "freethreaded" in platform:
766-
build = {
767-
"aarch64-apple-darwin": "freethreaded+pgo+lto-full",
768-
"aarch64-unknown-linux-gnu": "freethreaded+lto-full",
769-
"ppc64le-unknown-linux-gnu": "freethreaded+lto-full",
770-
"s390x-unknown-linux-gnu": "freethreaded+lto-full",
771-
"x86_64-apple-darwin": "freethreaded+pgo+lto-full",
772-
"x86_64-pc-windows-msvc": "shared-freethreaded+pgo-full",
773-
"x86_64-unknown-linux-gnu": "freethreaded+pgo+lto-full",
774-
}[p]
775-
ext = "tar.zst"
767+
build = "freethreaded+{}-full".format({
768+
"aarch64-apple-darwin": "pgo+lto",
769+
"aarch64-unknown-linux-gnu": "lto",
770+
"ppc64le-unknown-linux-gnu": "lto",
771+
"s390x-unknown-linux-gnu": "lto",
772+
"x86_64-apple-darwin": "pgo+lto",
773+
"x86_64-pc-windows-msvc": "pgo",
774+
"x86_64-unknown-linux-gnu": "pgo+lto",
775+
}[p])
776776
else:
777-
build = "shared-install_only" if (WINDOWS_NAME in platform) else "install_only"
778-
ext = "tar.gz"
777+
build = "install_only"
778+
779+
if WINDOWS_NAME in platform:
780+
build = "shared-" + build
779781

780782
release_filename = u.format(
781783
platform = p,
782784
python_version = python_version,
783785
build = build,
784-
ext = ext,
786+
ext = "tar.zst" if build.endswith("full") else "tar.gz",
785787
)
786788
if "://" in release_filename: # is absolute url?
787789
rendered_urls.append(release_filename)

0 commit comments

Comments
 (0)