-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve mypy checking #134
Conversation
mypy --install-types --non-interactive . | ||
mypy . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
first we run mypy just to see what types need to be installed, and install those types. Then we do the actual run
@@ -42,6 +42,7 @@ test = [ | |||
"flake8-pyproject", | |||
"mypy", | |||
"black", | |||
"types-shapely", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shapely types aren't installed by default with the --install-types
flag, so I install them explicitly for CI
@@ -58,7 +59,6 @@ extend-ignore = ["E203"] # See https://github.com/Py | |||
exclude = ["build/", "venv/", "traveltimepy/proto/"] | |||
|
|||
[tool.mypy] | |||
ignore_missing_imports = true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we no longer need to ignore missing imports
@@ -68,7 +68,7 @@ def _parse_polygon(geometry: Polygon) -> PolygonModel: | |||
PointModel(coordinates=Coordinates(lat=lat, lng=lng)) | |||
for lat, lng in interior.coords | |||
] | |||
for interior in geometry.interiors | |||
for interior in list(geometry.interiors) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixing error
Item "List[LinearRing]" of "Union[Iterator[LinearRing], List[LinearRing]]" has no attribute "__next__" [union-attr]
No description provided.