From b7bc10553dddce5a3d05e545102f61941a148dd1 Mon Sep 17 00:00:00 2001 From: Silvan Melchior Date: Tue, 11 Jun 2024 14:53:54 +0200 Subject: [PATCH] add mypy issues to docs --- docs/source/usage/mypy.rst | 15 +++++++++++++++ docs/source/usage/usage.rst | 1 + 2 files changed, 16 insertions(+) create mode 100644 docs/source/usage/mypy.rst diff --git a/docs/source/usage/mypy.rst b/docs/source/usage/mypy.rst new file mode 100644 index 0000000..6fadaf3 --- /dev/null +++ b/docs/source/usage/mypy.rst @@ -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 `_). 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. diff --git a/docs/source/usage/usage.rst b/docs/source/usage/usage.rst index 7e4292c..d93465a 100644 --- a/docs/source/usage/usage.rst +++ b/docs/source/usage/usage.rst @@ -12,3 +12,4 @@ This part of the documentation contains user guides explaining all aspects of Co context_manager listeners extensions + mypy