Skip to content

Support List/Tuple/Dict of dataclasses via CLI and config files#30

Open
yairf11 wants to merge 3 commits intomasterfrom
nested_dataclasses
Open

Support List/Tuple/Dict of dataclasses via CLI and config files#30
yairf11 wants to merge 3 commits intomasterfrom
nested_dataclasses

Conversation

@yairf11
Copy link
Copy Markdown
Collaborator

@yairf11 yairf11 commented Mar 1, 2026

Summary

  • Add support for container-of-dataclass fields (List[DC], Tuple[DC, ...], Dict[str, DC]) as first-class citizens, settable via CLI as YAML/JSON strings (e.g. --points '[{x: 1.0, y: 2.0}]'), config files, and encode/decode
  • Add is_dict_of_dataclasses utility; replace the previous NotImplementedError with working FieldWrapper registration
  • Deeply nested structures supported (e.g. List[DC] where each DC contains a Dict[str, DC])
  • Bump version to 0.3.2
  • Drop Python 3.7/3.8 support (bump to >=3.9, remove dataclasses backport dep)
  • Update CI matrix to Python 3.9–3.13, bump actions to v4/v5
  • Fix mutable default warnings in test fixtures

Test plan

  • 78 new tests in tests/test_nested_dataclass_containers.py covering encode/decode, config file parsing, CLI args, and deeply nested containers
  • Full test suite passes (355 tests)
  • CI passes on Python 3.9–3.13 (ubuntu + macOS)

yairf11 added 3 commits March 1, 2026 09:18
…ode/decode

Add support for container-of-dataclass fields (List[DC], Tuple[DC, ...],
Dict[str, DC]) as first-class citizens. These can now be set from the
command line as YAML/JSON strings (e.g. --points '[{x: 1.0, y: 2.0}]'),
from config files, and via encode/decode. Deeply nested structures are
also supported.

- Add is_dict_of_dataclasses utility and wire it into DataclassWrapper
- Replace NotImplementedError with working FieldWrapper registration
- Add 78 tests covering encode/decode, config file, CLI, and deep nesting
- Document the feature in README, docs/step_by_step, and docs/api
- Bump version to 0.3.2
- Drop Python 3.6 support (bump to >=3.7, remove dataclasses backport)
- Update CI to Python 3.7-3.12, actions v4/v5
- Fix mutable default warnings in test fixtures
Python 3.7 and 3.8 are no longer available on ubuntu-latest (24.04),
causing all CI jobs to fail via fail-fast cancellation. Bump minimum
supported version to 3.9 and add 3.13 to the matrix.
This file was not under .github/workflows/ and was never run by CI.
The active workflow is .github/workflows/pytest.yml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant