Skip to content

Commit f8b0498

Browse files
authored
Merge pull request #21 from bckohan/dependabot/pip/mypy-tw-0.910
Update mypy requirement from ^0.790 to ^0.910
2 parents 85d310b + 0e7b28d commit f8b0498

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pytest = "^6.2"
5454
pytest-django = "^4.1.0"
5555
Sphinx = "^4.0.3"
5656
sphinx-rtd-theme = "^0.5.0"
57-
mypy = "^0.790"
57+
mypy = "^0.910"
5858
isort = "^5.6.4"
5959
doc8 = "^0.8.1"
6060
darglint = "^1.5.7"
@@ -66,6 +66,7 @@ deepdiff = "^5.2.3"
6666
safety = "^1.10.3"
6767
readme-renderer = "^29.0"
6868
pygount = "^1.2.4"
69+
types-PyYAML = "^5.1"
6970

7071
[build-system]
7172
requires = ["poetry-core>=1.0.0"]

render_static/resource.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@
88
import contextlib
99
import types
1010
from typing import Optional, Union
11+
import sys
12+
from functools import singledispatch
1113

1214
__all__ = ['resource']
1315

14-
15-
try:
16-
from importlib.resources import as_file, files # type: ignore
17-
except ImportError: # pragma: no cover
18-
# Use backport to PY<3.9 `importlib_resources`.
19-
# importlib_resources is included in python stdlib starting at 3.7 but
20-
# the files function is not available until python 3.9
21-
try:
16+
# Distinguishing between different versions of Python:
17+
if sys.version_info >= (3, 9):
18+
from importlib.resources import as_file, files # pragma: no cover, pylint: disable=E0611
19+
else:
20+
try: # pragma: no cover
2221
from importlib_resources import as_file, files
2322
except ImportError: # pragma: no cover
23+
@singledispatch
2424
def need_install(*args, **kwargs):
2525
"""
2626
On platforms <3.9, the importlib_resources backport needs to be available to use
@@ -68,12 +68,12 @@ def __new__(
6868
try:
6969
ref = files(package) / filename
7070
except ModuleNotFoundError:
71-
rsrc = super().__new__(cls, f'{package}: {filename}') # type: ignore
71+
rsrc = super().__new__(cls, f'{package}: {filename}')
7272
rsrc.module_not_found = True
7373
return rsrc
7474

7575
file_manager = contextlib.ExitStack()
76-
rsrc = super().__new__( # type: ignore
76+
rsrc = super().__new__(
7777
cls,
7878
file_manager.enter_context(as_file(ref)),
7979
)

render_static/url_tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def visit_pattern( # pylint: disable=R0914, R0915, R0912
355355
if non_capturing > 0:
356356
# handle the corner case where there might be some non-capturing groups
357357
# driving up the number of expected args
358-
resolved_placeholders = itertools.chain(
358+
resolved_placeholders = itertools.chain( # type: ignore
359359
resolved_placeholders,
360360
*resolve_unnamed_placeholders(
361361
url_name=endpoint.name,

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ warn_redundant_casts = True
5959
warn_unused_configs = True
6060
warn_unreachable = True
6161
warn_no_return = True
62+
exclude = tests
6263

6364

6465
[doc8]

0 commit comments

Comments
 (0)