24 Commits

Author SHA1 Message Date
43d12526d9 Fix pathlib on 3.13 2026-02-09 18:10:59 -08:00
e63b8dc511 Remove python3.9 code 2026-02-09 18:10:59 -08:00
68bdce33d3 Drop python 3.9 2025-11-03 17:43:34 -08:00
ba1c12a575 pre-commit 2025-08-30 20:40:46 -07:00
5fc7a5173d Update tests
Remove python3.8 leftovers
Add prog to create_argparser
Remove metavar usage from BooleanOptionalAction
2025-08-30 20:26:18 -07:00
8d772c6513 Improve types 2024-05-20 15:09:33 -07:00
73552e0dd2 Improve Generic list and set typing 2024-05-19 14:11:18 -07:00
43f6bf1eac Improve type detection 2024-05-18 15:49:32 -07:00
eca7be0c51 Set optional None types 2024-05-18 13:03:50 -07:00
c588fc891e Support type generation for dicts an addition to namespaces 2024-02-22 19:15:47 -08:00
fc2a175e5b Fix normalization of settings using a custom dest 2023-12-17 16:09:41 -08:00
23d0139144 Map argparse --help output to python versions 2023-11-19 00:14:06 -08:00
0c49b9309d Persist unknown groups 2023-11-18 23:58:18 -08:00
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
101eef56ca Sanitize group names 2023-09-04 18:32:14 -05:00
4c41e6f588 Use a custom class for typing
Add support for nargs to default to list[str]
2023-06-09 15:41:18 -07:00
b599097cc1 Adds a function to generate a class for typing a namespace 2023-06-08 22:54:36 -07:00
8af75d3962 Update docstrings and ensure parameters are consistent 2023-06-08 21:44:07 -07:00
e57ee25a60 Make get_namespace consistent with normalize_config 2023-06-08 21:44:07 -07:00
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
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
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
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
eb0b6ec0fe Initial Commit 2022-12-14 20:57:57 -08:00