From e6ab37c3a480a6d3ad26e450bbe84cf0f3b38e8c Mon Sep 17 00:00:00 2001 From: Maximilian Roos Date: Mon, 15 Apr 2024 14:38:29 -0700 Subject: [PATCH] Add mypy to dev dependencies --- pyproject.toml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index bdbfd9b52ab..15a3c99eec2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,6 +33,7 @@ accel = ["scipy", "bottleneck", "numbagg", "flox", "opt_einsum"] complete = ["xarray[accel,io,parallel,viz,dev]"] dev = [ "hypothesis", + "mypy", "pre-commit", "pytest", "pytest-cov", @@ -86,8 +87,8 @@ exclude_lines = ["pragma: no cover", "if TYPE_CHECKING"] [tool.mypy] enable_error_code = "redundant-self" exclude = [ - 'xarray/util/generate_.*\.py', - 'xarray/datatree_/.*\.py', + 'xarray/util/generate_.*\.py', + 'xarray/datatree_/.*\.py', ] files = "xarray" show_error_codes = true @@ -98,8 +99,8 @@ warn_unused_ignores = true # Ignore mypy errors for modules imported from datatree_. [[tool.mypy.overrides]] -module = "xarray.datatree_.*" ignore_errors = true +module = "xarray.datatree_.*" # Much of the numerical computing stack doesn't have type annotations yet. [[tool.mypy.overrides]] @@ -255,6 +256,9 @@ target-version = "py39" # E402: module level import not at top of file # E501: line too long - let black worry about that # E731: do not assign a lambda expression, use a def +extend-safe-fixes = [ + "TID252", # absolute imports +] ignore = [ "E402", "E501", @@ -268,9 +272,6 @@ select = [ "I", # isort "UP", # Pyupgrade ] -extend-safe-fixes = [ - "TID252", # absolute imports -] [tool.ruff.lint.per-file-ignores] # don't enforce absolute imports