Skip to content

Commit 06ec282

Browse files
committed
Separate default install tag from default launch tag.
This 'fixes' issues people have where they want prerelease installer but not prerelease Python. At 3.14's release, we'll remove the default config setting that installs 3-dev. Fixes #122
1 parent 2f864b7 commit 06ec282

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

src/manage/commands.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
# or check out the docs for administrative controls:
2323
# https://docs.python.org/using/windows
2424
DEFAULT_SOURCE_URL = "https://www.python.org/ftp/python/index-windows.json"
25-
DEFAULT_TAG = "3.14"
25+
DEFAULT_TAG = "3"
2626

2727

2828
# TODO: Remove the /dev/ for stable release
@@ -253,6 +253,7 @@ def execute(self):
253253
"fallback_source": (str, None, "env", "path", "uri"),
254254
"enable_shortcut_kinds": (str, config_split_append),
255255
"disable_shortcut_kinds": (str, config_split_append),
256+
"default_install_tag": (str, None),
256257
},
257258

258259
"first_run": {
@@ -792,6 +793,7 @@ class InstallCommand(BaseCommand):
792793
from_script = None
793794
enable_shortcut_kinds = None
794795
disable_shortcut_kinds = None
796+
default_install_tag = DEFAULT_TAG
795797

796798
def __init__(self, args, root=None):
797799
super().__init__(args, root)

src/manage/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ def resolve_config(cfg, source, relative_to, key_so_far="", schema=None, error_u
208208

209209
def merge_config(into_cfg, from_cfg, schema, *, source="<unknown>", overwrite=False):
210210
for k, v in from_cfg.items():
211+
if k.startswith("#"):
212+
continue
211213
try:
212214
into = into_cfg[k]
213215
except LookupError:

src/manage/install_command.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -604,16 +604,16 @@ def execute(cmd):
604604
if not cmd.by_id:
605605
for arg in cmd.args:
606606
if arg.casefold() == "default".casefold():
607-
LOGGER.debug("Replacing 'default' with '%s'", cmd.default_tag)
608-
cmd.tags.append(tag_or_range(cmd.default_tag))
607+
LOGGER.debug("Replacing 'default' with '%s'", cmd.default_install_tag)
608+
cmd.tags.append(tag_or_range(cmd.default_install_tag))
609609
else:
610610
try:
611611
cmd.tags.append(tag_or_range(arg))
612612
except ValueError as ex:
613613
LOGGER.warn("%s", ex)
614614

615615
if not cmd.tags and cmd.automatic:
616-
cmd.tags = [tag_or_range(cmd.default_tag)]
616+
cmd.tags = [tag_or_range(cmd.default_install_tag)]
617617
else:
618618
if cmd.from_script:
619619
raise ArgumentError("Cannot use --by-id and --from-script together")
@@ -629,9 +629,9 @@ def execute(cmd):
629629
try:
630630
tag = cmd.tags[0]
631631
except IndexError:
632-
if cmd.default_tag:
633-
LOGGER.debug("No tags provided, installing default tag %s", cmd.default_tag)
634-
tag = cmd.default_tag
632+
if cmd.default_install_tag:
633+
LOGGER.debug("No tags provided, installing default tag %s", cmd.default_install_tag)
634+
tag = cmd.default_install_tag
635635
else:
636636
LOGGER.debug("No tags provided, installing first runtime in feed")
637637
tag = None
@@ -671,7 +671,7 @@ def execute(cmd):
671671
if spec:
672672
cmd.tags.append(tag_or_range(spec))
673673
else:
674-
cmd.tags.append(tag_or_range(cmd.default_tag))
674+
cmd.tags.append(tag_or_range(cmd.default_install_tag))
675675

676676
if cmd.virtual_env:
677677
LOGGER.debug("Clearing virtual_env setting to avoid conflicts during install.")

src/pymanager.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
{
22
"install": {
33
"source": "%PYTHON_MANAGER_SOURCE_URL%",
4-
"fallback_source": "./bundled/fallback-index.json"
4+
"fallback_source": "./bundled/fallback-index.json",
5+
6+
"#": "Install 3.14 (prerelease) by default during prerelease PyManager",
7+
"default_install_tag": "3-dev"
58
},
69
"list": {
710
"format": "%PYTHON_MANAGER_LIST_FORMAT%"

0 commit comments

Comments
 (0)