-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,6 +42,7 @@ test = [ | |
"flake8-pyproject", | ||
"mypy", | ||
"black", | ||
"types-shapely", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shapely types aren't installed by default with the |
||
] | ||
|
||
[tool.setuptools] | ||
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. we no longer need to ignore missing imports |
||
exclude = "^(traveltimepy/proto/.*|build/.*|venv/.*)$" | ||
|
||
[[tool.mypy.overrides]] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe reason will be displayed to describe this comment to others. Learn more. fixing error
|
||
] | ||
exterior_line = LineStringModel(coordinates=exterior_points) | ||
interior_lines = [ | ||
|
@@ -123,7 +123,7 @@ def _parse_multi_polygon(geometry: MultiPolygon) -> MultiPolygonModel: | |
for point in interior.coords | ||
], | ||
) | ||
for interior in polygon.interiors | ||
for interior in list(polygon.interiors) | ||
], | ||
) | ||
for polygon in geometry.geoms | ||
|
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