Skip to content

Commit

Permalink
Complete mypy configuration (#206)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianthomas23 committed Jan 12, 2023
1 parent 61687fa commit e276557
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
@@ -1,3 +1,4 @@
recursive-include src *.h
recursive-include tests *.png *.py
recursive-include docs Makefile make.bat *.ico *.rst *.png *.py *.svg
include lib/contourpy/py.typed
9 changes: 6 additions & 3 deletions docs/sphinxext/name_supports.py
Expand Up @@ -29,9 +29,12 @@ def run(self) -> list[Any]:
"supports_z_interp",
]

filter_ = self.options.get("filter")
if filter_ is not None:
function_names = list(filter(lambda str: filter_ in str, function_names))
filter_string = self.options.get("filter")
if filter_string is not None:
function_name = f"supports_{filter_string}"
if function_name not in function_names:
raise ValueError(f"Invalid filter string '{filter_string}'")
function_names = [function_name]

table = Table(1 + len(names))
table.add_header([""] + names)
Expand Down
2 changes: 1 addition & 1 deletion docs/sphinxext/plot_directive.py
Expand Up @@ -66,7 +66,7 @@ def run(self: Any) -> list[Any]:
exec(self._mpl_mode_header(mode) + combined_source)
setattr(MplRenderer, "show", old_show)

images = []
images: list[nodes.Node] = []
for i, svg_filename in enumerate(svg_filenames):
image = nodes.image(uri=svg_filename)
if using_modes:
Expand Down
7 changes: 7 additions & 0 deletions pyproject.toml
Expand Up @@ -47,6 +47,13 @@ bokeh = [
"chromedriver",
"selenium",
]
mypy = [
# Requirements to run mypy to check type annotations.
"contourpy[bokeh]",
"docutils-stubs",
"mypy ==0.991",
"types-Pillow",
]
test = [
# Standard test dependencies.
"matplotlib",
Expand Down

0 comments on commit e276557

Please sign in to comment.