pypi cyclopts 5.3.0
v5.3.0

7 hours ago

Features

  • Number validator supports Decimal and Fraction. #988

Bug Fixes

Config & Environment Variables

  • Empty config containers now bind for dict, list, tuple, set and dataclass parameters (Any parameters keep the container as-is). #993, #1006
  • A config null is rejected for types that don't allow None. #1004
  • A config array is rejected for single-value types, including a pydantic Model | bool (previously bound True). #1005, #1014
  • A JSON config.Env value containing spaces stays one token. #997
  • Symlinked configuration filenames are preserved. @ac1982 #995

JSON Parsing

  • dict[str, X] parameters accept a JSON object from the CLI or an env var. #1001
  • A JSON object for a nested pydantic model field no longer crashes with IndexError. #999
  • An explicit empty JSON object reports the missing required fields. #992
  • Errors from config/env JSON list elements name the real parameter instead of --json. #998

Unions With a Class Member

  • Foo | bool supports keyed fields and bare flags, and lists --x/--no-x in help and shell completion. #991, #1013
  • Foo | dict[str, int] no longer silently drops unknown keys; its dict fallback keeps typed keys and input order. #1015, #1019

Other

  • ~3.5 ms faster startup and per-invocation overhead. #989
  • A mistyped command given with --help raises UnknownCommandError. @BreytMN #994
  • Parameter metadata is honored on dict value types. @saadkhantareen #1008
  • Pydantic models with validate_by_alias=False accept the field name on pydantic 2.14. #1010
  • The Parameter(name="*") no-default error names the class instead of Annotated. #996
  • resolve_returncode and ConsumeMultipleError are declared in __init__.pyi. @tarrific #1018

New Contributors

Full Changelog: v5.2.0...v5.3.0

Don't miss a new cyclopts release

NewReleases is sending notifications on new releases.