diff --git a/.buildkite/dagster-buildkite/dagster_buildkite/module_build_spec.py b/.buildkite/dagster-buildkite/dagster_buildkite/module_build_spec.py index e57d856e3b204..1072dec04bbb3 100644 --- a/.buildkite/dagster-buildkite/dagster_buildkite/module_build_spec.py +++ b/.buildkite/dagster-buildkite/dagster_buildkite/module_build_spec.py @@ -139,10 +139,7 @@ def get_tox_build_steps(self): if self.directory not in MYPY_EXCLUDES: tests.append( StepBuilder(f":mypy: {package}") - .run( - "pip install mypy==0.790", - f"mypy --config-file mypy/config {self.directory}", - ) + .run("pip install mypy==0.812", f"mypy --config-file mypy/config {self.directory}") .on_integration_image(SupportedPython.V3_7) .build() ) diff --git a/mypy/config b/mypy/config index 16c0a76005825..44830170151e0 100644 --- a/mypy/config +++ b/mypy/config @@ -3,9 +3,14 @@ python_version = 3.7 ignore_missing_imports = True show_error_codes = True allow_redefinition = True +exclude = (setup.py$)|(alembic/versions/[0-9a-z_]*.py$)|(alembic/env.py$) [mypy-dagster.seven] ignore_errors = True [mypy-dagster.grpc.__generated__.*] ignore_errors = True + +# https://github.com/python/mypy/issues/4008 +[dagster.generate.new_project.setup] +ignore_errors = True \ No newline at end of file diff --git a/python_modules/dagster/dagster/cli/workspace/workspace.py b/python_modules/dagster/dagster/cli/workspace/workspace.py index 10ce1c8ed8365..38702cfe04b09 100644 --- a/python_modules/dagster/dagster/cli/workspace/workspace.py +++ b/python_modules/dagster/dagster/cli/workspace/workspace.py @@ -214,7 +214,7 @@ def has_repository_location(self, location_name): check.str_param(location_name, "location_name") return self.get_repository_location(location_name) != None - def get_repository_location(self, location_name): + def get_repository_location(self, location_name: str) -> Optional[RepositoryLocation]: with self._lock: return ( self._location_entry_dict.get(location_name).repository_location diff --git a/python_modules/dagster/dagster/seven/compat/pendulum.py b/python_modules/dagster/dagster/seven/compat/pendulum.py index 851cc73c84d2e..2043f27c95c90 100644 --- a/python_modules/dagster/dagster/seven/compat/pendulum.py +++ b/python_modules/dagster/dagster/seven/compat/pendulum.py @@ -4,7 +4,8 @@ import pendulum _IS_PENDULUM_2 = ( - hasattr(pendulum, "__version__") and packaging.version.parse(pendulum.__version__).major == 2 + hasattr(pendulum, "__version__") + and getattr(packaging.version.parse(pendulum.__version__), "major") == 2 ) diff --git a/python_modules/dagster/dagster_tests/cli_tests/workspace_tests/multi_file_target_workspace/example_one/pipelines.py b/python_modules/dagster/dagster_tests/cli_tests/workspace_tests/multi_file_target_workspace/example_one/pipelines.py index 2f7e1e49c469c..df0d8fa356482 100644 --- a/python_modules/dagster/dagster_tests/cli_tests/workspace_tests/multi_file_target_workspace/example_one/pipelines.py +++ b/python_modules/dagster/dagster_tests/cli_tests/workspace_tests/multi_file_target_workspace/example_one/pipelines.py @@ -1,3 +1,4 @@ +# type: ignore[attr-defined] from dagster import pipeline from solids import example_one_solid # pylint: disable=import-error diff --git a/python_modules/dagster/dagster_tests/cli_tests/workspace_tests/multi_file_target_workspace/example_two/pipelines.py b/python_modules/dagster/dagster_tests/cli_tests/workspace_tests/multi_file_target_workspace/example_two/pipelines.py index a510d51b50964..5d255291a816e 100644 --- a/python_modules/dagster/dagster_tests/cli_tests/workspace_tests/multi_file_target_workspace/example_two/pipelines.py +++ b/python_modules/dagster/dagster_tests/cli_tests/workspace_tests/multi_file_target_workspace/example_two/pipelines.py @@ -1,3 +1,4 @@ +# type: ignore[attr-defined] from dagster import pipeline from solids import example_two_solid # pylint: disable=import-error diff --git a/python_modules/dagster/dagster_tests/general_tests/py3_tests/test_type_examples_py3.py b/python_modules/dagster/dagster_tests/general_tests/py3_tests/test_type_examples_py3.py index 38d52bd3978db..6c5cd22267794 100644 --- a/python_modules/dagster/dagster_tests/general_tests/py3_tests/test_type_examples_py3.py +++ b/python_modules/dagster/dagster_tests/general_tests/py3_tests/test_type_examples_py3.py @@ -1,3 +1,7 @@ +# See: https://github.com/dagster-io/dagster/issues/4209 +# type: ignore[valid-type] +# type: ignore[attr-defined] + import os import pickle import tempfile