Skip to content

Commit

Permalink
Remove symlinks and reactivate mypy check in CI (#61)
Browse files Browse the repository at this point in the history
* chore: tell mypy detic_ros module location

* fix: import detic_ros modules in batch_processor

* ci: remove symlink as mypy cant be configure to exclude them
  • Loading branch information
HiroIshida authored Feb 7, 2025
1 parent f6eb224 commit 7ba37a3
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/peripheral.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ jobs:
- name: pip install formatters and mypy
run: |
pip3 install mypy flake8 isort
# Temporary commented out due to avoid testing submodule packages
# TODO (HiroIshida) fix
# - name: check by mypy
# run: |
# pip3 install -r requirements.txt
# pip3 install numpy==1.23 # to enable numpy's type checking
# mypy --version
# mypy .

- name: check by mypy
run: |
rm node_script/detic node_script/third_party # remove symlinks. (cannot configure to exclude them by mypy somehow)
pip3 install -r requirements.txt
pip3 install numpy==1.23 # to enable numpy's type checking
mypy --version
mypy .
- name: check by isort and flake8
run: |
python3 -m isort example/ test/ node_script/
Expand Down
11 changes: 9 additions & 2 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ exclude = Detic
show_error_codes = True
warn_unused_ignores = False
check_untyped_defs = True
mypy_path = src

[mypy-setuptools.*]
ignore_missing_imports = True
[mypy-catkin_pkg.*]
ignore_missing_imports = True
[mypy-cv_bridge]
ignore_missing_imports = True
[mypy-rospy]
Expand All @@ -23,8 +28,6 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-centernet.config]
ignore_missing_imports = True
[mypy-detic_ros.*]
ignore_missing_imports = True
[mypy-sensor_msgs.*]
ignore_missing_imports = True
[mypy-std_msgs.*]
Expand All @@ -41,3 +44,7 @@ ignore_missing_imports = True
ignore_missing_imports = True
[mypy-moviepy.*]
ignore_missing_imports = True
[mypy-detic_ros.msg]
ignore_missing_imports = True
[mypy-detic_ros.srv]
ignore_missing_imports = True
4 changes: 2 additions & 2 deletions node_script/batch_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from sensor_msgs.msg import Image

from moviepy.editor import ImageSequenceClip
from node_config import NodeConfig
from wrapper import DeticWrapper, InferenceRawResult
from detic_ros.node_config import NodeConfig
from detic_ros.wrapper import DeticWrapper, InferenceRawResult


def bag_to_images(file_path: str, topic_name_extract: Optional[str] = None):
Expand Down

0 comments on commit 7ba37a3

Please sign in to comment.