Skip to content

Commit e0d40e2

Browse files
zoobamiss-islington
authored andcommitted
pythongh-139810: Always generate -dev tags for PyManager packages (pythonGH-139814)
(cherry picked from commit c46265d) Co-authored-by: Steve Dower <[email protected]>
1 parent 5110780 commit e0d40e2

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Installing with ``py install 3[.x]-dev`` will now select final versions as
2+
well as prereleases.

PC/layout/support/pymanager.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
8080

8181
# Tag used in runtime ID (for side-by-side install/updates)
8282
ID_TAG = XY_ARCH_TAG
83-
# Tag shown in 'py list' output
83+
# Tag shown in 'py list' output.
84+
# gh-139810: We only include '-dev' here for prereleases, even though it
85+
# works for final releases too.
8486
DISPLAY_TAG = f"{XY_TAG}-dev{TAG_ARCH}" if VER_SUFFIX else XY_ARCH_TAG
8587
# Tag used for PEP 514 registration
8688
SYS_WINVER = XY_TAG + (TAG_ARCH if TAG_ARCH != '-64' else '')
@@ -102,9 +104,10 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
102104
FULL_ARCH_TAG,
103105
XY_ARCH_TAG,
104106
X_ARCH_TAG,
105-
# X_TAG and XY_TAG doesn't include VER_SUFFIX, so create -dev versions
106-
f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG and VER_SUFFIX else "",
107-
f"{X_TAG}-dev{TAG_ARCH}" if X_TAG and VER_SUFFIX else "",
107+
# gh-139810: The -dev tags are always included so that the latest
108+
# release is chosen, no matter whether it's prerelease or final.
109+
f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG else "",
110+
f"{X_TAG}-dev{TAG_ARCH}" if X_TAG else "",
108111
]
109112

110113
# Generate run-for entries for each target.
@@ -115,16 +118,15 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
115118
]:
116119
if not base["target"]:
117120
continue
118-
STD_RUN_FOR.append({**base, "tag": FULL_ARCH_TAG})
121+
STD_RUN_FOR.extend([
122+
{**base, "tag": FULL_ARCH_TAG},
123+
{**base, "tag": f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG else ""},
124+
{**base, "tag": f"{X_TAG}-dev{TAG_ARCH}" if X_TAG else ""},
125+
])
119126
if XY_TAG:
120127
STD_RUN_FOR.append({**base, "tag": XY_ARCH_TAG})
121128
if X_TAG:
122129
STD_RUN_FOR.append({**base, "tag": X_ARCH_TAG})
123-
if VER_SUFFIX:
124-
STD_RUN_FOR.extend([
125-
{**base, "tag": f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG else ""},
126-
{**base, "tag": f"{X_TAG}-dev{TAG_ARCH}" if X_TAG else ""},
127-
])
128130

129131
# Generate alias entries for each target. We need both arch and non-arch
130132
# versions as well as windowed/non-windowed versions to make sure that all

0 commit comments

Comments
 (0)