Skip to content

Releases

v0.4.3

Choose a tag to compare

@mikasenghaas mikasenghaas released this 18 Aug 00:24
65b15df

Patch release that fixes validation_alias handling inside union and optional fields.

Fixes

  • Alias normalization now reaches union and optional fields (#23) — AliasChoices spellings on a field inside a discriminated-union variant (or an Optional[Model]) were never rewritten to their canonical key. A config file using the alias plus a CLI flag using the canonical name then survived the merge as two distinct keys: extra="forbid" rejected the pair, or the file value silently beat the CLI override. Aliases in these positions now collapse onto one canonical key with normal CLI > file > default precedence, with union variants selected by their discriminator tag when the data carries one.

v0.4.2

Choose a tag to compare

@mikasenghaas mikasenghaas released this 20 Jul 19:40
4f5ae37

Patch release that fixes the project page on PyPI.

Fixes

  • README images now render on PyPI — the README referenced images with relative paths that only resolved on GitHub. They're now absolute URLs, so the screenshots display on the PyPI project page.

Internal / CI

  • Versioning is now git-driven via hatch-vcs — dev builds derive X.Y.(Z+1).devN from the latest tag.
  • Updated GitHub Actions off the deprecated Node 20 runtime (actions/checkout@v5, astral-sh/setup-uv@v7).

0.4.1 was skipped: its release tag was created against a misconfigured CI workflow and couldn't be re-pointed (tag protection), so the fix shipped as 0.4.2.

v0.4.0

Choose a tag to compare

@mikasenghaas mikasenghaas released this 20 Jul 19:40
4eeab0c

First tagged release of prime-pydantic-config — a Pydantic-driven CLI with TOML / YAML / JSON config-file support, published to PyPI as prime-pydantic-config.

Highlights

  • Define your CLI from a Pydantic model — cli(Config) turns a BaseConfig into a typed argument parser.
  • Config files — load values from TOML, YAML, or JSON via the @path/to/config.toml syntax (including passing a config file as the root entry), with CLI overrides layered on top.
  • Custom parser + Rich help renderer — dropped the tyro dependency in favor of a purpose-built argv parser and Rich-rendered --help (panels, inline defaults, docstrings).

CLI features

  • Nested config groups and sub-configs
  • Optional[BaseModel] sub-fields: bare-flag enable/disable, sub-field overrides, and rendering in --help
  • Discriminated unions: switch variants via CLI args; multi-variant rendering in --help
  • Boolean flags with --no- negation
  • List values and dict fields with unified JSON value parsing and type coercion
  • Single-dash short flags for single-character aliases
  • Validation-alias support
  • Docstring inheritance via MRO and default_factory rendering in help

Error handling

  • Rich-formatted validation errors
  • Unknown-flag suggestions
  • Clear "config file not found" errors

Packaging & security

  • Published to PyPI as prime-pydantic-config (hatchling build)
  • PyPI publishing via Trusted Publishers (OIDC) — no long-lived tokens
  • 7-day exclude-newer supply-chain cooldown on dependency resolution