dan-fritchman / Hdl21

Hardware Description Library
BSD 3-Clause "New" or "Revised" License
60 stars 13 forks source link

Python 3.11 + Pydantic 1.9 Combo Fails #151

Closed dan-fritchman closed 1 year ago

dan-fritchman commented 1 year ago

In the big test matrix here: https://github.com/dan-fritchman/Hdl21/actions/runs/5371070366

This is the one combo that fails: https://github.com/dan-fritchman/Hdl21/actions/runs/5371070366/jobs/9743583888

Appears to be all about what counts as a typing.Type. And for whatever reason it doesn't think our parameter-classes count:

  File "/...site-packages/pydantic/dataclasses.py", line 100, in _pydantic_post_init
    raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for Primitive
paramtype
  subclass of Any expected (type=type_error.subclass; expected_class=Any)
dan-fritchman commented 1 year ago

Filed this: https://github.com/pydantic/pydantic/issues/6245

https://github.com/dan-fritchman/Hdl21/pull/148/commits/1300968ae639d8633e3a06e2bbb65a8d76ef99be is the (two line, pretty inscrutable) "fix", replacing fields of type typing.Type with typing.Type[object].