Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/sphinx-doc/sphinx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup.py2
-rw-r--r--sphinx/domains/cpp.py5
-rw-r--r--sphinx/util/docutils.py2
-rw-r--r--sphinx/util/matching.py4
-rw-r--r--sphinx/util/pycompat.py2
5 files changed, 8 insertions, 7 deletions
diff --git a/setup.py b/setup.py
index 1f3999490..17d4f8fc6 100644
--- a/setup.py
+++ b/setup.py
@@ -47,7 +47,7 @@ extras_require = {
'html5lib',
'flake8>=3.5.0',
'flake8-import-order',
- 'mypy>=0.730',
+ 'mypy>=0.740',
'docutils-stubs',
],
}
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
index 417bdb2b6..2d948b853 100644
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -32,7 +32,8 @@ from sphinx.util.nodes import make_refnode
if False:
# For type annotation
- from typing import Any, Callable, Dict, Iterator, List, Match, Pattern, Tuple, Union # NOQA
+ from docutils.nodes import TextElement
+ from typing import Any, Callable, Dict, Iterator, List, Match, Pattern, Tuple, Type, Union # NOQA
from sphinx.application import Sphinx # NOQA
from sphinx.builders import Builder # NOQA
from sphinx.config import Config # NOQA
@@ -6980,7 +6981,7 @@ class CPPExprRole:
if asCode:
# render the expression as inline code
self.class_type = 'cpp-expr'
- self.node_type = nodes.literal
+ self.node_type = nodes.literal # type: Type[TextElement]
else:
# render the expression as inline text
self.class_type = 'cpp-texpr'
diff --git a/sphinx/util/docutils.py b/sphinx/util/docutils.py
index 0f732411c..e455d0aad 100644
--- a/sphinx/util/docutils.py
+++ b/sphinx/util/docutils.py
@@ -187,7 +187,7 @@ class sphinx_domains:
def __enter__(self) -> None:
self.enable()
- def __exit__(self, exc_type: "Type[Exception]", exc_value: Exception, traceback: Any) -> bool: # NOQA
+ def __exit__(self, exc_type: "Type[Exception]", exc_value: Exception, traceback: Any) -> bool: # type: ignore # NOQA
self.disable()
return False
diff --git a/sphinx/util/matching.py b/sphinx/util/matching.py
index 97eeff40f..cd8e16e20 100644
--- a/sphinx/util/matching.py
+++ b/sphinx/util/matching.py
@@ -9,7 +9,7 @@
"""
import re
-from typing import Callable, Dict, List, Match, Pattern
+from typing import Callable, Dict, Iterable, List, Match, Pattern
from sphinx.util.osutil import canon_path
@@ -96,7 +96,7 @@ def patmatch(name: str, pat: str) -> Match[str]:
return _pat_cache[pat].match(name)
-def patfilter(names: List[str], pat: str) -> List[str]:
+def patfilter(names: Iterable[str], pat: str) -> List[str]:
"""Return the subset of the list NAMES that match PAT.
Adapted from fnmatch module.
diff --git a/sphinx/util/pycompat.py b/sphinx/util/pycompat.py
index 06d3bcc2c..18c44ad18 100644
--- a/sphinx/util/pycompat.py
+++ b/sphinx/util/pycompat.py
@@ -55,7 +55,7 @@ class UnicodeMixin:
def __str__(self):
warnings.warn('UnicodeMixin is deprecated',
RemovedInSphinx40Warning, stacklevel=2)
- return self.__unicode__()
+ return self.__unicode__() # type: ignore
def execfile_(filepath: str, _globals: Any, open: Callable = open) -> None: