Skip to content

Commit d2fe958

Browse files
committed
dev: Ignore for mypy's sake some superclass calls
types-docutils isn't sufficient with recent (?) mypy versions, causing: nextstrain/cli/rst/sphinx.py:71: error: "dispatch_visit" undefined in superclass nextstrain/cli/rst/sphinx.py:88: error: "dispatch_departure" undefined in superclass which seems to be because the docutils-stubs/nodes.pyi file installed by types-docutils contains def __getattr__(…) -> Any for nodes.NodeVisitor, which is apparently not understood by mypy. Typeshed knows it's docutils stubs aren't great.¹ The docutils-stubs distribution has a docutils-stubs/nodes.pyi² that mypy understands, but installing that then breaks pyright. Oy vey. ¹ python/typeshed#1269 ² Yes, both the docutils-stubs and types-docutils distributions install a "docutils-stubs" directory in Python's site-packages. This is how typestubs are supposed to be installed for the package "docutils".
1 parent a89e745 commit d2fe958

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nextstrain/cli/rst/sphinx.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def dispatch_visit(self, node: Node) -> None:
6868
method(node)
6969
break
7070
else:
71-
super().dispatch_visit(node)
71+
super().dispatch_visit(node) # type: ignore
7272

7373
def dispatch_departure(self, node: Node) -> None:
7474
"""
@@ -85,7 +85,7 @@ def dispatch_departure(self, node: Node) -> None:
8585
method(node)
8686
break
8787
else:
88-
super().dispatch_departure(node)
88+
super().dispatch_departure(node) # type: ignore
8989

9090

9191
# Originally from sphinx/writers/text.py (version 4.3.2)

0 commit comments

Comments
 (0)