Closed winddon closed 1 year ago
Encountered with the same issue and may confirm that the latest release of typing-inspect
(0.8.0
) is breaking it because with 0.7.1
it worked like a charm.
The problem is with custom types created with NewType
. For those field_for_schema
calls typing_inspect.is_new_type(typ)
, but this function has been "made more robust" for v0.8.0. Since then the function returns False
while previously it returned True
.
All the new checks there work, except the one for module, that requires it to be in ('typing', 'typing_extensions')
, while ours is from marshmallow_dataclass
.
I successfully worked this around by adding
# hack alert :P
new_type.__module__ = 'typing'
into local NewType
, but that's hardly a nice solution :frowning_face:
Maybe this might be a better fix (that also works for me, btw): https://github.com/lovasoa/marshmallow_dataclass/pull/207
Fixed in marshmallow-dataclass==8.5.9
via #207, #211.
Dependency of
typing-inspect>=0.7.1
is breaking this package. the latest release typing-inspect==0.8.0 gives the issue,