fix: env vars ignored on first config build

ConfigEOS.__init__ passed self as first positional argument to _setup,
which forwards it to pydantic_settings.BaseSettings.__init__. Its first
positional parameter is _case_sensitive, so the environment source
matched the upper case variable names against the lower case field names
and returned nothing. Environment settings only took effect after the
next configuration setup.
This commit is contained in:
r0b2g1t
2026-09-13 13:53:00 +02:00
parent f882f62164
commit e534878df5
3 changed files with 37 additions and 6 deletions
+3 -1
View File
@@ -717,7 +717,9 @@ class ConfigEOS(SingletonMixin, SettingsEOSDefaults):
logger.debug("Config init called again with parameters {} {}", args, kwargs)
return
logger.debug("Config init with parameters {} {}", args, kwargs)
self._setup(self, *args, **kwargs)
# Do not pass self - the first positional argument of pydantic_settings.BaseSettings
# is _case_sensitive, which would make environment variable lookup case sensitive.
self._setup(*args, **kwargs)
def _setup(self, *args: Any, **kwargs: Any) -> None:
"""Re-initialize global settings."""