Releases: frontdevops/magic-config
Releases · frontdevops/magic-config
1.0.1
Magic Config 1.0.1 (2025-07-03)
🎉 Added
- ENV_FILE override: honor the
ENV_FILEenvironment variable to load a custom.envwithout needing to passenv_file=in code. - Flask integration: added a
__dir__override so thatapp.config.from_object(Config)imports all uppercase keys. - Arbitrary kwargs support:
__new__and__init__now accept any**kwargs(e.g.BASE_DIR) without raisingTypeError. - Python 3.13 features:
- PEP 604 union types (
str | None, etc.) - PEP 616
str.removeprefix()/str.removesuffix() - PEP 673
Self - PEP 591
Final - PEP 584 dict union/update operators (
|and|=)
- PEP 604 union types (
🔄 Changed
- Minimum Python version bumped to 3.12+ (3.13 recommended) to leverage modern syntax and typing.
- Type annotations modernized throughout the codebase.
- Internal merging of config sources now uses
|=for clearer, more performant updates. - Singleton initialization protected by an
_initializedflag to avoid repeated loads.
🐛 Fixed
- Resolved
TypeErrorin__new__when passing named arguments to the constructor. - Prevented infinite recursion in
__delitem__. - Ensured Flask’s
from_objectpicks up dynamic config keys via the new__dir__.
⚠️ Breaking Changes
- Dropped support for Python versions prior to 3.12.
- Constructor behavior changed: positional
dataand keyword args are now unified in a singlemergeddict—review any custom instantiations.
Migration Guide
- Upgrade Python if you’re running <3.12.
- Use the
ENV_FILEenv var orenv_file=constructor arg to select your.env. - No changes needed for Flask users—
from_object(Config)now works out of the box. - Audit any direct calls to
MagicConfig.__new__/__init__if you relied on the old signature.
Happy configuring! If you encounter any issues, please open a ticket on GitHub.
1.0.0
Magic Config 1.0.0 (2025-07-03)
🎉 Added
- ENV_FILE override: honor the
ENV_FILEenvironment variable to load a custom.envwithout needing to passenv_file=in code. - Flask integration: added a
__dir__override so thatapp.config.from_object(Config)imports all uppercase keys. - Arbitrary kwargs support:
__new__and__init__now accept any**kwargs(e.g.BASE_DIR) without raisingTypeError. - Python 3.13 features:
- PEP 604 union types (
str | None, etc.) - PEP 616
str.removeprefix()/str.removesuffix() - PEP 673
Self - PEP 591
Final - PEP 584 dict union/update operators (
|and|=)
- PEP 604 union types (
🔄 Changed
- Minimum Python version bumped to 3.12+ (3.13 recommended) to leverage modern syntax and typing.
- Type annotations modernized throughout the codebase.
- Internal merging of config sources now uses
|=for clearer, more performant updates. - Singleton initialization protected by an
_initializedflag to avoid repeated loads.
🐛 Fixed
- Resolved
TypeErrorin__new__when passing named arguments to the constructor. - Prevented infinite recursion in
__delitem__. - Ensured Flask’s
from_objectpicks up dynamic config keys via the new__dir__.
⚠️ Breaking Changes
- Dropped support for Python versions prior to 3.13.
- Constructor behavior changed: positional
dataand keyword args are now unified in a singlemergeddict—review any custom instantiations.
Migration Guide
- Upgrade Python if you’re running <3.13.
- Use the
ENV_FILEenv var orenv_file=constructor arg to select your.env. - No changes needed for Flask users—
from_object(Config)now works out of the box. - Audit any direct calls to
MagicConfig.__new__/__init__if you relied on the old signature.
Happy configuring! If you encounter any issues, please open a ticket on GitHub.
Fix
0.1.13 Merge branch 'main' of github.com:frontdevops/magic-config