- TOML files are now supported as configuration source
- Python 3.11 and 3.10 are now officially supported
- Python 3.6 is no longer officially supported
- Requires Pydantic 1.7+
- Variables can now be set during class initialization
- Change to newer syntax for safe loading yaml
- Backwards Incompatible Release
Internals replaced with pydantic. Users can either pin to
1.0.0
or update their code as follows:- Replace
goodconf.Value
withgoodconf.Field
. - Replace
help
keyword argument withdescription
inField
(previouslyValue
). - Remove
cast_as
keyword argument fromField
(previouslyValue
). Standard Python type annotations are now used. - Move
file_env_var
anddefault_files
keyword arguments used in class initialization to a sub-class namedConfig
Given a version
1
class that looks like this:from goodconf import GoodConf, Value class AppConfig(GoodConf): "Configuration for My App" DEBUG = Value(default=False, help="Toggle debugging.") MAX_REQUESTS = Value(cast_as=int) config = AppConfig(default_files=["config.yml"])
A class updated for version 2 would be:
from goodconf import GoodConf, Field class AppConfig(GoodConf): "Configuration for My App" DEBUG: bool = Field(default=False, description="Toggle debugging.") MAX_REQUESTS: int class Config: default_files=["config.yml"] config = AppConfig()
- Replace
- Environment variables take precedence over configuration files in the event of a conflict
- Use null value for initial if allowed
- Store the config file parsed as
GoodConf.Config._config_file
- Backwards Incompatible: Migrated backend to
pydantic
.Value
is replaced by the Field function.help
keyword arg is nowdescription
GoodConf
is now backed by BaseSettings Instead of passing keyword args when instantiating the class, they are now defined on aConfig
class on the object
- Allow overriding of values in the generate_* methods
- Python 3.7 supported
- Explicit
load
method django_manage
method helper onGoodConf
- Fixed a few minor bugs
- Use a declarative class to define GoodConf's values.
- Change description to a docstring of the class.
- Remove the redundant
required
argument fromValues
. To make an value optional, give it a default. - Changed implicit loading to happen during instanciation rather than first
access. Instanciate with
load=False
to avoid loading config initially.
- Implicitly load config if not loaded by first access.
-c
is used by Django'scollectstatic
. Using-C
instead.
- Adds
goodconf.contrib.argparse
to add a config argument to an existing parser.
- Major refactor from
file-or-env
togoodconf
- Fixed packaging issue.
- Fixes bug in stack traversal to find calling file.
- Initial release