Skip to content

Commit a6a7bec

Browse files
authored
Ensure uninstall_command has all required config. (#342)
Fixes #283
1 parent 25752d2 commit a6a7bec

3 files changed

Lines changed: 26 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ jobs:
140140
env:
141141
PYMANAGER_DEBUG: true
142142

143+
- name: 'Install additional runtimes'
144+
run: pymanager install 3.5 3.6 3.7 3.8 3.9
145+
env:
146+
PYMANAGER_DEBUG: true
147+
143148
- name: 'List installed runtimes'
144149
run: pymanager list
145150
env:

ci/release.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ stages:
251251
env:
252252
PYMANAGER_DEBUG: true
253253
254+
- powershell: |
255+
pymanager install 3.5 3.6 3.7 3.8 3.9
256+
displayName: 'Install additional runtimes'
257+
timeoutInMinutes: 10
258+
env:
259+
PYMANAGER_DEBUG: true
260+
254261
- powershell: |
255262
pymanager list
256263
displayName: 'List installed runtimes'

src/manage/commands.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,12 +902,25 @@ class UninstallCommand(BaseCommand):
902902
purge = False
903903
by_id = False
904904

905-
# Not settable, but are checked by update_all_shortcuts() so we need them.
905+
# Not directly settable, but will be copied from install configuration
906906
enable_shortcut_kinds = None
907907
disable_shortcut_kinds = None
908+
enable_entrypoints = True
909+
hard_link_entrypoints = True
908910

909911
def execute(self):
910912
from .uninstall_command import execute
913+
# Copy settings from install section of config
914+
for k in [
915+
"enable_shortcut_kinds",
916+
"disable_shortcut_kinds",
917+
"enable_entrypoints",
918+
"hard_link_entrypoints",
919+
]:
920+
v = self.config.get("install", {}).get(k, ...)
921+
if v is not ...:
922+
setattr(self, k, v)
923+
LOGGER.debug("Setting config %s to %s from install.%s", k, v, k)
911924
self.show_welcome()
912925
execute(self)
913926

0 commit comments

Comments
 (0)