Skip to content

Releases: BrianPugh/cyclopts

v3.1.4

07 Jan 15:55
Compare
Choose a tag to compare

Features

Bug Fixes

  • Fix subapp default command/parameter/argument groups. by @BrianPugh in #283
  • fix handling for when Annotated is inside another type; namely list[Annotated[...]]. by @BrianPugh in #289

Full Changelog: v3.1.3...v3.1.4

v3.1.3

30 Dec 20:23
Compare
Choose a tag to compare

Bug Fixes

Full Changelog: v3.1.2...v3.1.3

v3.1.2

28 Nov 19:19
eb073c0
Compare
Choose a tag to compare

What's Changed

Full Changelog: v3.1.1...v3.1.2

v3.1.1

27 Nov 01:52
Compare
Choose a tag to compare

Bug Fixes

Full Changelog: v3.1.0...v3.1.1

v3.1.0

23 Nov 16:47
abfb1ef
Compare
Choose a tag to compare

What's Changed

  • New attribute App.sort_key that controls command-order in the help page. by @BrianPugh in #258

Full Changelog: v3.0.1...v3.1.0

v3.0.1

19 Nov 14:39
1d2a550
Compare
Choose a tag to compare

Bug Fixes

  • Allow for list[bool] and similar (list of flags). by @BrianPugh in #251

Full Changelog: v3.0.0...v3.0.1

v3.0.0

09 Nov 01:55
78f7227
Compare
Choose a tag to compare

Features

  • Advanced parsing of user-defined classes (including pydantic/attrs/dataclasses/namedtuple).
  • Support parsing of typeddict/dict.
  • Improved error message precision/accuracy/helpfulness.
  • New convenience types: UInt8, Int8, UInt16, Int16, Uint32, Int32, Json.
  • Number and Path validators now work with sequences (e.g. list[Path]).
  • Additional POSITIONAL_ONLY parameters may follow an iterable POSITIONAL_ONLY parameter. This allows for programs like:
    @app.default
    def foo(inputs: list[Path], output: Path, /):
        pass
    $ python my-program.py input_files/*.txt output.txt
  • Now supports the bare -- special token for forcing all subsequent CLI tokens to be parsed as positional argument. This mimics getopt behavior.
  • Add "new" group validator cyclopts.validators.MutuallyExclusive. Performs same action as the default LimitedChoice(), but may be more intuitive/obvious for developers reading application code.
  • Improved help-page formatting.
  • Various minor bug fixes.

Breaking Changes/Features

  • Drop python3.8 support; add python3.13 support.

  • Remove Group.converter and App.converter. Their use-cases are a bit contrived, don't provide much value, and increase the maintenance burden of the Cyclopts codebase.

  • Change in custom Parameter.converter. Previously, the converter had signature:

    def converter(type_, *values: str): ...

    The new signature is:

    def converter(type_, tokens: Sequence[Token]): ...

    See the new Token class. This allows for raising a CoercionError for the particular offending token, which will result in a more helpful error message for the user.

  • App.parse_args and App.parse_known_args now return an additional value, ignored, which is a dictionary mapping python-variable-names to their type annotation of parameters with parse=False.

  • Different CLI parsing scheme that is more directly similar to python's function rules. If a python variable is POSITIONAL_OR_KEYWORD, and a value is specified by keyword, subsequent POSITIONAL_OR_KEYWORD parameters in the function signature must be specified by keyword.

  • When an iterable-like datatype is specified by keyword, only a single element's worth of tokens will be consumed. To restore the old behavior where tokens are consumed until an option-like argument is reached, set Parameter.consume_multiple = True.

  • Parameter.negative_bool values must no longer start with --. E.g. if it was previously --no-, it should now be no-. A ValueError is raised if it starts with a hyphen.

  • Parameter.negative_iterable values must no longer start with --. E.g. if it was previously --empty-, it should now be empty-. A ValueError is raised if it starts with a hyphen.

  • Parameter.required field actually impacts whether or not the Parameter is mandatory. Previously it was only reflected in the help page.

v2.9.9

27 Aug 21:14
d311432
Compare
Choose a tag to compare

What's Changed

  • Improve program load-time and --help performance. by @BrianPugh in #223

Full Changelog: v2.9.8...v2.9.9

v2.9.8

27 Aug 13:32
34df4c7
Compare
Choose a tag to compare

What's Changed

Full Changelog: v2.9.7...v2.9.8

v2.9.7

16 Aug 16:18
Compare
Choose a tag to compare

Improvements

  • Optimize --help performance by passing down the App version to the help/version commands by @daudef in #217

New Contributors

Full Changelog: v2.9.6...v2.9.7