- Backwards Incompatible Release
- Removed official support for Python 3.9
- Added official support for Python 3.13 and 3.14
- Updated pydantic-settings requirement to >=2.13 (was >=2.4)
- Backwards Incompatible Release
- Removed the
_config_fileattribute fromGoodConf. If you previously set this attribute, you are no longer be able to do so.
- Removed the
- Support reading TOML files via
tomllibon Python 3.11+ - Update Markdown generation, so that output matches v4 output
Backwards Incompatible Release
- Removed official support for Python 3.8
- upgraded to pydantic2
To upgrade from goodconf v4 to goodconf v5:
If subclassing
GoodConf, replace uses ofclass Configwithmodel_config.For example goodconf v4 code like this:
from goodconf import GoodConf class AppConfig(GoodConf): "Configuration for My App" DATABASE_URL: PostgresDsn = "postgres://localhost:5432/mydb" class Config: default_files = ["/etc/myproject/myproject.yaml", "myproject.yaml"] config = AppConfig()
should be replaced in goodconf v5 with:
from goodconf import GoodConf class AppConfig(GoodConf): "Configuration for My App" DATABASE_URL: PostgresDsn = "postgres://localhost:5432/mydb" model_config = {"default_files": ["/etc/myproject/myproject.yaml", "myproject.yaml"]} config = AppConfig()
- Release from GitHub Actions
- Another markdown output fix
- Fix for markdown generation generation on Python 3.8 & 3.9
- Fix trailing whitespace in markdown output
- Removed errant print statement
- Removed official support for Python 3.7
- Added support for Python 3.12
- Fixed type display in Markdown generation
- Changed markdown output format (trailing spaces were problematic).
- pin to pydantic < 2 due to breaking changes in 2.0
- 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.0or update their code as follows:- Replace
goodconf.Valuewithgoodconf.Field. - Replace
helpkeyword argument withdescriptioninField(previouslyValue). - Remove
cast_askeyword argument fromField(previouslyValue). Standard Python type annotations are now used. - Move
file_env_varanddefault_fileskeyword arguments used in class initialization to a sub-class namedConfig
Given a version
1class 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.Valueis replaced by the Field function.helpkeyword arg is nowdescriptionGoodConfis now backed by BaseSettings Instead of passing keyword args when instantiating the class, they are now defined on aConfigclass on the object
- Allow overriding of values in the generate_* methods
- Python 3.7 supported
- Explicit
loadmethod django_managemethod 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
requiredargument fromValues. To make an value optional, give it a default. - Changed implicit loading to happen during instanciation rather than first
access. Instanciate with
load=Falseto avoid loading config initially.
- Implicitly load config if not loaded by first access.
-cis used by Django'scollectstatic. Using-Cinstead.
- Adds
goodconf.contrib.argparseto add a config argument to an existing parser.
- Major refactor from
file-or-envtogoodconf
- Fixed packaging issue.
- Fixes bug in stack traversal to find calling file.
- Initial release