Magiconfig

Latest version: v2.4.4

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

Scan your dependencies

Page 1 of 3

2.4.4

Bug fix: output type for `parse_args()` with config-enabled subparsers should be `MagiConfig`, not `Namespace`, even if top-level parser is not config-enabled.

2.4.3

* Bug fix: `__builtin__` changed to `builtins` in Python3.
* Bug fix: `eval` now understands `...` (`Ellipsis`) in Python3; fix strict config writing accordingly.
* Improvement: support argument groups.
* Known deficiency: if two dests are in one mutually exclusive group, both dests will still appear in the output if an existing config that contains both is imported.

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

Page 1 of 3

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.