Skip to content

feat(cli): require cyclopts v5 - #64

Merged
tsvikas merged 1 commit into
mainfrom
cyclopts-v5
Sep 27, 2026
Merged

tsvikas merged 1 commit into
mainfrom
cyclopts-v5

Conversation

@tsvikas

@tsvikas tsvikas commented Sep 27, 2026

Copy link
Copy Markdown
Owner

Cyclopts 5.0.0 now exits 2 on usage errors itself (BrianPugh/cyclopts#874). The template's cyclopts CLI no longer needs its own workaround.

Changes

  • pyproject.toml.jinja: cyclopts >=4 → cyclopts >=5.
  • cli.py.jinja: removed exit_on_error=False and the except CycloptsError: sys.exit(EX_USAGE) clause. Also removed EX_USAGE, because nothing uses it now. The main() wrapper that maps uncaught exceptions to sysexits codes stays: upstream declared that part out of scope in Feature request: exit 70 rather than 1 on an uncaught exception BrianPugh/cyclopts#875.
  • test_cli.py.jinja: asserts exit code 2 directly, with the convention explained in a comment.
  • copier.yml: cyclopts 5 needs Python >=3.11 (3.10 reaches end of life in Oct 2026). python_min now defaults to 11, and a validator on cli_framework rejects cyclopts when python_min < 11.

Verification

  • Rendered the cyclopts variant from HEAD. The generated pyproject.toml has requires-python >=3.11 and cyclopts >=5.
  • just test and just test-lowest 3.11 in the generated project: all tests pass (the lowest-deps run resolves to cyclopts 5.0.0).
  • Ran delorian-car --bogus: it prints the cyclopts error panel and exits with code 2.
  • The validator rejects python_min=10 together with cli_framework=cyclopts.

Known unrelated failures, also on main

  • just test (ctt) fails in just init: detect-secrets flags the random /tmp/.../ctt-src-* _src_path in .copier-answers.yml. copier-template-tester 3.0.0 renders from a temp copy.
  • zizmor 1.30.1 adds a self-repository audit that flags uses: ./.github/workflows/ci.yml in build-and-publish.yml.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GyMoD8tx4oz1bpJ1tEL845

sourcery-ai[bot]
sourcery-ai Bot previously approved these changes Sep 27, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@sourcery-ai
sourcery-ai Bot dismissed their stale review September 27, 2026 12:10

Sourcery withdrew this approval because the latest commits introduced blocking findings.

Cyclopts 5 exits 2 on usage errors itself (BrianPugh/cyclopts#874), so
drop the `exit_on_error=False` / `except CycloptsError` workaround and
the now-unused EX_USAGE constant.

Cyclopts 5 needs Python >=3.11, so default python_min to 11 and reject
cyclopts with python_min < 11.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01GyMoD8tx4oz1bpJ1tEL845
@tsvikas
tsvikas merged commit ee1aa04 into main Sep 27, 2026
5 checks passed
@tsvikas
tsvikas deleted the cyclopts-v5 branch September 27, 2026 12:17
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