fix: default server settings prevent env var config (#1234)

Change configuration source priorities to:

- cli
- environment vars
- dotenv settings
- config file settings
- init settings

By this the environment vars supersede any configuration var
provided by the configuration file or by the initialisation
with pydantic.

The test_config.py::test_computed_path was fixed to to not
use the defaul env var overwrite defined by conftest.py.
This seemed to indicate non working env vars, but in fact
was a test setupt fault.

Besides this fix there are other fixes and changes added:

* fix: exclude computed fields when merging settings

  Pydantic may overwrite settings by values given for computed
  fields and use these values instead of re-computing the field.
  Avoid computed fields in merging settings.

* chore: improve Windows compatability of development setup

  Improve scripts to better run also on Windows. When doing path
  checks keep compatibility also to Windows pathes. A lot of
  changes to avoid the famous Windows CRLF handling and keep
  line endings to LF.

* chore: add development hint for Windows

  Windows developers should set core.autocrlf to false.

* chore: update version

Signed-off-by: b0661 <b0661n0e17e@gmail.com>
This commit is contained in:
Bobby Noelte
2026-08-16 13:56:25 +02:00
committed by GitHub
parent 269d2162a9
commit 886c93c92b
18 changed files with 525 additions and 345 deletions
+4 -2
View File
@@ -97,7 +97,8 @@ def update_version_in_file(file_path: Path, new_version: str) -> bool:
new_content = pattern.sub(repl, new_content)
if file_would_be_updated:
file_path.write_text(new_content)
with file_path.open("w", encoding="utf-8", newline="\n") as file:
file.write(new_content)
return file_would_be_updated
@@ -114,7 +115,8 @@ def update_version_date_file() -> str:
print(f"No change to {VERSION_DATE_FILE}")
return str(VERSION_DATE_FILE)
VERSION_DATE_FILE.write_text(new_content, encoding="utf-8")
with VERSION_DATE_FILE.open("w", encoding="utf-8", newline="\n") as file:
file.write(new_content)
print(f"Updated {VERSION_DATE_FILE} with UTC date {version_date_str}")
return str(VERSION_DATE_FILE)