diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ec228fec..d8aef104 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,9 +30,7 @@ jobs: - name: 🧹 Lint with flake8 run: | make check_code_quality - - name: 🧪 Test - run: "python -m unittest" - name: Check types with mypy run: mypy . - # TODO: Fix typing - continue-on-error: true + - name: 🧪 Test + run: "python -m unittest" diff --git a/pyproject.toml b/pyproject.toml index bb3161d7..b418756a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -143,17 +143,17 @@ exclude = [ ] [[tool.mypy.overrides]] -module = "_datetime.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = "requests_toolbelt.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = "ultralytics.*" -ignore_missing_imports = true - -[[tool.mypy.overrides]] -module = "ipywidgets.*" +module = [ + "_datetime.*", + # IPython is an optional dependency + "IPython.display.*", + # ipywidgets is an optional dependency + "ipywidgets.*", + # matplotlib typing is not available for Python 3.8 + # remove this when we stop supporting Python 3.8 + "matplotlib.*", + "requests_toolbelt.*", + "torch.*", + "ultralytics.*", +] ignore_missing_imports = true diff --git a/roboflow/models/semantic_segmentation.py b/roboflow/models/semantic_segmentation.py index e41bad52..4ae974c0 100644 --- a/roboflow/models/semantic_segmentation.py +++ b/roboflow/models/semantic_segmentation.py @@ -18,7 +18,7 @@ def __init__(self, api_key: str, version_id: str): super(SemanticSegmentationModel, self).__init__(api_key, version_id) self.api_url = f"{SEMANTIC_SEGMENTATION_URL}/{self.dataset_id}/{self.version}" - def predict(self, image_path: str, confidence: int = 50): + def predict(self, image_path: str, confidence: int = 50): # type: ignore[override] """ Infers detections based on image from a specified model and image path. diff --git a/roboflow/models/video.py b/roboflow/models/video.py index 35366a97..1d474a56 100644 --- a/roboflow/models/video.py +++ b/roboflow/models/video.py @@ -56,7 +56,7 @@ def __init__( """ # noqa: E501 // docs self.__api_key = api_key - def predict( + def predict( # type: ignore[override] self, video_path: str, inference_type: str, @@ -124,7 +124,7 @@ def predict( { "model_id": self.dataset_id, "model_version": self.version, - "inference_type": self.inference_type, + "inference_type": inference_type, } ]