gh-139810: Always generate -dev tags for PyManager packages (GH-139814)

This commit is contained in:
Steve Dower 2025-10-13 20:43:14 +01:00 committed by GitHub
parent 6481539a6d
commit c46265d94a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 10 deletions

View file

@ -0,0 +1,2 @@
Installing with ``py install 3[.x]-dev`` will now select final versions as
well as prereleases.

View file

@ -80,7 +80,9 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
# Tag used in runtime ID (for side-by-side install/updates) # Tag used in runtime ID (for side-by-side install/updates)
ID_TAG = XY_ARCH_TAG ID_TAG = XY_ARCH_TAG
# Tag shown in 'py list' output # Tag shown in 'py list' output.
# gh-139810: We only include '-dev' here for prereleases, even though it
# works for final releases too.
DISPLAY_TAG = f"{XY_TAG}-dev{TAG_ARCH}" if VER_SUFFIX else XY_ARCH_TAG DISPLAY_TAG = f"{XY_TAG}-dev{TAG_ARCH}" if VER_SUFFIX else XY_ARCH_TAG
# Tag used for PEP 514 registration # Tag used for PEP 514 registration
SYS_WINVER = XY_TAG + (TAG_ARCH if TAG_ARCH != '-64' else '') 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):
FULL_ARCH_TAG, FULL_ARCH_TAG,
XY_ARCH_TAG, XY_ARCH_TAG,
X_ARCH_TAG, X_ARCH_TAG,
# X_TAG and XY_TAG doesn't include VER_SUFFIX, so create -dev versions # gh-139810: The -dev tags are always included so that the latest
f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG and VER_SUFFIX else "", # release is chosen, no matter whether it's prerelease or final.
f"{X_TAG}-dev{TAG_ARCH}" if X_TAG and VER_SUFFIX else "", f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG else "",
f"{X_TAG}-dev{TAG_ARCH}" if X_TAG else "",
] ]
# Generate run-for entries for each target. # Generate run-for entries for each target.
@ -115,16 +118,15 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
]: ]:
if not base["target"]: if not base["target"]:
continue continue
STD_RUN_FOR.append({**base, "tag": FULL_ARCH_TAG}) STD_RUN_FOR.extend([
{**base, "tag": FULL_ARCH_TAG},
{**base, "tag": f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG else ""},
{**base, "tag": f"{X_TAG}-dev{TAG_ARCH}" if X_TAG else ""},
])
if XY_TAG: if XY_TAG:
STD_RUN_FOR.append({**base, "tag": XY_ARCH_TAG}) STD_RUN_FOR.append({**base, "tag": XY_ARCH_TAG})
if X_TAG: if X_TAG:
STD_RUN_FOR.append({**base, "tag": X_ARCH_TAG}) STD_RUN_FOR.append({**base, "tag": X_ARCH_TAG})
if VER_SUFFIX:
STD_RUN_FOR.extend([
{**base, "tag": f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG else ""},
{**base, "tag": f"{X_TAG}-dev{TAG_ARCH}" if X_TAG else ""},
])
# Generate alias entries for each target. We need both arch and non-arch # Generate alias entries for each target. We need both arch and non-arch
# versions as well as windowed/non-windowed versions to make sure that all # versions as well as windowed/non-windowed versions to make sure that all