Skip to content

Commit b6a9a6e

Browse files
[3.15] gh-159494: Fixes PyManager package filename creation for non-standard free-threaded packages (GH-160263) (GH-160345)
gh-159494: Fixes PyManager package filename creation for non-standard free-threaded packages (GH-160263) (cherry picked from commit ad101c3) Co-authored-by: Steve Dower <steve.dower@python.org>
1 parent c36d327 commit b6a9a6e

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

‎PC/layout/support/pymanager.py‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
4141
ALIAS_PREFIX = "python"
4242
ALIAS_WPREFIX = "pythonw"
4343
FILE_PREFIX = "python-"
44+
# Notice that FILE_SUFFIX may have more bits added to it below, and these
45+
# are sensitive to ordering (for compatibility), so don't change the order!
4446
FILE_SUFFIX = f"-{ns.arch}"
4547
DISPLAY_TAGS = [{
4648
"win32": "32-bit",
@@ -52,7 +54,7 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
5254
# Packages with the test suite come under a different Company
5355
COMPANY = "PythonTest"
5456
DISPLAY_TAGS.append("with tests")
55-
FILE_SUFFIX = f"-test-{ns.arch}"
57+
FILE_SUFFIX = f"-test{FILE_SUFFIX}"
5658
if for_embed:
5759
# Embeddable distro comes under a different Company
5860
COMPANY = "PythonEmbed"
@@ -62,15 +64,15 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
6264
DISPLAY_TAGS.append("embeddable")
6365
# Deliberately name the file differently from the existing distro
6466
# so we can republish old versions without replacing files.
65-
FILE_SUFFIX = f"-embeddable-{ns.arch}"
67+
FILE_SUFFIX = f"-embeddable{FILE_SUFFIX}"
6668
if ns.include_freethreaded:
6769
# Free-threaded distro comes with a tag suffix
6870
TAG_SUFFIX = "t"
6971
if not ns.include_alias:
7072
TARGET = f"python{VER_MAJOR}.{VER_MINOR}t.exe"
71-
TARGETW = f"pythonw{VER_MAJOR}.{VER_MINOR}t.exe"
73+
TARGETW = f"pythonw{VER_MAJOR}.{VER_MINOR}t.exe" if TARGETW else None
7274
DISPLAY_TAGS.append("free-threaded")
73-
FILE_SUFFIX = f"t-{ns.arch}"
75+
FILE_SUFFIX = f"t{FILE_SUFFIX}"
7476

7577
FULL_TAG = f"{VER_MAJOR}.{VER_MINOR}.{VER_MICRO}{VER_SUFFIX}{TAG_SUFFIX}"
7678
FULL_ARCH_TAG = f"{FULL_TAG}{TAG_ARCH}"

0 commit comments

Comments
 (0)