Skip to content

Commit 67429d4

Browse files
CI: Unpin MyPy (#36012)
1 parent bdd5d4c commit 67429d4

File tree

8 files changed

+81
-16
lines changed

8 files changed

+81
-16
lines changed

environment.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ dependencies:
2121
- flake8-comprehensions>=3.1.0 # used by flake8, linting of unnecessary comprehensions
2222
- flake8-rst>=0.6.0,<=0.7.0 # linting of code blocks in rst files
2323
- isort>=5.2.1 # check that imports are in the right order
24-
- mypy=0.730
24+
- mypy=0.782
2525
- pycodestyle # used by flake8
2626

2727
# documentation

pandas/_config/config.py

+1-3
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,7 @@ def register_option(
460460
path = key.split(".")
461461

462462
for k in path:
463-
# NOTE: tokenize.Name is not a public constant
464-
# error: Module has no attribute "Name" [attr-defined]
465-
if not re.match("^" + tokenize.Name + "$", k): # type: ignore[attr-defined]
463+
if not re.match("^" + tokenize.Name + "$", k):
466464
raise ValueError(f"{k} is not a valid identifier")
467465
if keyword.iskeyword(k):
468466
raise ValueError(f"{k} is a python keyword")

pandas/core/common.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
from datetime import datetime, timedelta
1010
from functools import partial
1111
import inspect
12-
from typing import Any, Collection, Iterable, Iterator, List, Union
12+
from typing import Any, Collection, Iterable, Iterator, List, Union, cast
1313
import warnings
1414

1515
import numpy as np
@@ -277,6 +277,11 @@ def maybe_iterable_to_list(obj: Union[Iterable[T], T]) -> Union[Collection[T], T
277277
"""
278278
if isinstance(obj, abc.Iterable) and not isinstance(obj, abc.Sized):
279279
return list(obj)
280+
# error: Incompatible return value type (got
281+
# "Union[pandas.core.common.<subclass of "Iterable" and "Sized">,
282+
# pandas.core.common.<subclass of "Iterable" and "Sized">1, T]", expected
283+
# "Union[Collection[T], T]") [return-value]
284+
obj = cast(Collection, obj)
280285
return obj
281286

282287

pandas/core/computation/expr.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ class BaseExprVisitor(ast.NodeVisitor):
364364

365365
unary_ops = _unary_ops_syms
366366
unary_op_nodes = "UAdd", "USub", "Invert", "Not"
367-
unary_op_nodes_map = dict(zip(unary_ops, unary_op_nodes))
367+
unary_op_nodes_map = {k: v for k, v in zip(unary_ops, unary_op_nodes)}
368368

369369
rewrite_map = {
370370
ast.Eq: ast.In,

pandas/core/indexes/frozen.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,7 @@ def __str__(self) -> str:
103103
def __repr__(self) -> str:
104104
return f"{type(self).__name__}({str(self)})"
105105

106-
__setitem__ = __setslice__ = __delitem__ = __delslice__ = _disabled
107-
pop = append = extend = remove = sort = insert = _disabled
106+
__setitem__ = __setslice__ = _disabled # type: ignore[assignment]
107+
__delitem__ = __delslice__ = _disabled # type: ignore[assignment]
108+
pop = append = extend = _disabled # type: ignore[assignment]
109+
remove = sort = insert = _disabled # type: ignore[assignment]

pandas/core/resample.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -966,8 +966,7 @@ def __init__(self, obj, *args, **kwargs):
966966
for attr in self._attributes:
967967
setattr(self, attr, kwargs.get(attr, getattr(parent, attr)))
968968

969-
# error: Too many arguments for "__init__" of "object"
970-
super().__init__(None) # type: ignore[call-arg]
969+
super().__init__(None)
971970
self._groupby = groupby
972971
self._groupby.mutated = True
973972
self._groupby.grouper.mutated = True

requirements-dev.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ flake8<3.8.0
1212
flake8-comprehensions>=3.1.0
1313
flake8-rst>=0.6.0,<=0.7.0
1414
isort>=5.2.1
15-
mypy==0.730
15+
mypy==0.782
1616
pycodestyle
1717
gitpython
1818
gitdb

setup.cfg

+66-5
Original file line numberDiff line numberDiff line change
@@ -127,10 +127,7 @@ show_error_codes = True
127127
[mypy-pandas.tests.*]
128128
check_untyped_defs=False
129129

130-
[mypy-pandas.conftest]
131-
ignore_errors=True
132-
133-
[mypy-pandas.tests.tools.test_to_datetime]
130+
[mypy-pandas.conftest,pandas.tests.window.conftest]
134131
ignore_errors=True
135132

136133
[mypy-pandas._testing]
@@ -139,7 +136,22 @@ check_untyped_defs=False
139136
[mypy-pandas._version]
140137
check_untyped_defs=False
141138

142-
[mypy-pandas.core.arrays.interval]
139+
[mypy-pandas.compat.pickle_compat]
140+
check_untyped_defs=False
141+
142+
[mypy-pandas.core.apply]
143+
check_untyped_defs=False
144+
145+
[mypy-pandas.core.arrays.base]
146+
check_untyped_defs=False
147+
148+
[mypy-pandas.core.arrays.datetimelike]
149+
check_untyped_defs=False
150+
151+
[mypy-pandas.core.arrays.sparse.array]
152+
check_untyped_defs=False
153+
154+
[mypy-pandas.core.arrays.string_]
143155
check_untyped_defs=False
144156

145157
[mypy-pandas.core.base]
@@ -151,6 +163,9 @@ check_untyped_defs=False
151163
[mypy-pandas.core.computation.expressions]
152164
check_untyped_defs=False
153165

166+
[mypy-pandas.core.computation.ops]
167+
check_untyped_defs=False
168+
154169
[mypy-pandas.core.computation.pytables]
155170
check_untyped_defs=False
156171

@@ -163,6 +178,9 @@ check_untyped_defs=False
163178
[mypy-pandas.core.generic]
164179
check_untyped_defs=False
165180

181+
[mypy-pandas.core.groupby.base]
182+
check_untyped_defs=False
183+
166184
[mypy-pandas.core.groupby.generic]
167185
check_untyped_defs=False
168186

@@ -172,15 +190,33 @@ check_untyped_defs=False
172190
[mypy-pandas.core.groupby.ops]
173191
check_untyped_defs=False
174192

193+
[mypy-pandas.core.indexes.base]
194+
check_untyped_defs=False
195+
196+
[mypy-pandas.core.indexes.category]
197+
check_untyped_defs=False
198+
199+
[mypy-pandas.core.indexes.datetimelike]
200+
check_untyped_defs=False
201+
175202
[mypy-pandas.core.indexes.datetimes]
176203
check_untyped_defs=False
177204

205+
[mypy-pandas.core.indexes.extension]
206+
check_untyped_defs=False
207+
178208
[mypy-pandas.core.indexes.interval]
179209
check_untyped_defs=False
180210

181211
[mypy-pandas.core.indexes.multi]
182212
check_untyped_defs=False
183213

214+
[mypy-pandas.core.indexes.period]
215+
check_untyped_defs=False
216+
217+
[mypy-pandas.core.indexes.range]
218+
check_untyped_defs=False
219+
184220
[mypy-pandas.core.internals.blocks]
185221
check_untyped_defs=False
186222

@@ -190,15 +226,27 @@ check_untyped_defs=False
190226
[mypy-pandas.core.internals.managers]
191227
check_untyped_defs=False
192228

229+
[mypy-pandas.core.internals.ops]
230+
check_untyped_defs=False
231+
193232
[mypy-pandas.core.missing]
194233
check_untyped_defs=False
195234

196235
[mypy-pandas.core.ops.docstrings]
197236
check_untyped_defs=False
198237

238+
[mypy-pandas.core.resample]
239+
check_untyped_defs=False
240+
241+
[mypy-pandas.core.reshape.concat]
242+
check_untyped_defs=False
243+
199244
[mypy-pandas.core.reshape.merge]
200245
check_untyped_defs=False
201246

247+
[mypy-pandas.core.series]
248+
check_untyped_defs=False
249+
202250
[mypy-pandas.core.strings]
203251
check_untyped_defs=False
204252

@@ -214,6 +262,9 @@ check_untyped_defs=False
214262
[mypy-pandas.io.clipboard]
215263
check_untyped_defs=False
216264

265+
[mypy-pandas.io.common]
266+
check_untyped_defs=False
267+
217268
[mypy-pandas.io.excel._base]
218269
check_untyped_defs=False
219270

@@ -226,6 +277,9 @@ check_untyped_defs=False
226277
[mypy-pandas.io.formats.css]
227278
check_untyped_defs=False
228279

280+
[mypy-pandas.io.formats.csvs]
281+
check_untyped_defs=False
282+
229283
[mypy-pandas.io.formats.excel]
230284
check_untyped_defs=False
231285

@@ -264,3 +318,10 @@ check_untyped_defs=False
264318

265319
[mypy-pandas.plotting._matplotlib.misc]
266320
check_untyped_defs=False
321+
322+
[mypy-pandas.plotting._misc]
323+
check_untyped_defs=False
324+
325+
[mypy-pandas.util._decorators]
326+
check_untyped_defs=False
327+

0 commit comments

Comments
 (0)