Update dependency cyclopts to v4 #89
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.*->==4.5.*Release Notes
BrianPugh/cyclopts (cyclopts)
v4.5.1Compare Source
Bug Fixes
Parameterresolution when Optional by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/741Full Changelog: BrianPugh/cyclopts@v4.5.0...v4.5.1
v4.5.0Compare Source
Features
cyclopts.types.StdioPath. This type subclassespathlib.Path. If the special string-is supplied, then the object will read/write to stdin/stdout. Only available on python >=3.12 by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/737Full Changelog: BrianPugh/cyclopts@v4.4.6...v4.5.0
v4.4.6Compare Source
What's Changed
__cyclopts__(from using@Parameterdecorator on a class) after unwrappingAnnotatedby @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/736Full Changelog: BrianPugh/cyclopts@v4.4.5...v4.4.6
v4.4.5Compare Source
Bug Fixes
parse=Falseparameters for did-you-mean. by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/733Full Changelog: BrianPugh/cyclopts@v4.4.4...v4.4.5
v4.4.4Compare Source
Bug Fixes
pydantic.BaseModelcontainers by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/729Special Thanks to @AntoninRousset for very clear and organized bug reporting with minimal-working examples!
Full Changelog: BrianPugh/cyclopts@v4.4.3...v4.4.4
v4.4.3Compare Source
Bug Fixes
Place positive short flags after positive options, place negative short flags after negative options. By @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/721
Example python code:
Before:
After:
Full Changelog: BrianPugh/cyclopts@v4.4.2...v4.4.3
v4.4.2Compare Source
Bug Fixes
Full Changelog: BrianPugh/cyclopts@v4.4.1...v4.4.2
v4.4.1Compare Source
Bug Fixes
:in command names for shell completion by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/716Full Changelog: BrianPugh/cyclopts@v4.4.0...v4.4.1
v4.4.0Compare Source
Features
Parameter.parsenow accepts regex strings to filter which parameters are parsed. (#705)Parameter(parse="^(?!_)")— ignore "private" parameters starting with_UI Improvements
greet (g, greet-alias)instead ofgreet g greet-aliasBug Fixes
Groupobjects. (#710)Full Changelog: BrianPugh/cyclopts@v4.3.0...v4.4.0
v4.3.0Compare Source
Features
Paramter.n_tokensto control number of tokens consumed/provided to custom converters. by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/695@Parameter(...).Parameter.convertercan now be a string indicating a forward-reference to a classmethod in the class.Bug Fixes
collections.abc.Setby @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/703Full Changelog: BrianPugh/cyclopts@v4.2.5...v4.3.0
v4.2.5Compare Source
Bug Fixes
Full Changelog: BrianPugh/cyclopts@v4.2.4...v4.2.5
v4.2.4Compare Source
Features
ArgumentCollection.__contains__that allows for string-lookup of arguments. by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/689Bug Fixes
Full Changelog: BrianPugh/cyclopts@v4.2.3...v4.2.4
v4.2.3Compare Source
Bug Fixes
datetimeconverter to usedatetime.fromisoformatby @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/6872025-11-11T13Z(no minute, second or fractional second).Full Changelog: BrianPugh/cyclopts@v4.2.2...v4.2.3
v4.2.2Compare Source
Bug Fixes
@app.meta.meta)App.result_actiontype hint. by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/681Docs
Full Changelog: BrianPugh/cyclopts@v4.2.1...v4.2.2
v4.2.1Compare Source
Bug Fixes
TypeAliasType(python >=3.12). by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/670Full Changelog: BrianPugh/cyclopts@v4.2.0...v4.2.1
v4.2.0Compare Source
Features
App.result_action(composable) by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/663"call_if_callable"App.result_actionby @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/667dataclasses.field's new "doc" field by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/664Bug Fixes
list[Path](and similar) shell completions by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/661App.default_parameter) during completion generation. by @BrianPugh in https://github.com/BrianPugh/cyclopts/pull/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 #628╭─ Parameters ───────────────────────────────╮
│ * NAME [required] │
╰────────────────────────────────────────────╯
For more info, visit: https://cyclopts.readthedocs.io
Add GNU-style combined short options support by @BrianPugh in #639
-v -uroot → verbose=True, user="root"
-vuroot → verbose=True, user="root" (GNU-style combined)
-vu root → verbose=True, user="root"
Bug 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.Module only imported when command is executed
user_app.command("myapp.commands.users:create")
app.command(user_app)
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.