IBM / lmctl

Cloud Pak for Network Automation (CP4NA) (previously ALM/TNCO) command line tool
Apache License 2.0
4 stars 19 forks source link

Use Pydantic 1.9 #156

Closed dvaccarosenna closed 1 year ago

dvaccarosenna commented 1 year ago

There are breaking changes in Pydantic 1.10 which cause issues with dcutils from capturing arguments set during init. For the short term we'll add a restriction to remain on 1.9 and a separate issue will be raised to make dcutils compatible.

Traceback (most recent call last):
  File "/home/user/lmctl/tests/unit/utils/dcutils/test_dc_capture.py", line 122, in test_record_pydantic_dataclass
    self.assertEqual(records, (
AssertionError: Tuples differ: (Attr[24 chars]_on='NOT_SET'), AttrRecord(name='second', set_[53 chars]ET')) != (Attr[24 chars]_on='ON_INIT'), AttrRecord(name='second', set_[53 chars]ET'))

First differing element 0:
AttrRecord(name='first', set_on='NOT_SET')
AttrRecord(name='first', set_on='ON_INIT')

- (AttrRecord(name='first', set_on='NOT_SET'),
?                                    -- ^^

+ (AttrRecord(name='first', set_on='ON_INIT'),
?                                   +  ^^^

-  AttrRecord(name='second', set_on='NOT_SET'),
?                                     -- ^^

+  AttrRecord(name='second', set_on='ON_INIT'),
?                                    +  ^^^

   AttrRecord(name='third', set_on='NOT_SET'))
dvaccarosenna commented 1 year ago

Fixed by #157