Update dependency cyclopts to v4 #90
Open
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.
This PR contains the following updates:
==3.22.*->==4.0.*Release Notes
BrianPugh/cyclopts (cyclopts)
v4.0.0Compare Source
Cyclopts v4 represents a big feature update that makes it a no-compromise CLI python framework.
While Cyclopts v4 has a few breaking changes that generally make applications cleaner/terser/more intuitive, most shouldn't severely impact applications in the wild. This section lists the changes from most impactful to least.
Breaking Features / Breaking Changes / Migration
The default help/version formatting has been changed from RestructuredText to Markdown.
App(help_format="restructuredtext").Default behavior of
App.__call__andApp.run_asyncreturn value has changed. By default, these methods do not return and now perform asys.exit. This ensures that scripts and installed applications have consistent exit code behavior. Previously, a script might have had a different exit code compared to an equivalent installed package. This behavior can be controlled via the new attributeApp.result_action.To replicate the old behavior, set
result_action="return_value"in your root app.New App-inheritance mechanism/priorities. For most users this will have no impact, but pay attention if you use Meta Apps.
app.metainherits fromapp.Dropped Python 3.9 support. Python 3.9 EOL is October 31, 2025.
On the help page, the root application name falls back to the script name (instead of the registered
@app.defaultcommand name).If a dataclass-like parameter is annotated with
Parameter(name="*"), and all of its attributes are optional, but the parameter itself is not optional, aValueErrorwill now be raised. The value in the function signature must have a default value likeNone. See discussion in #519.InvalidCommandErrorhas been renamedUnknownCommandErrorfor consistency.Errors are now printed to stderr instead of stdout. Uses the new
App.error_console.If you want the old behavior (printing errors to stdout), set
error_consoleto a console writing to stdout:All
Parameterarguments exceptname(the only positional parameter) are now keyword-only.If only nameless
Groups are assigned to aParameter, the default Argument/Parameter group is still also applied. This is most convenient when applying a validator without impacting the help page.Features
Pure "value added" features.
Lazy loading - Commands can now be registered using import paths (e.g.,
"myapp.commands.users:create"), which defers module imports until the command is executed. This dramatically improves CLI startup time for applications with many commands or heavy dependencies.Module only imported when command is executed
user_app.command("myapp.commands.users:create")
app.command(user_app)
v3.24.0Compare Source
What's Changed
App.run_async, an asyncronous equivalent toApp.__call__. This allows users toawaitCyclopts within an async context (e.g. inside an async meta app). by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/539App.versionhandler by @gerlero @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/540New Contributors
Full Changelog: BrianPugh/cyclopts@v3.23.1...v3.24.0
v3.23.1Compare Source
Bug Fixes
negative_iterablewith an empty string shouldn't appear in the help screen by @nachocab in https://github.com/BrianPugh/cyclopts/pull/530Documentation
Full Changelog: BrianPugh/cyclopts@v3.23.0...v3.23.1
v3.23.0Compare Source
Features
NonExistent*convenience types by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/522Bug Fixes
show=False. by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/521Documentation
consume_multipledocumentation by @nachocab in https://github.com/BrianPugh/cyclopts/pull/517New Contributors
Full Changelog: BrianPugh/cyclopts@v3.22.5...v3.23.0
Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.