Skip to content

Replace Dynaconf with pydantic-settings-driven configuration loading#153

Draft
sagikimhi wants to merge 2 commits into
developfrom
codex/remove-dynaconf-and-use-pydantic-settings
Draft

Replace Dynaconf with pydantic-settings-driven configuration loading#153
sagikimhi wants to merge 2 commits into
developfrom
codex/remove-dynaconf-and-use-pydantic-settings

Conversation

@sagikimhi

Copy link
Copy Markdown
Owner

Motivation

  • Remove runtime dependence on dynaconf and rely on a lighter, explicit configuration stack that uses pydantic-settings for env-aware values and python-box for nested/dotted access and serialisation.
  • Provide a simple, maintainable loader that reads YAML/TOML/JSON, supports include chaining and jinja template expansion, and preserves existing settings access patterns across the codebase.

Description

  • Removed dynaconf from runtime dependencies and updated README/pyproject.toml to reflect the new stack (pydantic-settings + python-box).
  • Replaced the Dynaconf-backed Settings with a new Settings implementation in src/socx/config/_settings.py that uses box.Box for in-memory mapping, pydantic-settings for environment integration (SettingsEnv), supports settings_file/preload, load history, load_file (YAML/JSON/TOML), and @jinja template resolution.
  • Updated configuration bootstrap in src/socx/config/_config.py to use the new ensure_a_list and Settings class and preserved the LocalProxy settings behavior and user/local override loading flow.
  • Reworked serializers/encoders/validators to operate on the new Settings type and box.Box (src/socx/config/serializers.py, src/socx/config/encoders.py, src/socx/config/validators.py).
  • Replaced Dynaconf-specific converter plumbing with a local compatibility layer in src/socx/config/converters.py (introduces a lightweight Lazy shim and internal converter registry) and migrated callers (e.g., src/socx_plugins/git/summary.py) to use the new converters/API.
  • Replaced Dynaconf utilities usages across plugins: swapped DynaBox with box.Box, replaced Dynaconf file helpers with stdlib equivalents (e.g., glob) and local dedupe logic in src/socx_plugins/git/utils.py, and updated config CLI/history rendering to use box.Box.

Testing

  • Ran python -m compileall src/socx/config src/socx_plugins/git src/socx_plugins/config, which completed successfully.
  • Attempted to run PYTHONPATH=src python -m pytest tests/test_regression_loading.py -q, but test execution could not complete in this environment because package metadata for socx-cli is not installed (importlib.metadata.PackageNotFoundError), so full pytest validation was not possible here.

Codex Task

* feat(socx_tui): improve regression details, support saving/loading state

* fix(socx_tui): fix header and footer panel colors

Signed-off-by: Sagi Kimhi <sagi.kim5@gmail.com>

* chore(.gitignore): ignore regression dumps

Signed-off-by: Sagi Kimhi <sagi.kim5@gmail.com>

* chore: bump version to 0.13.3

Signed-off-by: Sagi Kimhi <sagi.kim5@gmail.com>

---------

Signed-off-by: Sagi Kimhi <sagi.kim5@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant