Skip to content

Commit 5651523

Browse files
committed
Fix mypy violations (with mypy-0.930)
1 parent 94acb19 commit 5651523

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
'lint': [
4545
'flake8>=3.5.0',
4646
'isort',
47-
'mypy>=0.920',
47+
'mypy>=0.930',
4848
'docutils-stubs',
4949
"types-typed-ast",
5050
"types-pkg_resources",

sphinx/environment/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,7 @@ def traverse_toctree(parent: str, docname: str) -> Iterator[Tuple[str, str]]:
621621

622622
def check_consistency(self) -> None:
623623
"""Do consistency checks."""
624-
included = set().union(*self.included.values()) # type: ignore
624+
included = set().union(*self.included.values())
625625
for docname in sorted(self.all_docs):
626626
if docname not in self.files_to_rebuild:
627627
if docname == self.config.root_doc:

sphinx/util/inspect.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ def unwrap_all(obj: Any, *, stop: Callable = None) -> Any:
134134
elif ispartial(obj):
135135
obj = obj.func
136136
elif inspect.isroutine(obj) and hasattr(obj, '__wrapped__'):
137-
obj = obj.__wrapped__
137+
obj = obj.__wrapped__ # type: ignore
138138
elif isclassmethod(obj):
139139
obj = obj.__func__
140140
elif isstaticmethod(obj):
@@ -692,7 +692,7 @@ def signature(subject: Callable, bound_method: bool = False, follow_wrapped: boo
692692
#
693693
# For example, this helps a function having a default value `inspect._empty`.
694694
# refs: https://github.com/sphinx-doc/sphinx/issues/7935
695-
return inspect.Signature(parameters, return_annotation=return_annotation, # type: ignore
695+
return inspect.Signature(parameters, return_annotation=return_annotation,
696696
__validate_parameters__=False)
697697

698698

@@ -820,14 +820,14 @@ def signature_from_ast(node: ast.FunctionDef, code: str = '') -> inspect.Signatu
820820
positionals = len(args.args)
821821

822822
for _ in range(len(defaults), positionals):
823-
defaults.insert(0, Parameter.empty)
823+
defaults.insert(0, Parameter.empty) # type: ignore
824824

825825
if hasattr(args, "posonlyargs"):
826826
for i, arg in enumerate(args.posonlyargs): # type: ignore
827827
if defaults[i] is Parameter.empty:
828828
default = Parameter.empty
829829
else:
830-
default = DefaultValue(ast_unparse(defaults[i], code))
830+
default = DefaultValue(ast_unparse(defaults[i], code)) # type: ignore
831831

832832
annotation = ast_unparse(arg.annotation, code) or Parameter.empty
833833
params.append(Parameter(arg.arg, Parameter.POSITIONAL_ONLY,
@@ -837,7 +837,7 @@ def signature_from_ast(node: ast.FunctionDef, code: str = '') -> inspect.Signatu
837837
if defaults[i + posonlyargs] is Parameter.empty:
838838
default = Parameter.empty
839839
else:
840-
default = DefaultValue(ast_unparse(defaults[i + posonlyargs], code))
840+
default = DefaultValue(ast_unparse(defaults[i + posonlyargs], code)) # type: ignore # NOQA
841841

842842
annotation = ast_unparse(arg.annotation, code) or Parameter.empty
843843
params.append(Parameter(arg.arg, Parameter.POSITIONAL_OR_KEYWORD,
@@ -849,7 +849,7 @@ def signature_from_ast(node: ast.FunctionDef, code: str = '') -> inspect.Signatu
849849
annotation=annotation))
850850

851851
for i, arg in enumerate(args.kwonlyargs):
852-
default = ast_unparse(args.kw_defaults[i], code) or Parameter.empty
852+
default = ast_unparse(args.kw_defaults[i], code) or Parameter.empty # type: ignore
853853
annotation = ast_unparse(arg.annotation, code) or Parameter.empty
854854
params.append(Parameter(arg.arg, Parameter.KEYWORD_ONLY, default=default,
855855
annotation=annotation))

sphinx/writers/manpage.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ def __init__(self, document: nodes.document, builder: Builder) -> None:
107107

108108
# Overwrite admonition label translations with our own
109109
for label, translation in admonitionlabels.items():
110-
self.language.labels[label] = self.deunicode(translation) # type: ignore
110+
self.language.labels[label] = self.deunicode(translation)
111111

112112
# overwritten -- added quotes around all .TH arguments
113113
def header(self) -> str:

0 commit comments

Comments
 (0)