Commit Graph

14 Commits

Author SHA1 Message Date
Timmy Welch
fc2a175e5b Fix normalization of settings using a custom dest 2023-12-17 16:09:41 -08:00
Timmy Welch
23d0139144 Map argparse --help output to python versions 2023-11-19 00:14:06 -08:00
Timmy Welch
0c49b9309d Persist unknown groups 2023-11-18 23:58:18 -08:00
Timmy Welch
ccacca1b32 Improve generated namespace
Improve formatting of namespace
Allow _guess_type to return any string
Add tests
2023-11-18 23:31:24 -08:00
Timmy Welch
101eef56ca Sanitize group names 2023-09-04 18:32:14 -05:00
Timmy Welch
4c41e6f588 Use a custom class for typing
Add support for nargs to default to list[str]
2023-06-09 15:41:18 -07:00
Timmy Welch
b599097cc1 Adds a function to generate a class for typing a namespace 2023-06-08 22:54:36 -07:00
Timmy Welch
8af75d3962 Update docstrings and ensure parameters are consistent 2023-06-08 21:44:07 -07:00
Timmy Welch
e57ee25a60 Make get_namespace consistent with normalize_config 2023-06-08 21:44:07 -07:00
Timmy Welch
ba645eb7c6
Implement qoc fixes
Fix fstring
Add comments explaining execution of normalize_config with defaults arg
Fix not removing file or cmdline settings in persistent groups
Fix a bug in get_namespace when config is a namespace
Add additional tests
2023-02-20 01:59:40 -08:00
Timmy Welch
d07cf9949b
Allow adding settings to existing groups
Calling add_group or add_persistent_group twice will add any new
settings defined.

Raise a ValueError if add_group or add_persistent_group is called during
a call to add_group or add_persistent_group.
2023-02-19 18:07:14 -08:00
Timmy Welch
d2326eadb9
Add support for persistent setting groups
Persistent setting groups allow settings that are not declared to
 survive normalization and other operations that would normally remove
 any unknown keys in a group.

Calling normalize or get_namespace with persistent=False will remove
 unknown keys even from persistent groups.

Currently the only way to retrieve the defaults for a config and
 preserve unknown keys is to manually get the defaults and update each
 existing group with the default values.
2023-01-31 19:18:09 -08:00
Timmy Welch
38e42bf3f9
Make most functions work off of Config objects and Values/Namespace objects
Used Generic for better typing
Backported BooleanOptionalAction for tests on Python 3.8
Remove merge support in normalize_config
Add test to validate that the example works
2022-12-15 18:53:29 -08:00
Timmy Welch
eb0b6ec0fe
Initial Commit 2022-12-14 20:57:57 -08:00