Skip to content

Commit 61557b6

Browse files
committed
Fix uninstall and add uninstall test
1 parent 296786f commit 61557b6

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

.github/workflows/build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,13 @@ jobs:
149149

150150
- name: 'Launch default runtime'
151151
run: pymanager exec -m site
152+
env:
153+
PYMANAGER_DEBUG: true
154+
155+
- name: 'Uninstall runtime'
156+
run: pymanager uninstall -y default
157+
env:
158+
PYMANAGER_DEBUG: true
152159

153160
- name: 'Emulate first launch'
154161
run: |

ci/release.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,14 @@ stages:
252252
- powershell: |
253253
pymanager exec -m site
254254
displayName: 'Launch default runtime'
255+
env:
256+
PYMANAGER_DEBUG: true
257+
258+
- powershell: |
259+
pymanager uninstall -y default
260+
displayName: 'Uninstall runtime'
261+
env:
262+
PYMANAGER_DEBUG: true
255263
256264
- powershell: |
257265
$i = (mkdir -force test_installs)

src/manage/uninstall_command.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ def execute(cmd):
2626
cmd.virtual_env = None
2727
installed = list(cmd.get_installs())
2828

29+
self.tags = []
30+
2931
if cmd.purge:
3032
if cmd.ask_yn("Uninstall all runtimes?"):
3133
for i in installed:
@@ -61,16 +63,18 @@ def execute(cmd):
6163
to_uninstall = []
6264
if not cmd.by_id:
6365
for tag in cmd.args:
64-
if tag.casefold() == "default".casefold():
65-
tag = cmd.default_tag
6666
try:
67-
t_or_r = tag_or_range(tag)
67+
if tag.casefold() == "default".casefold():
68+
self.tags.append(tag_or_range(cmd.default_tag))
69+
else:
70+
self.tags.append(tag_or_range(tag))
6871
except ValueError as ex:
6972
LOGGER.warn("%s", ex)
70-
continue
73+
74+
for tag in self.tags:
7175
candidates = get_matching_install_tags(
7276
installed,
73-
t_or_r,
77+
tag,
7478
default_platform=cmd.default_platform,
7579
)
7680
if not candidates:

0 commit comments

Comments
 (0)