Skip to content

v4.16.0

Choose a tag to compare

@BrianPugh BrianPugh released this 23 May 18:20
be2b429

Features

  • Return-value objects can now declare their own exit code by defining a __cyclopts_returncode__ method, which is honored by all built-in result_action handlers. Custom result_action callables can opt in via the new cyclopts.resolve_returncode helper. By @BrianPugh in #818
  • PEP 692 support: when **kwargs is annotated as Unpack[SomeTypedDict], the TypedDict's fields are promoted to top-level CLI options instead of the generic --[KEYWORD] catch-all. Per-field Required / NotRequired markers are respected independently of the parent kwargs argument. By @BrianPugh in #819
  • CycloptsError.msg now accepts a rich.Text instance. Cyclopts' error-message style palette is exposed as cyclopts.exceptions.STYLE_OFFENDING_VALUE, STYLE_NAME, STYLE_VALID_CHOICE, STYLE_SUGGESTION, and STYLE_SOURCE . By @BrianPugh in #814

Full Changelog: v4.15.0...v4.16.0