@@ -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