Changelog¶
All notable changes to this project will be documented in this file.
0.6.0 - 2024-11-27¶
Full Changelog: github.com/fresh2dev/yapx/compare/0.5.2...0.6.0
Features¶
- Allow
*args
and**kwargs
to be annotated yapx.arg(..., is_secret=True)
to redact secrets from help- Beautify help and error output with rich
- Export help output with
--help-export file.[svg|html|txt]
or--help-export-all file.[svg|html|txt]
Fixes¶
- Off-by-one error when counting arg has a default value
Changes¶
- Breaking - No longer auto-create negated boolean flags
- Breaking - Require python >= 3.9
0.5.2 - 2023-1-1¶
Features¶
- Python 3.12 compatibility
0.5.1 - 2023-12-10¶
Features¶
- Allow stdin input for any type
Changes¶
- Breaking: When casting from
str
, returnNone
if blank
0.5.0 - 2023-12-07¶
Features¶
yapx.arg(stdin=...)
to get arg value from stdin stream.
Fixes¶
- Breaking: Do not append to default sequence value (addresses bugs.python.org/issue16399)
- Show default values of more types in
--help
Changes¶
- Breaking: no longer remove commas occurring between sequence parameter values
0.4.2 - 2023-10-30¶
Features¶
build_parser_from_spec/file
[9e51ae8]
0.4.1 - 2023-08-29¶
Features¶
- Suppress
--help-all
flag withadd_help_all=False
[048ad79]
0.4.0 - 2023-08-26¶
Features¶
- Breaking: Support infinitely nested subcommands [b8ad0c4]
Fixes¶
- Don't add field to dataclass when annotated with
Optional[yapx.Context]
[00db7bd] - Allow arbitrary types when using pydantic v2 [3105bac]
Changes¶
- Simplify help messages and metavars [66d81d4]
0.3.0 - 2023-08-17¶
Features¶
- Add vanity arg methods; counting_arg, feature_arg, unbounded_arg [135c34c]
- Breaking:
yapx.Context
used instead of_relay_value
[a93341a]
Fixes¶
- Refactor to ensure
parse_args
is called only once [a401a4f] - Dict annotation returning empty list when empty arg given [47dcd49]
- Restore ability to suppress tui option [223ba03]
Changes¶
- Breaking: Positional args to
yapx.arg(...)
are now considered flags. [8a5540f] - Breaking:
*args
and**kwargs
are populated by unknown args [1338dcd] - Only show defaults in help text if not null or empty [bc60880]
0.2.4 - 2023-07-29¶
Features¶
- Add
--tui
parameter to every subparser [1b0eef8]
0.2.3 - 2023-07-28¶
Fixes¶
- Fix parsing of positional arguments with sequence types [231aaee]
0.2.2 - 2023-07-28¶
Features¶
- Override add_subparsers defaults [54b88a5]
0.2.1 - 2023-07-24¶
Changes¶
- Use argparse-tui fork of trogon [ce7917c]
- refactor: BooleanOptionalAction [4910820]
- refactor: Small optimizations [e32e101]
0.2.0 - 2023-07-18¶
- better error handling
- optional integration with rich, rich-argparse for prettier output
- support for automatic bool-negation parameters, e.g.:
--flag / --no-flag
- support for "counting" arguments:
value: Annotated[int, yapx.arg(nargs=0)]
- support for "feature" arguments:
value: Annotated[str, yapx.arg(nargs=0)]
- Sequence-types (list, set, dict, etc.) use nargs=1 by default.
Previously, this was the way to populate a list: --value 1 2 3
Now, this is the way: --value 1 --value 2 --value 3
The prior behavior can still be obtained using: value: Annotated[List[int], yapx.arg(nargs='*')]
Features¶
- Appended sequences, counting args, feature args, and bool arg negation. [09f315e]
- Improved error handling, prettier output with rich [29d85b3]
- Add
--tui
flag to help [abb5780] - Add tui as argument or subcommand [839ff27]
- Add
patch_run
[4f07cd0] - Expose yapx.build_parser, yapx.Namespace, yapx.is_... [79f8d03]
- Command name is optional; is now derived from func/model name [2f00be7]
- Attempt to get prog version [13edbbb]
- Support Pydantic v2 [7b25bc9]
Fixes¶
- Casting of Dict value types [4743696]
- Raise ValueError when string not in Enum names [8c2dee5]
- Don't include shtab parameter in parsed args [b8cd492]
- Correct value of counting parameters with no default [a324f35]
- Only add
--version
flag if prog_version is not empty [15c34c1] - Convert default values of boolean arguments [543c58f]
- Make all helpful flags optional [16a74dc]
Changes¶
- Breaking:
build_parser
and reworkrun
[bbc7505] - Inherit appropriate argparse actions [12e3bce]
- Remove tui extra for now [750a6a2]
0.1.0 - 2023-06-04¶
- Initial release