fix(deps): update dependency cyclopts to v4 #1744
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.24.0->~=4.2.2Release Notes
BrianPugh/cyclopts (cyclopts)
v4.2.2Compare Source
Bug Fixes
@app.meta.meta)App.result_actiontype hint. by @BrianPugh in #681Docs
Full Changelog: BrianPugh/cyclopts@v4.2.1...v4.2.2
v4.2.1Compare Source
Bug Fixes
TypeAliasType(python >=3.12). by @BrianPugh in #670Full Changelog: BrianPugh/cyclopts@v4.2.0...v4.2.1
v4.2.0Compare Source
Features
App.result_action(composable) by @BrianPugh in #663"call_if_callable"App.result_actionby @BrianPugh in #667dataclasses.field's new "doc" field by @BrianPugh in #664Bug Fixes
list[Path](and similar) shell completions by @BrianPugh in #661App.default_parameter) during completion generation. by @BrianPugh in #662Internal
Full Changelog: BrianPugh/cyclopts@v4.1.0...v4.2.0
v4.1.0Compare Source
Features
Support
pydanticSecret-types (SecretStr,SecretBytes, etc) by @BrianPugh in #620Parameter.countforintcounting-flags (e.g., verbosity-vvv). by @BrianPugh in #622Add
App.help_epilogue, which prints a message at the bottom of the app's help-page. by @BrianPugh in #628Add help from dataclass/attrs metadata to the resolution hierarchy. by @BrianPugh in #642
Add GNU-style combined short options support by @BrianPugh in #639
More powerful
ArgumentCollection.__getitem__to support looking up by parameter name by @isoschiz in #635Bug Fixes
App.versionvalue instead of root-app version value. by @BrianPugh in #632MutuallyExclusivegroup validator accurately report the user-specified option name instead of the first positive name. by @BrianPugh in #634MissingArgumentErroraccurately report the user-specified option name instead of the first positive name. by @BrianPugh in #638Optional[bool]in the help-page. by @BrianPugh in #633--helpand--versionare passed to a subcommand.--helptakes precedence. by @BrianPugh in #650cyclopts.__version__not being updated (due to uv migration). by @BrianPugh in #657parse=FalsetoApp.version_printhandlers. by @BrianPugh in #656Special thanks to @isoschiz for thorough testing and bug reporting!
Documentation
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.0.0...v4.1.0
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.Shell Completion (supports bash, zsh, fish). Enable with
app.register_install_completion_command(), then users can install viamyapp --install-completion.cyclopts runCLI command.Help page customization via
help_formatterparameter onAppandGroup.HelpFormatterprotocol.DefaultFormatter(Rich-based with colors/borders) andPlainFormatter(accessibility-focused plain text).New
cycloptsCLI tool.cyclopts run- Execute a python script with dynamic shell-completion.cyclopts generate-docs- Generates documentation in a variety of formats (markdown, restructuredtext, html).cyclopts generate-docs myscript.py -o docs.mdSphinx Extension for automatically generating CLI documentation from your Cyclopts App.
.. cyclopts:: mypackage.cli:appdirective in your RST files.New
Appattributes; many of these were available asApp.__call__parameters, but now they can also be directly set onAppand are inherited as expected:print_error- Whether Cyclopts should print the rich-formatted error when aCycloptsErroris encountered. True by default.exit_on_error- If there is an error parsing/coercing the CLI tokens, invokesys.exit(1). True by default.help_on_error- If there is an error parsing/coercing the CLI tokens, print out the help-page for the parsed application. False by default.verbose- PopulateCycloptsErrorexception strings with more information intended for developers. False by default.flatten subapp's subcommands if named
"*". by @BrianPugh in #611Add support for
enum.Flagandenum.IntFlag.Add support for
datetime.datetype by @PerchunPak in #601Add
cyclopts.config.Dictconfig class for in-memory configuration sources. Add new keyword argumentsourceto config objects. by @BrianPugh in #599App.consolenow always resolves to aconsoleand respects the app-hierarchy. If a console is explicitly assigned, that console will always be used. This makes it easier to access aconsoleobject within commands.Improved parsing of JSON strings from the CLI. Can now handle
list[CustomClass]if each element is supplied as a JSON string.Optimized "happy execution path" performance.
If
App.sort_keyorGroup.sort_keyare generators, Cyclopts automatically invokesnexton them immediately.This allows for streamlined lexical ordering of commands using
itertools.count:Bug Fixes
list[int]) whenconsume_multiple=True.help_flagsafterend_of_options_delimiterby @BrianPugh in #609Internal / Developer
Configuration
📅 Schedule: Branch creation - "every weekend" in timezone US/Eastern, Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.