Skip to content

Commit

Permalink
Merge pull request #97 from Zuehlke/docs/mypy
Browse files Browse the repository at this point in the history
Add mypy issues to docs
  • Loading branch information
silvanmelchior authored Jun 11, 2024
2 parents 6223e8b + b7bc105 commit 4e01ab7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/source/usage/mypy.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ConfZ and MyPy
==============

ConfZ heavily relies on Metaclasses for its lazy loading and singleton design. Unfortunately, MyPy has limited support
for them so far (see `docs <https://mypy.readthedocs.io/en/stable/metaclasses.html>`_). Thus, it is likely that you
will get an error similar to this::

Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

So far, the only solution is to ignore these errors::

class MyConfig(BaseConfig): # type: ignore
my_variable: bool

Future versions of MyPy might be able to correctly check ConfZ classes.
1 change: 1 addition & 0 deletions docs/source/usage/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ This part of the documentation contains user guides explaining all aspects of Co
context_manager
listeners
extensions
mypy

0 comments on commit 4e01ab7

Please sign in to comment.