Skip to content

Commit

Permalink
fixup! feat: Better support for dataclasses
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Mar 5, 2024
1 parent f3b0f3b commit b78b2f2
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/griffe/extensions/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,17 @@ def load_extensions(
extensions.add(*ext)
else:
extensions.add(ext)

# TODO: Deprecate and remove at some point?
extensions.add(*_load_extension("dataclasses")) # type: ignore[misc]
# Always add our built-in dataclasses extension.
from griffe.extensions.dataclasses import DataclassesExtension

for ext in extensions._extensions:
if type(ext) == DataclassesExtension:
break
else:
extensions.add(*_load_extension("dataclasses")) # type: ignore[misc]

return extensions


Expand Down

0 comments on commit b78b2f2

Please sign in to comment.