Repository navigation
Releases
Releases · PrimeIntellect-ai/pydantic-config
v0.4.3
Patch release that fixes validation_alias handling inside union and optional fields.
Fixes
- Alias normalization now reaches union and optional fields (#23) —
AliasChoicesspellings on a field inside a discriminated-union variant (or anOptional[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
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 deriveX.Y.(Z+1).devNfrom the latest tag. - Updated GitHub Actions off the deprecated Node 20 runtime (
actions/checkout@v5,astral-sh/setup-uv@v7).
0.4.1was skipped: its release tag was created against a misconfigured CI workflow and couldn't be re-pointed (tag protection), so the fix shipped as0.4.2.
v0.4.0
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 aBaseConfiginto a typed argument parser. - Config files — load values from TOML, YAML, or JSON via the
@path/to/config.tomlsyntax (including passing a config file as the root entry), with CLI overrides layered on top. - Custom parser + Rich help renderer — dropped the
tyrodependency 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
dictfields 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_factoryrendering 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-newersupply-chain cooldown on dependency resolution