Update dependency cyclopts to v5 - #22
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
renovate
Bot
force-pushed
the
renovate/cyclopts-5.x
branch
from
September 29, 2026 20:10
e477840 to
8253ac7
Compare
This branch has not been deployed
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.
This PR contains the following updates:
>=3.24,<4→>=5.1,<6Release Notes
BrianPugh/cyclopts (cyclopts)
v5.1.0Compare Source
Features
boolunion'd with other types.Full Changelog: BrianPugh/cyclopts@v5.0.0...v5.1.0
v5.0.0Compare Source
Check out the new "Migrating to v5" docs page, covering each intentional breaking change with before/after examples.
All v4 features up to 4.25.3 have been merged into this release.
Breaking
Dropped Python 3.10 support (Python 3.10 EoL is Oct 31, 2026) #889
Removed fuzzy command-matching. Command names must match exactly.
PascalCase→pascal-casename-transform change, retrying by stripping dashes/underscores on no exact match. Removed as cleanup for the major release.Fallthrough parsing: child wins. Previously a meta app claimed any keyword parameter it recognized regardless of token position — even after a subcommand, and even if the subcommand defined the same name. In v5 (default
parse_mode="fallthrough"), when both levels define the same name, the subcommand wins for tokens placed after it.Only placement after the subcommand changed. To reject parent-level parameters placed after a subcommand entirely, use
parse_mode="strict".Forwarded
*tokenspreserve the--delimiter. A forwarding meta's raw-stream capture parameter (*tokenswithallow_leading_hyphen=True) now keeps a user-typed end-of-options delimiter, so the re-parse insideapp(tokens)still treats the trailing tokens as positional.Wrappers that manually re-inserted
--as a workaround will now see it twice — remove the workaround. Leaf commands (that don't forward) are unchanged: the delimiter is consumed as a marker and never appears in bound values.A greedy
*argssubcommand claims all post-command tokens. A subcommand whose only positional parameter is*argswithallow_leading_hyphen=Truegenuinely claims every token after the command; meta parameters placed after such a subcommand no longer bubble up.Place meta parameters before the subcommand, or give the subcommand explicit keyword parameters instead of a catch-all.
User parameters shadow
--help/--version. A command may now define its own parameter named like an auto-registered help/version flag; the token binds to the user's parameter instead of triggering the handler, and the command's help page lists the user's parameter.Shadowing is per-flag (
--helpstill works when only--versionis shadowed), and commands taking**kwargsare NOT affected — they keep automatic--help/--version. If a command shadows--help, a--versiontoken in the same invocation triggers version printing (interception runs before binding).cyclopts tree:-dnow disables descriptions. Previously-dwas a positive alias for--description— a no-op, since descriptions are on by default. It is now a negative alias (equivalent to--no-description), as originally intended.Parse errors exit with code 2. CLI usage errors (unknown option, missing argument, coercion failure, ...) now exit with code
2, matching argparse and Click. Previously they exited with1, indistinguishable from a command that ran and reported failure (the defaultresult_actionmaps aFalsereturn to exit code1). Application-level exit codes and130for keyboard interrupts are unchanged.--versionrespects the--delimiter. A--versiontoken after the end-of-options delimiter is positional data, not a version request — matching how--helpalready behaved.result_actionnames are validated eagerly. An invalid action name now raises a descriptiveValueError(listing the valid actions) atAppconstruction, attribute assignment, or invocation-time override — before any command executes. Previously an invalid name was silently accepted and only raised a bare, message-lessValueErrorat result-handling time, after the command had already run.Features
App.parse_mode— hierarchical parameter scoping between meta apps and subcommands. Two modes:"fallthrough"(default): meta parameters may appear anywhere in the token stream; post-command tokens the subcommand leaves unconsumed bubble up to the meta. When both levels define the same flag, the child wins."strict": parameters bind only at the command level where they appear — Click/Typer-style scoping. A meta parameter placed after a subcommand is rejected with a scope-aware hint (Did you mean to place it directly after "myapp"?), and help pages exclude parent meta parameters at the child level. Shell completion respects both modes.parse_modeis inherited by subapps unless explicitly overridden. See the new "Parse Mode" docs page.Combined short options are resolved against the MERGED flag namespace of both levels — the person typing
myapp cmd -xvfdoesn't know which level implements each flag, so a single GNU left-to-right scan of the merged table routes each character to its owner (subcommand wins same-letter collisions; the first value-taking option absorbs the remainder or next token as its value; unknown characters are reported by the subcommand).Other cross-scope cases: a meta flag interleaved between a child option and its value binds at the meta while the child pairs its option with the value, and a meta option missing its value reports the real "requires an argument" error instead of a misleading "Unknown option".
Variable token-lengths within a
Union. Members that consume a different number of tokens can now coexist. Order matters: the longer (multi-token) member should come first so it gets first claim on the tokens.On v4 this raises
Cannot Union types that consume different numbers of tokens.list[Union[...]]with differing token-lengths. Each element is matched independently against the union members.null/none(case-insensitive) parse toNone. Applies to optional types. Union ordering decides the result: a member that legitimately accepts the literal string wins first.ArgumentCollection.copy(), includingcopy(reset_tokens=True)for a copy whoseArguments share metadata but carry fresh empty token lists.Dynamic per-parameter shell completion #917
Parameter.completercallable receives aCompletionContextand returns context-aware suggestions, so completions can depend on values only known at runtime (git branches, running containers, rows from a database). Works in bash/zsh/fish.Parameter.metavarand type-derived value placeholders #919--config PATH), separating a value's shape from a positional parameter's display identifier.Parameter.metavarto override the placeholder, or turn it off via the formatter. Closes #885.Themeable help colors #916
cyclopts.*Rich named style, so you can recolor any part of the help page by supplying your own theme; your overrides win over the built-in defaults.cyclopts.border), the usage line (cyclopts.usage), parameter/command names (cyclopts.name), and the metadata annotation styles ([default],[choices],[required], ...).Per-group help panel styling via
Group.theme#916Groupcan now carry its own theme (adictor RichTheme) to style just that group's panel independently of the rest of the help page.App.interactive_shell()improvements #941introbanner (supports Rich markup;Noneuses the default banner,""prints nothing).historyoption (Truefor a default history-file location, or a path) backed by readline.remap_flagsso barehelp/versionwords at the root map to their long flags.quitwords and registered commands are handled more robustly, with registered commands and meta commands taking precedence over quit words.Fixes
CHOICEmetavar for choice parameters and collapse variadic-collection metavars toX...by @BrianPugh in #949Misc
rich-rst>=1.3.1,<3torich-rst>=2.0.1,<3.Full Changelog: BrianPugh/cyclopts@v4.25.3...v5.0.0
v4.25.3Compare Source
Bug Fixes
Argumentlayer (#953) by @BrianPugh in #954set/frozensetby @BrianPugh in #956Full Changelog: BrianPugh/cyclopts@v4.25.2...v4.25.3
v4.25.2Compare Source
Bug Fixes
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.25.1...v4.25.2
v4.25.1Compare Source
Bug Fixes
allow_leading_hyphen=Truepositional values intact when a later char matches a short option by @BrianPugh in #934Internal
special thanks to @yilei for identifying these bugs!
Full Changelog: BrianPugh/cyclopts@v4.25.0...v4.25.1
v4.25.0Compare Source
Features
Bug Fixes
Docs
Internal
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.24.0...v4.25.0
v4.24.0Compare Source
Features
Parameter.choicesby @BrianPugh in #921Configsources by @BrianPugh in #918"sys_exit_if_non_zero_else_return"result action and document result_action modes by @BrianPugh in #907Bug Fixes
validate_by_nameis set by @xyf5432 in #909Docs
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.23.3...v4.24.0
v4.23.3Compare Source
Bug Fixes
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.23.2...v4.23.3
v4.23.2Compare Source
What's Changed
copymethods by @Ichunjo in #899New Contributors
Full Changelog: BrianPugh/cyclopts@v4.23.1...v4.23.2
v4.23.1Compare Source
Bug Fixes
Number,Path, andSlicevalidators silently skippingset,frozenset, anddictelements by @BrianPugh in #891Full Changelog: BrianPugh/cyclopts@v4.23.0...v4.23.1
v4.23.0Compare Source
Performing this as a minor release as it may break setups who rely on strict snapshot testing.
Bug Fixes
Full Changelog: BrianPugh/cyclopts@v4.22.5...v4.23.0
v4.22.5Compare Source
Bug Fixes
Various fixes around abstract collection types:
TypeErrorwhen an abstract collection parameter is given no values by @BrianPugh in #881Collection,Container, andReversibletype hints by @BrianPugh in #882--empty-*flags for abstract collection hints by @BrianPugh in #883Full Changelog: BrianPugh/cyclopts@v4.22.4...v4.22.5
v4.22.4Compare Source
Bug Fixes
ConsumeMultipleErrornoun when the count is 1 by @BrianPugh in #879Full Changelog: BrianPugh/cyclopts@v4.22.3...v4.22.4
v4.22.3Compare Source
Bug Fixes
Enumtypes with__init__defined. by @BrianPugh in #877Full Changelog: BrianPugh/cyclopts@v4.22.2...v4.22.3
v4.22.2Compare Source
Bug Fixes
MissingArgumentErrorfor explicitly-supplied empty mappings by @BrianPugh in #871=valueonParameter.count=Trueflags instead of silently dropping it by @BrianPugh in #872Full Changelog: BrianPugh/cyclopts@v4.22.1...v4.22.2
v4.22.1Compare Source
Bug Fixes
Parameter(env_var=...)values viaenv_var_splitby @chuenchen309 in #866=valueby @chuenchen309 in #865Full Changelog: BrianPugh/cyclopts@v4.22.0...v4.22.1
v4.22.0Compare Source
Bug Fixes
search_parents=Falsestill walking parent directories by @chuenchen309 in #864timedeltastrings instead of silently ignoring garbage by @chuenchen309 in #863-0xFF,+0o17) by @chuenchen309 in #862Full Changelog: BrianPugh/cyclopts@v4.21.2...v4.22.0
v4.21.2Compare Source
Bug Fixes
--delimiter leaking into an "Unknown option" error by @chuenchen309 in #861New Contributors
Full Changelog: BrianPugh/cyclopts@v4.21.1...v4.21.2
v4.21.1Compare Source
Bug Fixes
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.21.0...v4.21.1
v4.21.0Compare Source
Feature
Parameter.negative_aliasto append extra names to a flag's negative form (e.g. a short-d) without dropping the generated--no-*/--empty-*names. Mirrorsname/alias. By @BrianPugh in #859Bug Fixes
#857: a dataclass command with adefault_factoryfield could raise a spurious "Input should be a valid list" validation error simply becausepydanticwas imported anywhere in the program. Factory defaults are now invoked during introspection, so the produced value (rather than the<factory>sentinel) is used as the default and shown in help text — consistent across dataclass, attrs, and pydantic. By @BrianPugh in #858Full Changelog: BrianPugh/cyclopts@v4.20.0...v4.21.0
v4.20.0Compare Source
Features
cyclopts treecommand andApp.command_tree()by @BrianPugh in #845Bug Fixes
consume_multipleto nested structured-type fields by @BrianPugh in #846New Contributors
Full Changelog: BrianPugh/cyclopts@v4.19.0...v4.20.0
v4.19.0Compare Source
Features
Parameter.short_aliasto automatically generate short aliases for parameters. by @mgielda in #831ArgumentCollection.filter_by(missing=...)for required/conditionally-required fields. by @BrianPugh in #840New Contributors
Full Changelog: BrianPugh/cyclopts@v4.18.0...v4.19.0
v4.18.0Compare Source
Features
slicesupport by @BrianPugh in #835slicetype-hints are now properly handled.cyclopts.validators.Slicecyclopts.types.NonEmptySliceconvenience type.Bug Fixes
Parametermetadata in nested Annotated/Optional/NewType types by @BrianPugh in #838Full Changelog: BrianPugh/cyclopts@v4.17.0...v4.18.0
v4.17.0Compare Source
Features & Bug Fixes
Parameter.show_defaultto be a string to display. by @BrianPugh in #833Publishing
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.16.1...v4.17.0
v4.16.1Compare Source
Bug Fixes
prog_namematches a builtin helper by @BrianPugh in #825Misc
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.16.0...v4.16.1
v4.16.0Compare Source
Features
__cyclopts_returncode__method, which is honored by all built-inresult_actionhandlers. Customresult_actioncallables can opt in via the newcyclopts.resolve_returncodehelper. By @BrianPugh in #818**kwargsis annotated asUnpack[SomeTypedDict], the TypedDict's fields are promoted to top-level CLI options instead of the generic--[KEYWORD]catch-all. Per-fieldRequired/NotRequiredmarkers are respected independently of the parent kwargs argument. By @BrianPugh in #819CycloptsError.msgnow accepts arich.Textinstance. Cyclopts' error-message style palette is exposed ascyclopts.exceptions.STYLE_OFFENDING_VALUE,STYLE_NAME,STYLE_VALID_CHOICE,STYLE_SUGGESTION, andSTYLE_SOURCE. By @BrianPugh in #814Full Changelog: BrianPugh/cyclopts@v4.15.0...v4.16.0
v4.15.0Compare Source
Features
App.synonym, which declares alternate command name(s) that trigger a "Did you mean..." suggestion without registering the command under those names. Useful when a user types a semantically-equivalent word (e.g.removevsuninstall) that the built-in fuzzy matcher would miss because the words aren't spelled similarly. Accepts a singlestror an iterable of strings. Synonyms are not runnable and are hidden from--help.Did you mean "uninstall" or "purge"?).By @BrianPugh in #815
Full Changelog: BrianPugh/cyclopts@v4.14.1...v4.15.0
v4.14.1Compare Source
What's Changed
Full Changelog: BrianPugh/cyclopts@v4.14.0...v4.14.1
v4.14.0Compare Source
What's Changed
<2.0.0to<3.0.0by @germa89 in #810New Contributors
Full Changelog: BrianPugh/cyclopts@v4.13.0...v4.14.0
v4.13.0Compare Source
Features
CycloptsErrorprinting. by @BrianPugh in #808Full Changelog: BrianPugh/cyclopts@v4.12.0...v4.13.0
v4.12.0Compare Source
Features
Full Changelog: BrianPugh/cyclopts@v4.11.2...v4.12.0
v4.11.2Compare Source
Bug Fixes
_should_attempt_json_listfor detectinglist[str] | Noneand Annotated annotations by @BrianPugh in #800Full Changelog: BrianPugh/cyclopts@v4.11.1...v4.11.2
v4.11.1Compare Source
Bug Fixes
Full Changelog: BrianPugh/cyclopts@v4.11.0...v4.11.1
v4.11.0Compare Source
Features
usage_nameoverride for configuring docs creation by @BrianPugh in #791dict[str, dataclass-like]params by @wrongbad in #787Bug Fixes
Misc Internal
is_annotatedover get_origin by @BrianPugh in #792New Contributors
Full Changelog: BrianPugh/cyclopts@v4.10.2...v4.11.0
v4.10.2Compare Source
Features
NormFloat- A float in the range[0, 1]SignedNormFloat- A float in the range[-1, 1]PercentInt- An int in the range[0, 100]Bug Fixes
Full Changelog: BrianPugh/cyclopts@v4.10.1...v4.10.2
v4.10.1Compare Source
Bug Fixes
ValueErrorwhen parsing pre-release Pydantic versions by @BrianPugh in #775Full Changelog: BrianPugh/cyclopts@v4.10.0...v4.10.1
v4.10.0Compare Source
Features
New
App.error_formatterfield to control outCycloptsErrorare displayed. The formatter receives aCycloptsErrorand returns anyrich-printable object, replacing the defaultCycloptsPanel. Can be set at app creation or passed as a runtime override toparse_args/__call__/run_async. by @BrianPugh in #771By default (without
error_formatter), errors are displayed in a Rich panel:With a custom formatter, you can simplify or restyle the output:
Full Changelog: BrianPugh/cyclopts@v4.9.0...v4.10.0
v4.9.0Compare Source
Features
Parameter.consume_multiplenow acceptsintortuple[int, int]for min/max element bounds.intsets a minimum (e.g.consume_multiple=2requires at least 2 values).consume_multiple=(1, 3)requires 1–3 values).ConsumeMultipleError.By @BrianPugh in #764
New field
Parameter.allow_repeatingcontrols whether an option can be specified multiple times.FalseraisesRepeatArgumentErroron repeat (useful withconsume_multiple).Trueallows repeats for any type; scalars use last-wins semantics.None(default) preserves existing behavior: lists accumulate, scalars error.By @BrianPugh in #768
New field
App.help_prologuedisplays text before the "Usage" line in help output.Inherited by subcommands; override per-command or set to
""to disable.By @tahv in #769
Bug Fixes
a b --bar 8 dnow correctly errors instead of silently assigningdto the positional list. By @BrianPugh in #766Other
New Contributors
Full Changelog: BrianPugh/cyclopts@v4.8.0...v4.9.0
v4.8.0Compare Source
Features
Lazy Loading
--helpimprovements.Previously, running
--helpon a parent command would import and resolve all lazy child commands, negating much of the startup-time benefits. Now, parent--helpdisplays lazy commands without triggering any imports.To show descriptions for lazy commands in
--helpoutput, providehelp=at registration time:Other metadata (
group=,show=,sort_key=) can also be provided at registration time and will be used for help display without resolving the command.Lazy commands are now only resolved when:
--helpis requested (e.g.,myapp deploy --help)app["command_name"]Thanks to @zzstoatzz for the initial contribution in #757.
Full Changelog: BrianPugh/cyclopts@v4.7.0...v4.8.0
v4.7.0Compare Source
Features
Bug Fixes
list[ExistingFile]). by @BrianPugh in #760Full Changelog: BrianPugh/cyclopts@v4.6.0...v4.7.0
v4.6.0Compare Source
Features
Parameter.requires_equals. When enabled, values for keywords must be provided by an=. For example,--foo=bar.--foo barwould raise an error telling the user to use a=. Defaults toFalse(same behavior as before). by @BrianPugh in #751Full Changelog: BrianPugh/cyclopts@v4.5.4...v4.6.0
v4.5.4Compare Source
Bug Fixes
-nand-N), only-nwould be displayed on the help page. Does not impact actual value parsing. By @BrianPugh in #748Docs
Full Changelog: BrianPugh/cyclopts@v4.5.3...v4.5.4
v4.5.3Compare Source
Bug Fixes
Enumparam by @joelostblom in #745New Contributors
Full Changelog: BrianPugh/cyclopts@v4.5.2...v4.5.3
v4.5.2Compare Source
Bug Fixes
Full Changelog: BrianPugh/cyclopts@v4.5.1...v4.5.2
v4.5.1Compare Source
Bug Fixes
Parameterresolution when Optional by @BrianPugh in #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 [#737](httpConfiguration
📅 Schedule: (UTC)
🚦 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 was generated by Mend Renovate. View the repository job log.