Skip to content

Commit 9a37053

Browse files
authored
Add mypy to dev dependencies (#8947)
1 parent 239309f commit 9a37053

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

pyproject.toml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ accel = ["scipy", "bottleneck", "numbagg", "flox", "opt_einsum"]
3333
complete = ["xarray[accel,io,parallel,viz,dev]"]
3434
dev = [
3535
"hypothesis",
36+
"mypy",
3637
"pre-commit",
3738
"pytest",
3839
"pytest-cov",
@@ -86,8 +87,8 @@ exclude_lines = ["pragma: no cover", "if TYPE_CHECKING"]
8687
[tool.mypy]
8788
enable_error_code = "redundant-self"
8889
exclude = [
89-
'xarray/util/generate_.*\.py',
90-
'xarray/datatree_/.*\.py',
90+
'xarray/util/generate_.*\.py',
91+
'xarray/datatree_/.*\.py',
9192
]
9293
files = "xarray"
9394
show_error_codes = true
@@ -98,8 +99,8 @@ warn_unused_ignores = true
9899

99100
# Ignore mypy errors for modules imported from datatree_.
100101
[[tool.mypy.overrides]]
101-
module = "xarray.datatree_.*"
102102
ignore_errors = true
103+
module = "xarray.datatree_.*"
103104

104105
# Much of the numerical computing stack doesn't have type annotations yet.
105106
[[tool.mypy.overrides]]
@@ -255,6 +256,9 @@ target-version = "py39"
255256
# E402: module level import not at top of file
256257
# E501: line too long - let black worry about that
257258
# E731: do not assign a lambda expression, use a def
259+
extend-safe-fixes = [
260+
"TID252", # absolute imports
261+
]
258262
ignore = [
259263
"E402",
260264
"E501",
@@ -268,9 +272,6 @@ select = [
268272
"I", # isort
269273
"UP", # Pyupgrade
270274
]
271-
extend-safe-fixes = [
272-
"TID252", # absolute imports
273-
]
274275

275276
[tool.ruff.lint.per-file-ignores]
276277
# don't enforce absolute imports

0 commit comments

Comments
 (0)