Releases: mpkocher/pydantic-cli
Releases · mpkocher/pydantic-cli
Fix issue for Literal usage. Use FieldInfo repr for display.
Fixes to pypi build v9.0.0
- Fixes to hatchling build to pypi
Drop Support for Python 3.9
Drop Support for Python 3.9.
6.0.0 Pydantic 2 support and new Cmd model
- Support for Pydantic >= 2.8
- Backwards incompatible change. Use
Cmd
model. - Remove "sp" specific functions. No longer necessary because of Cmd interface.
- To migrate forward, inherit from
Cmd
and put your "main" function asCmd.run
method. Cmd.run()
should return None (on success) or raise an exception on error.- Pydantic 2 has a different "optional" definition
- Use
CliConfig
instead ofDefaultConfig
- Many backward incompatible changes to how
bool
are used. Use Pydantic bool casting (e.g.,--dry-run y
, or--dry-run true
).
Improve support for Enums
Fix friction point with argparse validation. Pydantic is now completely responsible for casting and validation.
New release with Manifest.in
Merge pull request #47 from mpkocher/bump-version-421 Bump version to include manifest.in
Add py.typed for better mypy support. Improved docs.
Merge pull request #43 from mpkocher/fix-doc-typo Fix typos in docs.
Improve Ergonomics by using cli= in Field
Improve ergonomics by using cli=(short, long)
or cli=(long,)
in Field.
Fixes for unhashable default values
Merge pull request #37 from mpkocher/fix-unhashable-bug Fix issue with assuming defaults are hashable
Improvements to boolean flags
- backward incompatible changes to how boolean flags are handled
- Common/Vanilla case of
debug:bool = False
can be customized with(-d, --debug)
to negate the default value. - Required
x:bool
, orx:Optional[bool]
,x:Optional[bool] = None
semantics remain the same with(--enable-x, --disable-x)
format. - Use Pydantic's
Field
instead of Config.CLI_EXTRA_OPTIONS to have one consistent model - Improve help messages by adding better type description and explicitly display if a field is required