Skip to content

Commit

Permalink
fix mypy errors (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
2bndy5 committed Nov 10, 2022
1 parent 09b41f9 commit 4eb8655
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
8 changes: 5 additions & 3 deletions sphinx_immaterial/apidoc/python/parameter_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,11 @@ def handle_item(fieldarg: str, content: Any) -> docutils.nodes.Node:
domain,
typename,
docutils.nodes.Text,
env=env,
inliner=inliner,
location=location,
env=cast(sphinx.environment.BuildEnvironment, env),
inliner=cast(
docutils.parsers.rst.states.Inliner, inliner
),
location=cast(docutils.nodes.Node, location),
)
)
)
Expand Down
2 changes: 1 addition & 1 deletion sphinx_immaterial/graphviz.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def render_dot_html(
code: str,
options: dict,
prefix: str = "graphviz",
imgcls: str = None,
imgcls: Optional[str] = None,
alt: Optional[str] = None,
filename: Optional[str] = None,
) -> Tuple[str, str]:
Expand Down
4 changes: 2 additions & 2 deletions tests/python_apigen_test_modules/_alpha.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def my_method_Alpha(self) -> int:
This is paragraph two.
"""
pass
return 1

@property
def my_property_Alpha(self) -> str:
Expand All @@ -21,4 +21,4 @@ def my_property_Alpha(self) -> str:
This is paragraph two.
"""
pass
return "alpha"
4 changes: 2 additions & 2 deletions tests/python_apigen_test_modules/_bravo.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def my_method_Bravo(self) -> int:
This is paragraph two.
"""
pass
return 1

@property
def my_property_Bravo(self) -> str:
Expand All @@ -18,4 +18,4 @@ def my_property_Bravo(self) -> str:
This is paragraph two.
"""
pass
return "bravo"
6 changes: 3 additions & 3 deletions tests/python_apigen_test_modules/classmethod.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
class Foo:
@classmethod
def my_classmethod(cls, arg: str) -> int:
pass
return 1

@staticmethod
def my_staticmethod(arg: str) -> int:
pass
return 1

def my_method(self, arg: str) -> int:
pass
return 1

0 comments on commit 4eb8655

Please sign in to comment.