Support List/Tuple/Dict of dataclasses via CLI and config files#30
Open
Support List/Tuple/Dict of dataclasses via CLI and config files#30
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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/decodeis_dict_of_dataclassesutility; replace the previousNotImplementedErrorwith workingFieldWrapperregistrationList[DC]where each DC contains aDict[str, DC])>=3.9, removedataclassesbackport dep)Test plan
tests/test_nested_dataclass_containers.pycovering encode/decode, config file parsing, CLI args, and deeply nested containers