Magiconfig

Latest version: v2.4.2

Safety actively analyzes 621420 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 3

2.4.2

Two minor bug fixes related to type checking for arguments taken from config files.

2.4.1

Bug fix: restore legacy behavior for `add_config_only()`. This function could originally be called multiple times for a single `dest` to change its status (adding a default or making it `required`). This capability is now restored (though like the rest of `add_config_only()`, it is deprecated and will be removed in `3.0.0`).

2.4.0

Improved functionality and interfaces for configs.
1. Writing:
a. Recursive writing for nested configs (nicer formatting).
b. Handle non-builtin types when writing configs by providing appropriate import statements in the written config, including container entries.
c. `attr_imports`, `class_imports`, `attr_reprs`, `class_reprs` options to provide alternative imports or `repr` functions for specific attributes or classes.
d. `strict` option to prevent writing configs with objects whose `repr` outputs don't reproduce their original values.
2. Config-only arguments:
a. New interface `add_config_argument()`, `remove_config_argument()`. (Example 3 updated to use the new interface.)
b. `add_config_argument()` allows specifying relevant properties in a similar way to `argparse.ArgumentParser.add_argument()`.
c. Old interface `add_config_only()`, `remove_config_only()` marked as deprecated and will be removed in 3.0.0.

Also, `magiconfig.__version__` is now provided.

2.3.1

* Fix bug related to enforcing `choices` for arguments taken from configs

2.3.0

* Fix bugs related to handling of default values when reading and writing configs
* Improve test setup

2.2.0

* Fix bugs related to applying types to config arguments with `nargs`
* Enforce specified choices when parsing config arguments
* Add & document function `remove_config_options()`

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.