Is your feature request related to a problem? Please describe.
As explained in #156 there are incompatibilities between dcutils of lmctl and Pydantic 1.1.0. The issue can be shown by installing Pydantic 1.10.x and running python3 -m unittest tests.unit.utils.dcutils.test_dc_capture.TestRecordAttrs.test_record_pydantic_dataclass from lmctl. The test will fail.
It seems like the __init__ function of Pydantic dataclasses has changed so the _wrap_init method of lmctl.utils.dcutils.dc_capture can no longer infer the arguments of the constructor. The below snippet from _wrap_init is the root of the problem. The value of expected_args is [] when it previously returned the argument specs in the constructor, in order of definition:
init_arg_spec = inspect.getfullargspec(existing_init)
expected_args = init_arg_spec.args
Describe the solution you'd like
For lmctl to work with Pydantic 1.10.x, ideally without losing the functionality of dcutils. Alternatively, we'll have to replace usage of dcutils, which is used to guide the attributes to be included when deserializing a dataclass into YAML/JSON. This is particularly useful when rewriting the lmctl config file as it avoids writing attributes that have defaults but were never set by the user.
Is your feature request related to a problem? Please describe.
As explained in #156 there are incompatibilities between
dcutilsof lmctl and Pydantic 1.1.0. The issue can be shown by installing Pydantic 1.10.x and runningpython3 -m unittest tests.unit.utils.dcutils.test_dc_capture.TestRecordAttrs.test_record_pydantic_dataclassfrom lmctl. The test will fail.It seems like the
__init__function of Pydantic dataclasses has changed so the_wrap_initmethod oflmctl.utils.dcutils.dc_capturecan no longer infer the arguments of the constructor. The below snippet from_wrap_initis the root of the problem. The value ofexpected_argsis[]when it previously returned the argument specs in the constructor, in order of definition:Describe the solution you'd like
For lmctl to work with Pydantic 1.10.x, ideally without losing the functionality of
dcutils. Alternatively, we'll have to replace usage ofdcutils, which is used to guide the attributes to be included when deserializing a dataclass into YAML/JSON. This is particularly useful when rewriting the lmctl config file as it avoids writing attributes that have defaults but were never set by the user.