tmt
tmt copied to clipboard
Move dataclass to dedicated module
A few reasons for this move:
- It would make migrating to
attrs
more easy #2831 - Plugin developers should use the same dataclass type
- This would allow some neat customization, e.g. if we add https://github.com/rr-/docstring_parser, we can move the
help
to the attribute's docsting
A few things to point out:
- All
dataclass
andfield
usage are now unified and populate themetadata
. In principle this should be fine since it would just populate a field that would never be used, but should we do something else there to distinguish betweenDataContainer
type of dataclasses and plaindataclass
like the ones inhardware.py
? - The import syntax is a bit disjoint. The naming of
dataclasses
and thefrom import
is done like this in order to minimize the diffs for the purpose of initial review, but I think we should change it to be more uniform w.r.t. full nametmt.dataclasses.dataclass
vs short namefield
Pull Request Checklist
- [x] implement the feature
- [ ] write the documentation