refactor(cyclopts): take the tokens to parse as an argument - #63
Merged
Conversation
`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
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.
main()readsys.argv[1:]itself, so a test had to monkeypatchsys.argvto reach it.tokensdefaults to None, which cyclopts alreadyresolves to
sys.argv[1:], so the entry point is unaffected. This is theshape the upstream recipe settled on in BrianPugh/cyclopts#875.
The unhandled-error test stubbed
appwith a keyword-only signature, sothe call raised TypeError over the signature rather than the RuntimeError
the test is about. Both exit 70, so it passed either way.
The
CycloptsErrorclause now records that cyclopts >=5 exits 2 on parseerrors by itself, per BrianPugh/cyclopts#874, so it and
exit_on_error=Falsecan both go once the dependency requires it.Co-Authored-By: Claude Opus 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01AHLfbxCaEcA1NzUEHCHPpK