Skip to content

Commit

Permalink
Upgrade mypy
Browse files Browse the repository at this point in the history
Summary: This will put us on current mypy (0.812)

Test Plan: Unit

Reviewers: dgibson, alangenfeld, schrockn, prha

Reviewed By: prha

Differential Revision: https://dagster.phacility.com/D8047
  • Loading branch information
mgasner committed May 26, 2021
1 parent e2b7333 commit ba312ca
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
)
Expand Down
5 changes: 5 additions & 0 deletions mypy/config
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion python_modules/dagster/dagster/cli/workspace/workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion python_modules/dagster/dagster/seven/compat/pendulum.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# type: ignore[attr-defined]
from dagster import pipeline
from solids import example_one_solid # pylint: disable=import-error

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# type: ignore[attr-defined]
from dagster import pipeline
from solids import example_two_solid # pylint: disable=import-error

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit ba312ca

Please sign in to comment.