Skip to content

disable winml run and winml serve CLI commands#388

Merged
DingmaomaoBJTU merged 1 commit into
mainfrom
qiowu/disable_run_serve
Apr 24, 2026
Merged

disable winml run and winml serve CLI commands#388
DingmaomaoBJTU merged 1 commit into
mainfrom
qiowu/disable_run_serve

Conversation

@DingmaomaoBJTU

Copy link
Copy Markdown
Collaborator

Summary

  • Hide run and serve from CLI command discovery (winml --help)
  • Reject direct invocations (winml run ..., winml serve ...) with a clear "disabled" error message
  • Modules remain on disk — existing tests and internal imports (e.g. eval using serve/) are unaffected
  • Re-enabling is a one-line change: remove entries from _DISABLED_COMMANDS frozenset

🤖 Generated with Claude Code

Hide run/serve from command discovery and reject direct invocations
with a clear error message. Modules remain on disk for internal use.
@DingmaomaoBJTU DingmaomaoBJTU requested a review from a team as a code owner April 24, 2026 02:00
@DingmaomaoBJTU DingmaomaoBJTU merged commit de52b32 into main Apr 24, 2026
9 checks passed
@DingmaomaoBJTU DingmaomaoBJTU deleted the qiowu/disable_run_serve branch April 24, 2026 03:00
Comment thread src/winml/modelkit/cli.py
if cmd_name in _DISABLED_COMMANDS:
ctx.fail(
f"'winml {cmd_name}' is currently disabled. "
f"Use 'winml eval' for model evaluation instead."

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the help is not general for any _DISABLED_COMMANDS

Comment thread src/winml/modelkit/cli.py
# Commands that are temporarily disabled from the CLI surface.
# The modules remain on disk so tests and internal imports still work;
# they simply do not appear in ``winml --help`` or accept user invocations.
_DISABLED_COMMANDS: frozenset[str] = frozenset({"run", "serve"})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we add an envvar to enable it ?

ssss141414 pushed a commit that referenced this pull request Apr 27, 2026
## Summary
- Hide `run` and `serve` from CLI command discovery (`winml --help`)
- Reject direct invocations (`winml run ...`, `winml serve ...`) with a
clear "disabled" error message
- Modules remain on disk — existing tests and internal imports (e.g.
`eval` using `serve/`) are unaffected
- Re-enabling is a one-line change: remove entries from
`_DISABLED_COMMANDS` frozenset

🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants