Skip to content

refactor(cyclopts): take the tokens to parse as an argument - #63

Merged
tsvikas merged 2 commits into
mainfrom
claude/cyclopts-recipe-verify-23evr3
Aug 10, 2026
Merged

refactor(cyclopts): take the tokens to parse as an argument#63
tsvikas merged 2 commits into
mainfrom
claude/cyclopts-recipe-verify-23evr3

Conversation

@tsvikas

@tsvikas tsvikas commented Aug 10, 2026

Copy link
Copy Markdown
Owner

main() read sys.argv[1:] itself, so a test had to monkeypatch
sys.argv to reach it. tokens defaults to None, which cyclopts already
resolves to sys.argv[1:], so the entry point is unaffected. This is the
shape the upstream recipe settled on in BrianPugh/cyclopts#875.

The unhandled-error test stubbed app with a keyword-only signature, so
the call raised TypeError over the signature rather than the RuntimeError
the test is about. Both exit 70, so it passed either way.

The CycloptsError clause now records that cyclopts >=5 exits 2 on parse
errors by itself, per BrianPugh/cyclopts#874, so it and
exit_on_error=False can both go once the dependency requires it.

Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01AHLfbxCaEcA1NzUEHCHPpK

`main()` read `sys.argv[1:]` itself, so a test had to monkeypatch
`sys.argv` to reach it. `tokens` defaults to None, which cyclopts already
resolves to `sys.argv[1:]`, so the entry point is unaffected. This is the
shape the upstream recipe settled on in BrianPugh/cyclopts#875.

The unhandled-error test stubbed `app` with a keyword-only signature, so
the call raised TypeError over the signature rather than the RuntimeError
the test is about. Both exit 70, so it passed either way.

The `CycloptsError` clause now records that cyclopts >=5 exits 2 on parse
errors by itself, per BrianPugh/cyclopts#874, so it and
`exit_on_error=False` can both go once the dependency requires it.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AHLfbxCaEcA1NzUEHCHPpK

@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 is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@tsvikas
tsvikas merged commit 046590d into main Aug 10, 2026
4 of 5 checks passed
@tsvikas
tsvikas deleted the claude/cyclopts-recipe-verify-23evr3 branch August 10, 2026 10:43
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.

2 participants