Skip to content

Commit 813d56f

Browse files
authored
Merge pull request #275 from roboflow/iuri/mypy-5
Fix last mypy issues
2 parents 20bdab5 + 2f34baa commit 813d56f

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

.github/workflows/test.yml

+2-4
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,7 @@ jobs:
3030
- name: 🧹 Lint with flake8
3131
run: |
3232
make check_code_quality
33-
- name: 🧪 Test
34-
run: "python -m unittest"
3533
- name: Check types with mypy
3634
run: mypy .
37-
# TODO: Fix typing
38-
continue-on-error: true
35+
- name: 🧪 Test
36+
run: "python -m unittest"

pyproject.toml

+13-13
Original file line numberDiff line numberDiff line change
@@ -143,17 +143,17 @@ exclude = [
143143
]
144144

145145
[[tool.mypy.overrides]]
146-
module = "_datetime.*"
147-
ignore_missing_imports = true
148-
149-
[[tool.mypy.overrides]]
150-
module = "requests_toolbelt.*"
151-
ignore_missing_imports = true
152-
153-
[[tool.mypy.overrides]]
154-
module = "ultralytics.*"
155-
ignore_missing_imports = true
156-
157-
[[tool.mypy.overrides]]
158-
module = "ipywidgets.*"
146+
module = [
147+
"_datetime.*",
148+
# IPython is an optional dependency
149+
"IPython.display.*",
150+
# ipywidgets is an optional dependency
151+
"ipywidgets.*",
152+
# matplotlib typing is not available for Python 3.8
153+
# remove this when we stop supporting Python 3.8
154+
"matplotlib.*",
155+
"requests_toolbelt.*",
156+
"torch.*",
157+
"ultralytics.*",
158+
]
159159
ignore_missing_imports = true

roboflow/models/semantic_segmentation.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def __init__(self, api_key: str, version_id: str):
1818
super(SemanticSegmentationModel, self).__init__(api_key, version_id)
1919
self.api_url = f"{SEMANTIC_SEGMENTATION_URL}/{self.dataset_id}/{self.version}"
2020

21-
def predict(self, image_path: str, confidence: int = 50):
21+
def predict(self, image_path: str, confidence: int = 50): # type: ignore[override]
2222
"""
2323
Infers detections based on image from a specified model and image path.
2424

roboflow/models/video.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def __init__(
5656
""" # noqa: E501 // docs
5757
self.__api_key = api_key
5858

59-
def predict(
59+
def predict( # type: ignore[override]
6060
self,
6161
video_path: str,
6262
inference_type: str,
@@ -124,7 +124,7 @@ def predict(
124124
{
125125
"model_id": self.dataset_id,
126126
"model_version": self.version,
127-
"inference_type": self.inference_type,
127+
"inference_type": inference_type,
128128
}
129129
]
130130

0 commit comments

Comments
 (0)