Config versioning support.
The config files can now have a section
metawith the key
version. The version is specified in dotted-notation with a major and minor number (f.ex.:
version=2.1). Configuration instances take an optional
versionargument as well. If specified, config_resolver expects the
meta.versionto be there. It will raise a
config_resolver.NoVersionErrorotherwise. Increments in the major number signify an incompatible change. If the application expectes a different major number than stored in the config file, it will raise a
config_resolver.IncompatibleVersionexception. Differences in minor numbers are only logged.
mandatoryargument has been dropped! It is now implicitly assumed it the
.getmethod does not specify a default value. Even though “explicit is better than implicit”, this better reflects the behaviour of the core
ConfigParserand is more intuitive.
- Legacy support of old environment variable names has been dropped!
- Python 3 support.
- When searching for a file on the current working directory, look for
./.group/app/app.iniinstead of simply
./app.ini. This solves a conflict when two modules use config_resolver in the same application.
- Better logging.
- New (optional) argument:
require_load. If set to
Truecreating a config instance will raise an error if no appropriate config file is found.
- New class:
SecuredConfig: This class will refuse to load config files which are readable by other users than the owner.
- Documentation updated/extended.
- Code cleanup.
- The “group” name has been prefixed to the names of the environment variables. So, instead of APP_PATH, you can now use GROUP_APP_PATH instead. Not using the GROUP prefix will still work but emit a DeprecationWarning.
- The call to
getcan now take an optional default value. More details can be found in the docstring.