Skip to content
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

Merged
merged 5 commits into from
Sep 12, 2024
Merged

Improve mypy checking #134

merged 5 commits into from
Sep 12, 2024

Conversation

arnasbr
Copy link
Contributor

@arnasbr arnasbr commented Sep 12, 2024

No description provided.

@arnasbr arnasbr self-assigned this Sep 12, 2024
Comment on lines +53 to 54
mypy --install-types --non-interactive .
mypy .
Copy link
Contributor Author

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",
Copy link
Contributor Author

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
Copy link
Contributor Author

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)
Copy link
Contributor Author

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]

@arnasbr arnasbr merged commit 6e8227b into master Sep 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants