Skip to content

fix(cli-hub): uninstall the registered pip distribution - #727

Open
bryanbans wants to merge 1 commit into
HKUDS:mainfrom
bryanbans:fix/hub-pip-package-uninstall
Open

bryanbans wants to merge 1 commit into
HKUDS:mainfrom
bryanbans:fix/hub-pip-package-uninstall

Conversation

@bryanbans

Copy link
Copy Markdown

Description

Fixes #726.

cli-hub uninstall cc-switch derives cli-anything-cc-switch, but CC Switch's setup.py declares cli-anything-ccswitch. Pip exits 0 for the absent derived name, so the hub claims success and removes tracking while leaving the package installed.

Allow an optional pip_package override, register CC Switch's actual distribution, and document the field. Other pip harnesses retain the existing name convention. CLI-Hub's package/runtime versions advance together to 0.4.2.

Type of Change

  • New Software CLI (in-repo)
  • New Software CLI (standalone repo)
  • New Feature
  • Bug Fix
  • Documentation
  • Other

New-software checklists: not applicable; this modifies CLI-Hub's existing installer.

For Existing CLI Modifications

  • All affected installer tests pass (12 tests).
  • Real wheel uninstall verified in an isolated venv, described below.
  • No test regressions — the full suite has the identical 21 existing failures on unchanged main and this branch.
  • Registry metadata updated with CC Switch's distribution name; its harness version is unchanged because its code is unchanged.

General Checklist

  • Code follows existing patterns and conventions.
  • Existing output contracts retained; no new commands or flags.
  • Commit message follows the conventional format.
  • Changes tested locally.

Test Results

Windows, Python 3.12. Three regression tests cover the real registry entry, conventional distribution names, and preserving tracking after a pip failure. On the old implementation: 2 failed, 1 passed. After the fix:

PYTHONPATH=cli-hub python -m pytest cli-hub/tests/test_pip_package.py cli-hub/tests/test_cli_hub.py::TestInstaller -q
12 passed

Built the actual CC Switch wheel from this repo and installed it with --no-deps --no-index in a disposable venv. The old pip uninstall command exited 0 but importlib.metadata still found version 1.0.0. The corrected public uninstall_cli("cc-switch") removed the actual distribution and its tracking entry.

Existing full-suite failures

Unchanged main (34f5195): 21 failed, 143 passed
This branch:             21 failed, 146 passed

Compared the failing test identifiers: all 21 are identical. They concern existing preview/Windows path rendering and analytics expectations. The complete suite is therefore not green in this environment; no existing tests were removed or weakened. CLI-Hub has no separate test_full_e2e.py. git diff --check passes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-26T02:02:23.265449Z c06d294 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the cli-anything-hub Changes CLI-Hub, registries, or hub docs label Nov 26, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cli-anything-hub Changes CLI-Hub, registries, or hub docs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: cli-hub uninstall cc-switch reports success but leaves the package installed

1 participant