]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-139810: Always generate -dev tags for PyManager packages (GH-139814)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Mon, 13 Oct 2025 20:08:42 +0000 (22:08 +0200)
committerGitHub <noreply@github.com>
Mon, 13 Oct 2025 20:08:42 +0000 (20:08 +0000)
(cherry picked from commit c46265d94a2d2c5bcaabbbc312f8f6ac9162cd5f)

Co-authored-by: Steve Dower <steve.dower@python.org>
Misc/NEWS.d/next/Windows/2025-10-08-22-54-38.gh-issue-139810.LAaemi.rst [new file with mode: 0644]
PC/layout/support/pymanager.py

diff --git a/Misc/NEWS.d/next/Windows/2025-10-08-22-54-38.gh-issue-139810.LAaemi.rst b/Misc/NEWS.d/next/Windows/2025-10-08-22-54-38.gh-issue-139810.LAaemi.rst
new file mode 100644 (file)
index 0000000..55252f2
--- /dev/null
@@ -0,0 +1,2 @@
+Installing with ``py install 3[.x]-dev`` will now select final versions as
+well as prereleases.
index 667c89cdd2cc7a640750f8800af166ed8ca605b2..831d49ea3f9b46fe5c8937508b3de32c6bd7277c 100644 (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)
     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
     # Tag used for PEP 514 registration
     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,
         XY_ARCH_TAG,
         X_ARCH_TAG,
-        # X_TAG and XY_TAG doesn't include VER_SUFFIX, so create -dev versions
-        f"{XY_TAG}-dev{TAG_ARCH}" if XY_TAG and VER_SUFFIX else "",
-        f"{X_TAG}-dev{TAG_ARCH}" if X_TAG and VER_SUFFIX else "",
+        # gh-139810: The -dev tags are always included so that the latest
+        # release is chosen, no matter whether it's prerelease or final.
+        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.
@@ -115,16 +118,15 @@ def calculate_install_json(ns, *, for_embed=False, for_test=False):
     ]:
         if not base["target"]:
             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:
             STD_RUN_FOR.append({**base, "tag": XY_ARCH_TAG})
         if X_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
     # versions as well as windowed/non-windowed versions to make sure that all