Skip to content

feat(cli): migrate flow command to cyclopts (wave 3a)#20672

Draft
zzstoatzz wants to merge 1 commit intomainfrom
cli-cyclopts/wave-3a
Draft

feat(cli): migrate flow command to cyclopts (wave 3a)#20672
zzstoatzz wants to merge 1 commit intomainfrom
cli-cyclopts/wave-3a

Conversation

@zzstoatzz
Copy link
Collaborator

Native cyclopts implementation of flow ls and flow serve, replacing the delegation stub that forwarded to typer.

What changed

  • New: src/prefect/cli/_cyclopts/flow.py — native ls and serve commands with deferred imports
  • Wiring: replaced delegated stub in _cyclopts/__init__.py with native import, removed "flow" from _DELEGATED_COMMANDS, added to _CYCLOPTS_COMMANDS
  • Tests: mock_runner_start fixture patches Runner.start on the class directly (works for both import paths); test_flow_serve_cli_requires_entrypoint handles different framework error messages/codes
  • Gotcha: flow_app uses version_flags=[] to prevent cyclopts from intercepting --version 1.0.0 in flow serve

Test plan

  • uv run pytest tests/cli/test_flow.py — 7 passed (typer)
  • PREFECT_CLI_FAST=1 uv run pytest tests/cli/test_flow.py — 7 passed (cyclopts)
  • uv run pytest tests/cli/test_cyclopts_parity.py — 18 passed
  • ruff clean

🤖 Generated with Claude Code

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 13, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing cli-cyclopts/wave-3a (43a7ad0) with main (5b81df1)

Open in CodSpeed

@zzstoatzz zzstoatzz force-pushed the cli-cyclopts/wave-3a branch 2 times, most recently from 8547753 to e3fcc07 Compare February 13, 2026 23:17
Native cyclopts implementation of `flow ls` and `flow serve` with
deferred imports for all heavy dependencies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zzstoatzz zzstoatzz force-pushed the cli-cyclopts/wave-3a branch from e3fcc07 to 43a7ad0 Compare February 13, 2026 23:52
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.

1 participant