fix(clip_manager): retire argparse CLI in favor of corridorkey#236
Open
mountarreat wants to merge 1 commit intonikopueringer:mainfrom
Open
fix(clip_manager): retire argparse CLI in favor of corridorkey#236mountarreat wants to merge 1 commit intonikopueringer:mainfrom
mountarreat wants to merge 1 commit intonikopueringer:mainfrom
Conversation
`clip_manager.py` still shipped an argparse `__main__` block that predates the Typer migration in PR nikopueringer#67. The `wizard` action immediately raised `NotImplementedError("interactive_wizard is not yet implemented")` (`clip_manager.py:1046`) because the wizard implementation had already moved to `corridorkey_cli.py::interactive_wizard` in commit `e54abc8`. The other three actions (`list`, `generate_alphas`, `run_inference`) still worked but were redundant with the `corridorkey` console script defined by `pyproject.toml::[project.scripts]`. Meanwhile, `README.md` actively documented the stale invocations: uv run python clip_manager.py --action wizard --win_path "V:\..." uv run python clip_manager.py --action run_inference --device cpu uv run python clip_manager.py --action list 2>&1 | grep ... CORRIDORKEY_BACKEND=mlx uv run python clip_manager.py --action run_inference Any user following the README to invoke the wizard through `clip_manager.py` hit the NotImplementedError immediately. The README also had two `uv run python corridorkey_cli.py wizard --win_path ...` stanzas that combined a non-console-script invocation with flags that never existed on the Typer wizard (`--win_path` was an argparse artifact; the Typer wizard takes `path` as a positional argument). This commit: - Replaces the argparse `__main__` block in `clip_manager.py` (lines 1006-1046) with a short deprecation stub that prints a migration guide to stderr and exits non-zero (`sys.exit(2)`, matching argparse's own usage-error convention). Users with existing scripts or cron jobs that invoke `python clip_manager.py --action ...` now see a clear explanation and a one-to-one mapping to `corridorkey` subcommands instead of the old NotImplementedError. - Removes the now-unused `import argparse` from line 3. - Rewrites six README stanzas to use the `corridorkey` console script and the correct Typer syntax (positional `path`, `run-inference` with a hyphen, `--device` as a global flag before the subcommand, `--backend` only on `run-inference`). - Changes the backend override section header from "Override via CLI flag (corridorkey_cli.py)" to "Override via `--backend` flag (on `run-inference`)", so the section reflects reality (the flag is a `run-inference` option, not a global). Intentionally not changed: - `clip_manager.py` remains the pipeline/library module for `generate_alphas`, `run_inference`, `run_videomama`, `scan_clips`, etc. Only the script entry point is retired. - `docs/LLM_HANDOVER.md` prose still describes `clip_manager.py` as "the user-facing Command Line Wizard". That drift belongs to the separate documentation-consolidation work and is out of this PR's scope. Verified locally on Windows with Python 3.13.11: - `uv run ruff format --check`: clean - `uv run ruff check`: clean - `uv run pytest -q --tb=short -m "not gpu"`: 363 passed, 1 skipped (MLX), 4 deselected (GPU), 2 warnings. Same count as upstream. Both warnings are pre-existing (pytest `env` config warning addressed on a separate branch; torch autocast warning on a no-CUDA machine). - `uv run python clip_manager.py`: prints the migration guide to stderr, exits 2. - `uv run corridorkey --help`: exits 0.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
clip_manager.pystill shipped an argparse__main__block thatpredates the Typer migration in PR #67. The
wizardactionimmediately raised
NotImplementedError("interactive_wizard is not yet implemented")at
clip_manager.py:1046, because the wizard implementation hadalready moved to
corridorkey_cli.py::interactive_wizardincommit
e54abc8. The other three actions (list,generate_alphas,run_inference) still worked but wereredundant with the
corridorkeyconsole script.The
README.mdalso actively documented the stale invocations:Any user following the README to run the wizard through
clip_manager.pyhit the NotImplementedError immediately. TheREADME also had two
uv run python corridorkey_cli.py wizard --win_path ...stanzas that combined a non-console-scriptinvocation with flags that never existed on the Typer wizard
(
--win_pathwas an argparse artifact; the Typer wizard takespathas a positional argument).This PR:
__main__block inclip_manager.py(lines 1006-1046) with a small deprecation stub that prints
a migration guide to stderr and exits non-zero. Users with
existing scripts or cron jobs that invoke
python clip_manager.py --action ...now see a clearexplanation and a one-to-one mapping to
corridorkeysubcommands instead of the old NotImplementedError.
import argparsefrom line 3.README.mdstanzas to use thecorridorkeyconsole script and the correct Typer syntax."Override via CLI flag (corridorkey_cli.py)" to
"Override via
--backendflag (onrun-inference)", sothe section reflects reality (the flag is a
run-inferenceoption, not a global).
clip_manager.pyremains the pipeline/library module forgenerate_alphas,run_inference,run_videomama,scan_clips, etc. Only the script entry point is retired.docs/LLM_HANDOVER.mdprose still refers toclip_manager.pyas "the user-facing Command Line Wizard"; that drift belongs
to the broader documentation-consolidation work and is
deliberately out of scope for this PR.
How was it tested?
uv run ruff format --check: cleanuv run ruff check: cleanuv run pytest -q --tb=short -m "not gpu": 363 passed, 1skipped (MLX), 4 deselected (GPU), 2 warnings. Same count
as upstream. Both warnings are pre-existing on
mainandnot introduced here.
uv run python clip_manager.py: prints the migration guideto stderr, exits 2.
uv run corridorkey --help: exits 0.command cross-checked against
corridorkey_cli.pysource.Checklist
uv run pytestpassesuv run ruff checkpassesuv run ruff format --checkpasses