Open epenet opened 3 weeks ago
My guess is that this is more of a typeguard
vs renault-api
issue.
Previous to marshmallow_dataclass 8.7.0, typeguard was pinned to < 3. 8.7.0 relaxes that pin to allow for typeguard 4.x. (#250, #260) The new behavior appears to be caused by the switch to typeguard 4.
From the traceback, this appears to have something to do with the use of typeguards import hook. In your case, the import hook appears to be installed through the use of the typeguard's pytest plugin.
OK - I'm making progress, but I am still confused.
It seems that the CI with marshmallow_dataclass
8.6.1, typeguard
gets installed with version 4.3.0
But with marshmallow_dataclass
8.7.0, typeguard
gets downgraded to version 4.0.1
$ pip show typeguard
Name: typeguard
Version: 4.3.0
$ pip show marshmallow-dataclass
Name: marshmallow_dataclass
Version: 8.6.1
$ pip show typing-inspect
Name: typing-inspect
Version: 0.8.0
==> OK
vs
$ pip show typeguard
Name: typeguard
Version: 4.0.1
$ pip show marshmallow-dataclass
Name: marshmallow_dataclass
Version: 8.7.0
$ pip show typing-inspect
Name: typing-inspect
Version: 0.9.0
==> SyntaxError: from __future__ imports must occur at the beginning of the file
OK - it seems the issue does come from marshmallow-dataclass, which restricts:
typeguard
version to ">=4.0.0,<4.1.0"
typing-inspect
version to ">=0.9.0,<0.10.0"
Should then not be loosened up?
install_requires=[
"marshmallow>=3.18.0,",
"typing-inspect>=0.9.0",
"typeguard>=4.0.0",
# Need `dataclass_transform(field_specifiers)`
"typing-extensions>=4.2.0; python_version<'3.11'",
]
It worked fine with 8.6.1 See https://github.com/hacf-fr/renault-api/pull/1234