From 32ebc50e88bd70aef0fe2ec1e01d40e5c1c43c67 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom <36806982+InvincibleRMC@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:32:29 -0400 Subject: [PATCH 01/36] Update industrial_ci_action.yml --- .github/workflows/industrial_ci_action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 9c898e7b..85e31ea7 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -42,5 +42,6 @@ jobs: env: # either pass all entries explicitly ROS_DISTRO: ${{ matrix.ROS_DISTRO }} ROS_REPO: ${{ matrix.ROS_REPO }} + PYLINT: true # with: # or pass the full matrix as config # config: ${{toJSON(matrix)}} From ab7300d82674c7d60dde175ee8f4a76ce53cfb42 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom <36806982+InvincibleRMC@users.noreply.github.com> Date: Mon, 23 Oct 2023 15:41:38 -0400 Subject: [PATCH 02/36] Update industrial_ci_action.yml --- .github/workflows/industrial_ci_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 85e31ea7..a9b0ba6d 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -42,6 +42,6 @@ jobs: env: # either pass all entries explicitly ROS_DISTRO: ${{ matrix.ROS_DISTRO }} ROS_REPO: ${{ matrix.ROS_REPO }} - PYLINT: true + PYLINT_CHECK: true # with: # or pass the full matrix as config # config: ${{toJSON(matrix)}} From 1615c5a75b9580ffc3d4bda160678a2336ba514e Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 20:39:46 -0500 Subject: [PATCH 03/36] clean up constants --- .pylintrc | 2 ++ src/pi/camera_streamer/setup.py | 12 ++++---- src/pi/manipulators/setup.py | 12 ++++---- src/pi/pi_main/launch/pi_launch.py | 4 +-- src/pi/pi_main/setup.py | 14 ++++----- src/pi/pixhawk_communication/setup.py | 12 ++++---- src/pi/realsense/setup.py | 12 ++++---- src/surface/gui/setup.py | 14 ++++----- src/surface/keyboard_driver/setup.py | 12 ++++---- src/surface/ps5_controller/setup.py | 12 ++++---- src/surface/rov_gazebo/launch/sim_launch.py | 32 ++++++++++----------- src/surface/rov_gazebo/setup.py | 20 ++++++------- src/surface/surface_main/setup.py | 12 ++++---- src/surface/task_selector/setup.py | 12 ++++---- 14 files changed, 92 insertions(+), 90 deletions(-) create mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 00000000..8d633808 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,2 @@ +[pylint] +duplicate-code=allow \ No newline at end of file diff --git a/src/pi/camera_streamer/setup.py b/src/pi/camera_streamer/setup.py index 4de5f730..3196bb99 100644 --- a/src/pi/camera_streamer/setup.py +++ b/src/pi/camera_streamer/setup.py @@ -3,18 +3,18 @@ from setuptools import setup -package_name = 'camera_streamer' +PACKAGE_NAME = 'camera_streamer' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')) ], install_requires=['setuptools', 'flake8==4.0.1', 'mypy >= 1.7'], diff --git a/src/pi/manipulators/setup.py b/src/pi/manipulators/setup.py index b6122ceb..8d4dcc49 100644 --- a/src/pi/manipulators/setup.py +++ b/src/pi/manipulators/setup.py @@ -7,18 +7,18 @@ major_num = sys.version_info[0] minor_num = sys.version_info[1] -package_name = 'manipulators' +PACKAGE_NAME = 'manipulators' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')) ], install_requires=['setuptools', 'flake8==4.0.1', 'mypy >= 1.7'], diff --git a/src/pi/pi_main/launch/pi_launch.py b/src/pi/pi_main/launch/pi_launch.py index a1e5ce48..7a3fef60 100644 --- a/src/pi/pi_main/launch/pi_launch.py +++ b/src/pi/pi_main/launch/pi_launch.py @@ -8,7 +8,7 @@ def generate_launch_description() -> LaunchDescription: - NS = 'pi' + NAMESPACE = 'pi' # Manipulator Controller # manip_path: str = get_package_share_directory('manipulators') # @@ -56,7 +56,7 @@ def generate_launch_description() -> LaunchDescription: namespace_launch = GroupAction( actions=[ - PushRosNamespace(NS), + PushRosNamespace(NAMESPACE), # manip_launch, pixhawk_launch, cam_launch, diff --git a/src/pi/pi_main/setup.py b/src/pi/pi_main/setup.py index 1cbc9564..a42a1cbf 100644 --- a/src/pi/pi_main/setup.py +++ b/src/pi/pi_main/setup.py @@ -3,21 +3,21 @@ from setuptools import setup -package_name = 'pi_main' +PACKAGE_NAME = 'pi_main' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')), - (os.path.join('share', package_name, 'udev_rules'), + (os.path.join('share', PACKAGE_NAME, 'udev_rules'), glob('udev_rules/*')) ], install_requires=['setuptools', 'flake8==4.0.1', 'mypy >= 1.7'], diff --git a/src/pi/pixhawk_communication/setup.py b/src/pi/pixhawk_communication/setup.py index d38c15a0..c428c18f 100644 --- a/src/pi/pixhawk_communication/setup.py +++ b/src/pi/pixhawk_communication/setup.py @@ -3,18 +3,18 @@ from setuptools import setup -package_name = 'pixhawk_communication' +PACKAGE_NAME = 'pixhawk_communication' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')) ], install_requires=['setuptools', 'flake8==4.0.1', 'mypy >= 1.7'], diff --git a/src/pi/realsense/setup.py b/src/pi/realsense/setup.py index beaf63ef..3316af12 100644 --- a/src/pi/realsense/setup.py +++ b/src/pi/realsense/setup.py @@ -3,19 +3,19 @@ from setuptools import setup -package_name = 'realsense' +PACKAGE_NAME = 'realsense' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')) ], install_requires=['setuptools', 'flake8==4.0.1', 'mypy >= 1.7'], diff --git a/src/surface/gui/setup.py b/src/surface/gui/setup.py index f83a25a0..1c41c15a 100644 --- a/src/surface/gui/setup.py +++ b/src/surface/gui/setup.py @@ -3,19 +3,19 @@ from setuptools import setup -package_name = 'gui' +PACKAGE_NAME = 'gui' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name, os.path.join(package_name, 'widgets'), - os.path.join(package_name, 'event_nodes')], + packages=[PACKAGE_NAME, os.path.join(PACKAGE_NAME, 'widgets'), + os.path.join(PACKAGE_NAME, 'event_nodes')], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')) ], install_requires=['setuptools', 'pyqt6==6.5.3', 'pyqtdarktheme', 'opencv-python>=4.8.1', diff --git a/src/surface/keyboard_driver/setup.py b/src/surface/keyboard_driver/setup.py index b0098ea3..b6f588dc 100644 --- a/src/surface/keyboard_driver/setup.py +++ b/src/surface/keyboard_driver/setup.py @@ -3,16 +3,16 @@ from setuptools import setup -package_name = "keyboard_driver" +PACKAGE_NAME = "keyboard_driver" setup( - name=package_name, + name=PACKAGE_NAME, version="1.0.0", - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ - ("share/ament_index/resource_index/packages", ["resource/" + package_name]), - ("share/" + package_name, ["package.xml"]), - (os.path.join("share", package_name, "launch"), glob("launch/*.py")), + ("share/ament_index/resource_index/packages", ["resource/" + PACKAGE_NAME]), + ("share/" + PACKAGE_NAME, ["package.xml"]), + (os.path.join("share", PACKAGE_NAME, "launch"), glob("launch/*.py")), ], install_requires=["setuptools", "pynput"], zip_safe=True, diff --git a/src/surface/ps5_controller/setup.py b/src/surface/ps5_controller/setup.py index 85fe33ac..fd821ee0 100644 --- a/src/surface/ps5_controller/setup.py +++ b/src/surface/ps5_controller/setup.py @@ -3,18 +3,18 @@ from setuptools import setup -package_name = 'ps5_controller' +PACKAGE_NAME = 'ps5_controller' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')) ], install_requires=['setuptools', 'flake8==4.0.1', 'mypy >= 1.7'], diff --git a/src/surface/rov_gazebo/launch/sim_launch.py b/src/surface/rov_gazebo/launch/sim_launch.py index 62c2a5a6..9e109abd 100644 --- a/src/surface/rov_gazebo/launch/sim_launch.py +++ b/src/surface/rov_gazebo/launch/sim_launch.py @@ -7,7 +7,7 @@ from launch.substitutions import Command from launch_ros.actions import Node -NS = "simulation" +NAMESPACE = "simulation" def generate_launch_description() -> LaunchDescription: @@ -32,7 +32,7 @@ def generate_launch_description() -> LaunchDescription: executable="robot_state_publisher", output="screen", parameters=[params], - namespace=NS, + namespace=NAMESPACE, emulate_tty=True ) @@ -41,8 +41,8 @@ def generate_launch_description() -> LaunchDescription: executable="robot_state_publisher", output="screen", parameters=[pool_params], - namespace=NS, - remappings=[(f"/{NS}/robot_description", f"/{NS}/pool_description")], + namespace=NAMESPACE, + remappings=[(f"/{NAMESPACE}/robot_description", f"/{NAMESPACE}/pool_description")], emulate_tty=True ) @@ -67,7 +67,7 @@ def generate_launch_description() -> LaunchDescription: "-allow_renaming", "true", ], - namespace=NS, + namespace=NAMESPACE, emulate_tty=True ) @@ -83,7 +83,7 @@ def generate_launch_description() -> LaunchDescription: "-allow_renaming", "true", ], - namespace=NS, + namespace=NAMESPACE, emulate_tty=True ) @@ -96,15 +96,15 @@ def generate_launch_description() -> LaunchDescription: executable="keyboard_driver_node", output="screen", name="keyboard_driver_node", - namespace=NS, - remappings=[(f"/{NS}/manual_control", "/manual_control")], + namespace=NAMESPACE, + remappings=[(f"/{NAMESPACE}/manual_control", "/manual_control")], emulate_tty=True ) # cam_bridge = Node( # package="ros_gz_bridge", # executable="parameter_bridge", - # namespace=NS, + # namespace=NAMESPACE, # name="cam_bridge", # arguments=[ # "/bottom_cam/image_raw@sensor_msgs/msg/Image@gz.msgs.Image", @@ -116,13 +116,13 @@ def generate_launch_description() -> LaunchDescription: # "/depth_cam/points@sensor_msgs/msg/PointCloud2@gz.msgs.PointCloudPacked", # ], # remappings=[ - # (f"/{NS}/bottom_cam/image_raw", "/bottom_cam/image_raw"), - # (f"/{NS}/bottom_cam/camera_info", "/bottom_cam/camera_info"), - # (f"/{NS}/front_cam/image_raw", "/front_cam/image_raw"), - # (f"/{NS}/front_cam/camera_info", "/front_cam/camera_info"), - # (f"/{NS}/manip_cam/image_raw", "/manip_cam/image_raw"), - # (f"/{NS}/depth_cam", "/depth_cam/image_raw"), - # (f"/{NS}/depth_cam/points", "/depth_cam/points"), + # (f"/{NAMESPACE}/bottom_cam/image_raw", "/bottom_cam/image_raw"), + # (f"/{NAMESPACE}/bottom_cam/camera_info", "/bottom_cam/camera_info"), + # (f"/{NAMESPACE}/front_cam/image_raw", "/front_cam/image_raw"), + # (f"/{NAMESPACE}/front_cam/camera_info", "/front_cam/camera_info"), + # (f"/{NAMESPACE}/manip_cam/image_raw", "/manip_cam/image_raw"), + # (f"/{NAMESPACE}/depth_cam", "/depth_cam/image_raw"), + # (f"/{NAMESPACE}/depth_cam/points", "/depth_cam/points"), # ], # output="screen", # emulate_tty=True diff --git a/src/surface/rov_gazebo/setup.py b/src/surface/rov_gazebo/setup.py index 550e659f..e3ac645a 100644 --- a/src/surface/rov_gazebo/setup.py +++ b/src/surface/rov_gazebo/setup.py @@ -3,20 +3,20 @@ from setuptools import setup -package_name = "rov_gazebo" +PACKAGE_NAME = "rov_gazebo" setup( - name=package_name, + name=PACKAGE_NAME, version="1.0.0", - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ - ("share/ament_index/resource_index/packages", ["resource/" + package_name]), - ("share/" + package_name, ["package.xml"]), - (os.path.join("share", package_name, "launch"), glob("launch/*.py")), - (os.path.join("share", package_name, "description"), glob("description/*")), - (os.path.join("share", package_name, "config"), glob("config/*")), - (os.path.join("share", package_name, "worlds"), glob("worlds/*")), - (os.path.join("share", package_name, "meshes"), glob("meshes/*")), + ("share/ament_index/resource_index/packages", ["resource/" + PACKAGE_NAME]), + ("share/" + PACKAGE_NAME, ["package.xml"]), + (os.path.join("share", PACKAGE_NAME, "launch"), glob("launch/*.py")), + (os.path.join("share", PACKAGE_NAME, "description"), glob("description/*")), + (os.path.join("share", PACKAGE_NAME, "config"), glob("config/*")), + (os.path.join("share", PACKAGE_NAME, "worlds"), glob("worlds/*")), + (os.path.join("share", PACKAGE_NAME, "meshes"), glob("meshes/*")), ], install_requires=["setuptools"], zip_safe=True, diff --git a/src/surface/surface_main/setup.py b/src/surface/surface_main/setup.py index 027b8146..4e733f19 100644 --- a/src/surface/surface_main/setup.py +++ b/src/surface/surface_main/setup.py @@ -3,18 +3,18 @@ from setuptools import setup -package_name = 'surface_main' +PACKAGE_NAME = 'surface_main' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')) ], install_requires=['setuptools', 'flake8==4.0.1', 'mypy >= 1.7'], diff --git a/src/surface/task_selector/setup.py b/src/surface/task_selector/setup.py index ab8dbbee..199c32bd 100644 --- a/src/surface/task_selector/setup.py +++ b/src/surface/task_selector/setup.py @@ -3,18 +3,18 @@ from setuptools import setup -package_name = 'task_selector' +PACKAGE_NAME = 'task_selector' setup( - name=package_name, + name=PACKAGE_NAME, version='1.0.0', - packages=[package_name], + packages=[PACKAGE_NAME], data_files=[ ('share/ament_index/resource_index/packages', - ['resource/' + package_name]), - ('share/' + package_name, ['package.xml']), + ['resource/' + PACKAGE_NAME]), + ('share/' + PACKAGE_NAME, ['package.xml']), # Include all launch files. - (os.path.join('share', package_name, 'launch'), + (os.path.join('share', PACKAGE_NAME, 'launch'), glob('launch/*launch.[pxy][yma]*')) ], install_requires=['setuptools', 'flake8==4.0.1', 'mypy >= 1.7'], From c0c3b2b70aee0ec335baa43eeec3cb5b150a5399 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 20:54:56 -0500 Subject: [PATCH 04/36] docstrings for testing --- src/pi/camera_streamer/test/test_flake8.py | 6 ++++-- src/pi/camera_streamer/test/test_mypy.py | 6 ++++-- src/pi/camera_streamer/test/test_pep257.py | 6 ++++-- src/pi/manipulators/test/test_flake8.py | 6 ++++-- src/pi/manipulators/test/test_mypy.py | 6 ++++-- src/pi/manipulators/test/test_pep257.py | 6 ++++-- src/pi/pi_main/test/test_flake8.py | 6 ++++-- src/pi/pi_main/test/test_mypy.py | 6 ++++-- src/pi/pi_main/test/test_pep257.py | 6 ++++-- src/pi/pixhawk_communication/test/test_flake8.py | 6 ++++-- src/pi/pixhawk_communication/test/test_mypy.py | 6 ++++-- src/pi/pixhawk_communication/test/test_pep257.py | 6 ++++-- src/pi/realsense/test/test_flake8.py | 6 ++++-- src/pi/realsense/test/test_mypy.py | 6 ++++-- src/pi/realsense/test/test_pep257.py | 6 ++++-- src/surface/gui/test/test_flake8.py | 6 ++++-- src/surface/gui/test/test_mypy.py | 6 ++++-- src/surface/gui/test/test_pep257.py | 6 ++++-- src/surface/keyboard_driver/test/test_flake8.py | 6 ++++-- src/surface/keyboard_driver/test/test_mypy.py | 6 ++++-- src/surface/keyboard_driver/test/test_pep257.py | 6 ++++-- src/surface/ps5_controller/test/test_flake8.py | 6 ++++-- src/surface/ps5_controller/test/test_mypy.py | 6 ++++-- src/surface/ps5_controller/test/test_pep257.py | 6 ++++-- src/surface/ros2_video_streamer | 2 +- src/surface/rov_gazebo/test/test_flake8.py | 6 ++++-- src/surface/rov_gazebo/test/test_mypy.py | 6 ++++-- src/surface/rov_gazebo/test/test_pep257.py | 6 ++++-- src/surface/surface_main/test/test_flake8.py | 6 ++++-- src/surface/surface_main/test/test_mypy.py | 6 ++++-- src/surface/surface_main/test/test_pep257.py | 6 ++++-- src/surface/task_selector/test/test_flake8.py | 6 ++++-- src/surface/task_selector/test/test_mypy.py | 6 ++++-- src/surface/task_selector/test/test_pep257.py | 6 ++++-- 34 files changed, 133 insertions(+), 67 deletions(-) diff --git a/src/pi/camera_streamer/test/test_flake8.py b/src/pi/camera_streamer/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/pi/camera_streamer/test/test_flake8.py +++ b/src/pi/camera_streamer/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/pi/camera_streamer/test/test_mypy.py b/src/pi/camera_streamer/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/pi/camera_streamer/test/test_mypy.py +++ b/src/pi/camera_streamer/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/camera_streamer/test/test_pep257.py b/src/pi/camera_streamer/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/pi/camera_streamer/test/test_pep257.py +++ b/src/pi/camera_streamer/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/manipulators/test/test_flake8.py b/src/pi/manipulators/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/pi/manipulators/test/test_flake8.py +++ b/src/pi/manipulators/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/pi/manipulators/test/test_mypy.py b/src/pi/manipulators/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/pi/manipulators/test/test_mypy.py +++ b/src/pi/manipulators/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/manipulators/test/test_pep257.py b/src/pi/manipulators/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/pi/manipulators/test/test_pep257.py +++ b/src/pi/manipulators/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/pi_main/test/test_flake8.py b/src/pi/pi_main/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/pi/pi_main/test/test_flake8.py +++ b/src/pi/pi_main/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/pi/pi_main/test/test_mypy.py b/src/pi/pi_main/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/pi/pi_main/test/test_mypy.py +++ b/src/pi/pi_main/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/pi_main/test/test_pep257.py b/src/pi/pi_main/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/pi/pi_main/test/test_pep257.py +++ b/src/pi/pi_main/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/pixhawk_communication/test/test_flake8.py b/src/pi/pixhawk_communication/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/pi/pixhawk_communication/test/test_flake8.py +++ b/src/pi/pixhawk_communication/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/pi/pixhawk_communication/test/test_mypy.py b/src/pi/pixhawk_communication/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/pi/pixhawk_communication/test/test_mypy.py +++ b/src/pi/pixhawk_communication/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/pixhawk_communication/test/test_pep257.py b/src/pi/pixhawk_communication/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/pi/pixhawk_communication/test/test_pep257.py +++ b/src/pi/pixhawk_communication/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/realsense/test/test_flake8.py b/src/pi/realsense/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/pi/realsense/test/test_flake8.py +++ b/src/pi/realsense/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/pi/realsense/test/test_mypy.py b/src/pi/realsense/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/pi/realsense/test/test_mypy.py +++ b/src/pi/realsense/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/realsense/test/test_pep257.py b/src/pi/realsense/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/pi/realsense/test/test_pep257.py +++ b/src/pi/realsense/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/gui/test/test_flake8.py b/src/surface/gui/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/surface/gui/test/test_flake8.py +++ b/src/surface/gui/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/surface/gui/test/test_mypy.py b/src/surface/gui/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/surface/gui/test/test_mypy.py +++ b/src/surface/gui/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/gui/test/test_pep257.py b/src/surface/gui/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/surface/gui/test/test_pep257.py +++ b/src/surface/gui/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/keyboard_driver/test/test_flake8.py b/src/surface/keyboard_driver/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/surface/keyboard_driver/test/test_flake8.py +++ b/src/surface/keyboard_driver/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/surface/keyboard_driver/test/test_mypy.py b/src/surface/keyboard_driver/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/surface/keyboard_driver/test/test_mypy.py +++ b/src/surface/keyboard_driver/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/keyboard_driver/test/test_pep257.py b/src/surface/keyboard_driver/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/surface/keyboard_driver/test/test_pep257.py +++ b/src/surface/keyboard_driver/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/ps5_controller/test/test_flake8.py b/src/surface/ps5_controller/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/surface/ps5_controller/test/test_flake8.py +++ b/src/surface/ps5_controller/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/surface/ps5_controller/test/test_mypy.py b/src/surface/ps5_controller/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/surface/ps5_controller/test/test_mypy.py +++ b/src/surface/ps5_controller/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/ps5_controller/test/test_pep257.py b/src/surface/ps5_controller/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/surface/ps5_controller/test/test_pep257.py +++ b/src/surface/ps5_controller/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index ec5f178b..3213468d 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit ec5f178bcc56df34f83aa157e6f691c2ef45503c +Subproject commit 3213468ddb25102ed94c3f63dade220e88b1e4b8 diff --git a/src/surface/rov_gazebo/test/test_flake8.py b/src/surface/rov_gazebo/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/surface/rov_gazebo/test/test_flake8.py +++ b/src/surface/rov_gazebo/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/surface/rov_gazebo/test/test_mypy.py b/src/surface/rov_gazebo/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/surface/rov_gazebo/test/test_mypy.py +++ b/src/surface/rov_gazebo/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/rov_gazebo/test/test_pep257.py b/src/surface/rov_gazebo/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/surface/rov_gazebo/test/test_pep257.py +++ b/src/surface/rov_gazebo/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/surface_main/test/test_flake8.py b/src/surface/surface_main/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/surface/surface_main/test/test_flake8.py +++ b/src/surface/surface_main/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/surface/surface_main/test/test_mypy.py b/src/surface/surface_main/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/surface/surface_main/test/test_mypy.py +++ b/src/surface/surface_main/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/surface_main/test/test_pep257.py b/src/surface/surface_main/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/surface/surface_main/test/test_pep257.py +++ b/src/surface/surface_main/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/task_selector/test/test_flake8.py b/src/surface/task_selector/test/test_flake8.py index eac16eef..dbbc68e0 100644 --- a/src/surface/task_selector/test/test_flake8.py +++ b/src/surface/task_selector/test/test_flake8.py @@ -19,7 +19,9 @@ @pytest.mark.flake8 @pytest.mark.linter def test_flake8() -> None: - rc, errors = main_with_errors(argv=[]) - assert rc == 0, \ + """Tests flake8 on this module.""" + + error_code, errors = main_with_errors(argv=[]) + assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ '\n'.join(errors) diff --git a/src/surface/task_selector/test/test_mypy.py b/src/surface/task_selector/test/test_mypy.py index fbd775a9..2dff4907 100644 --- a/src/surface/task_selector/test/test_mypy.py +++ b/src/surface/task_selector/test/test_mypy.py @@ -7,7 +7,9 @@ @pytest.mark.mypy @pytest.mark.linter def test_mypy() -> None: + """Tests mypy on this module.""" + file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') - rc = main(argv=['--config', config_file]) - assert rc == 0, 'Found code style errors / warnings' + error_code = main(argv=['--config', config_file]) + assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/task_selector/test/test_pep257.py b/src/surface/task_selector/test/test_pep257.py index b6808e1d..a7913a20 100644 --- a/src/surface/task_selector/test/test_pep257.py +++ b/src/surface/task_selector/test/test_pep257.py @@ -19,5 +19,7 @@ @pytest.mark.linter @pytest.mark.pep257 def test_pep257() -> None: - rc = main(argv=['.', 'test']) - assert rc == 0, 'Found code style errors / warnings' + """Tests pep257 on this module.""" + + error_code = main(argv=['.', 'test']) + assert error_code == 0, 'Found code style errors / warnings' From 072ca434acc62310239dea1b34920624aad383bd Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 20:59:20 -0500 Subject: [PATCH 05/36] sub --- src/surface/ros2_video_streamer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index 3213468d..ec5f178b 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit 3213468ddb25102ed94c3f63dade220e88b1e4b8 +Subproject commit ec5f178bcc56df34f83aa157e6f691c2ef45503c From ac617aea155c487b1b560b71479a29dca54daa18 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 20:59:29 -0500 Subject: [PATCH 06/36] sub --- src/surface/ros2_video_streamer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index 3213468d..ec5f178b 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit 3213468ddb25102ed94c3f63dade220e88b1e4b8 +Subproject commit ec5f178bcc56df34f83aa157e6f691c2ef45503c From fa74e4d17eab150172d326be72d68f6ce1031bf6 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 21:03:50 -0500 Subject: [PATCH 07/36] yippee? --- .pylintrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.pylintrc b/.pylintrc index 8d633808..20fba39a 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,2 +1,2 @@ [pylint] -duplicate-code=allow \ No newline at end of file +disable=duplicate-code \ No newline at end of file From 0194c0475cdfc33da73f57b2605b9e28444ee649 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 21:08:58 -0500 Subject: [PATCH 08/36] remove extra newline --- .pylintrc | 2 -- src/pi/camera_streamer/test/test_flake8.py | 1 - src/pi/camera_streamer/test/test_mypy.py | 1 - src/pi/manipulators/test/test_flake8.py | 1 - src/pi/manipulators/test/test_mypy.py | 1 - src/pi/pi_main/test/test_flake8.py | 1 - src/pi/pi_main/test/test_mypy.py | 1 - src/pi/pixhawk_communication/test/test_flake8.py | 1 - src/pi/pixhawk_communication/test/test_mypy.py | 1 - src/pi/realsense/test/test_flake8.py | 1 - src/pi/realsense/test/test_mypy.py | 1 - src/surface/gui/test/test_flake8.py | 1 - src/surface/gui/test/test_mypy.py | 1 - src/surface/keyboard_driver/test/test_flake8.py | 1 - src/surface/keyboard_driver/test/test_mypy.py | 1 - src/surface/ps5_controller/test/test_flake8.py | 1 - src/surface/ps5_controller/test/test_mypy.py | 1 - src/surface/rov_gazebo/test/test_flake8.py | 1 - src/surface/rov_gazebo/test/test_mypy.py | 1 - src/surface/surface_main/test/test_flake8.py | 1 - src/surface/surface_main/test/test_mypy.py | 1 - src/surface/task_selector/test/test_flake8.py | 1 - src/surface/task_selector/test/test_mypy.py | 1 - 23 files changed, 24 deletions(-) delete mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index 8d633808..00000000 --- a/.pylintrc +++ /dev/null @@ -1,2 +0,0 @@ -[pylint] -duplicate-code=allow \ No newline at end of file diff --git a/src/pi/camera_streamer/test/test_flake8.py b/src/pi/camera_streamer/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/pi/camera_streamer/test/test_flake8.py +++ b/src/pi/camera_streamer/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/pi/camera_streamer/test/test_mypy.py b/src/pi/camera_streamer/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/pi/camera_streamer/test/test_mypy.py +++ b/src/pi/camera_streamer/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/pi/manipulators/test/test_flake8.py b/src/pi/manipulators/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/pi/manipulators/test/test_flake8.py +++ b/src/pi/manipulators/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/pi/manipulators/test/test_mypy.py b/src/pi/manipulators/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/pi/manipulators/test/test_mypy.py +++ b/src/pi/manipulators/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/pi/pi_main/test/test_flake8.py b/src/pi/pi_main/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/pi/pi_main/test/test_flake8.py +++ b/src/pi/pi_main/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/pi/pi_main/test/test_mypy.py b/src/pi/pi_main/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/pi/pi_main/test/test_mypy.py +++ b/src/pi/pi_main/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/pi/pixhawk_communication/test/test_flake8.py b/src/pi/pixhawk_communication/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/pi/pixhawk_communication/test/test_flake8.py +++ b/src/pi/pixhawk_communication/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/pi/pixhawk_communication/test/test_mypy.py b/src/pi/pixhawk_communication/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/pi/pixhawk_communication/test/test_mypy.py +++ b/src/pi/pixhawk_communication/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/pi/realsense/test/test_flake8.py b/src/pi/realsense/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/pi/realsense/test/test_flake8.py +++ b/src/pi/realsense/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/pi/realsense/test/test_mypy.py b/src/pi/realsense/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/pi/realsense/test/test_mypy.py +++ b/src/pi/realsense/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/surface/gui/test/test_flake8.py b/src/surface/gui/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/surface/gui/test/test_flake8.py +++ b/src/surface/gui/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/surface/gui/test/test_mypy.py b/src/surface/gui/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/surface/gui/test/test_mypy.py +++ b/src/surface/gui/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/surface/keyboard_driver/test/test_flake8.py b/src/surface/keyboard_driver/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/surface/keyboard_driver/test/test_flake8.py +++ b/src/surface/keyboard_driver/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/surface/keyboard_driver/test/test_mypy.py b/src/surface/keyboard_driver/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/surface/keyboard_driver/test/test_mypy.py +++ b/src/surface/keyboard_driver/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/surface/ps5_controller/test/test_flake8.py b/src/surface/ps5_controller/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/surface/ps5_controller/test/test_flake8.py +++ b/src/surface/ps5_controller/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/surface/ps5_controller/test/test_mypy.py b/src/surface/ps5_controller/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/surface/ps5_controller/test/test_mypy.py +++ b/src/surface/ps5_controller/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/surface/rov_gazebo/test/test_flake8.py b/src/surface/rov_gazebo/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/surface/rov_gazebo/test/test_flake8.py +++ b/src/surface/rov_gazebo/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/surface/rov_gazebo/test/test_mypy.py b/src/surface/rov_gazebo/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/surface/rov_gazebo/test/test_mypy.py +++ b/src/surface/rov_gazebo/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/surface/surface_main/test/test_flake8.py b/src/surface/surface_main/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/surface/surface_main/test/test_flake8.py +++ b/src/surface/surface_main/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/surface/surface_main/test/test_mypy.py b/src/surface/surface_main/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/surface/surface_main/test/test_mypy.py +++ b/src/surface/surface_main/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) diff --git a/src/surface/task_selector/test/test_flake8.py b/src/surface/task_selector/test/test_flake8.py index dbbc68e0..84875a75 100644 --- a/src/surface/task_selector/test/test_flake8.py +++ b/src/surface/task_selector/test/test_flake8.py @@ -20,7 +20,6 @@ @pytest.mark.linter def test_flake8() -> None: """Tests flake8 on this module.""" - error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ 'Found %d code style errors / warnings:\n' % len(errors) + \ diff --git a/src/surface/task_selector/test/test_mypy.py b/src/surface/task_selector/test/test_mypy.py index 2dff4907..2cb49a3d 100644 --- a/src/surface/task_selector/test/test_mypy.py +++ b/src/surface/task_selector/test/test_mypy.py @@ -8,7 +8,6 @@ @pytest.mark.linter def test_mypy() -> None: """Tests mypy on this module.""" - file_path = __file__.replace(f'{__name__}.py', '') config_file = os.path.join(file_path, '..', '..', '..', '..', 'mypy.ini') error_code = main(argv=['--config', config_file]) From c4c81c377dbe04d82e6bfae37ae13e7d3b306b0a Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 21:09:05 -0500 Subject: [PATCH 09/36] pep257 --- src/pi/camera_streamer/test/test_pep257.py | 1 - src/pi/manipulators/test/test_pep257.py | 1 - src/pi/pi_main/test/test_pep257.py | 1 - src/pi/pixhawk_communication/test/test_pep257.py | 1 - src/pi/realsense/test/test_pep257.py | 1 - src/surface/gui/test/test_pep257.py | 1 - src/surface/keyboard_driver/test/test_pep257.py | 1 - src/surface/ps5_controller/test/test_pep257.py | 1 - src/surface/rov_gazebo/test/test_pep257.py | 1 - src/surface/surface_main/test/test_pep257.py | 1 - src/surface/task_selector/test/test_pep257.py | 1 - 11 files changed, 11 deletions(-) diff --git a/src/pi/camera_streamer/test/test_pep257.py b/src/pi/camera_streamer/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/pi/camera_streamer/test/test_pep257.py +++ b/src/pi/camera_streamer/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/manipulators/test/test_pep257.py b/src/pi/manipulators/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/pi/manipulators/test/test_pep257.py +++ b/src/pi/manipulators/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/pi_main/test/test_pep257.py b/src/pi/pi_main/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/pi/pi_main/test/test_pep257.py +++ b/src/pi/pi_main/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/pixhawk_communication/test/test_pep257.py b/src/pi/pixhawk_communication/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/pi/pixhawk_communication/test/test_pep257.py +++ b/src/pi/pixhawk_communication/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/pi/realsense/test/test_pep257.py b/src/pi/realsense/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/pi/realsense/test/test_pep257.py +++ b/src/pi/realsense/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/gui/test/test_pep257.py b/src/surface/gui/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/surface/gui/test/test_pep257.py +++ b/src/surface/gui/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/keyboard_driver/test/test_pep257.py b/src/surface/keyboard_driver/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/surface/keyboard_driver/test/test_pep257.py +++ b/src/surface/keyboard_driver/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/ps5_controller/test/test_pep257.py b/src/surface/ps5_controller/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/surface/ps5_controller/test/test_pep257.py +++ b/src/surface/ps5_controller/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/rov_gazebo/test/test_pep257.py b/src/surface/rov_gazebo/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/surface/rov_gazebo/test/test_pep257.py +++ b/src/surface/rov_gazebo/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/surface_main/test/test_pep257.py b/src/surface/surface_main/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/surface/surface_main/test/test_pep257.py +++ b/src/surface/surface_main/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' diff --git a/src/surface/task_selector/test/test_pep257.py b/src/surface/task_selector/test/test_pep257.py index a7913a20..8e7dfaa7 100644 --- a/src/surface/task_selector/test/test_pep257.py +++ b/src/surface/task_selector/test/test_pep257.py @@ -20,6 +20,5 @@ @pytest.mark.pep257 def test_pep257() -> None: """Tests pep257 on this module.""" - error_code = main(argv=['.', 'test']) assert error_code == 0, 'Found code style errors / warnings' From 690017524d92acf9b5bd9137f28b557ffdebaf1a Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 21:10:32 -0500 Subject: [PATCH 10/36] remove pylint stuff --- .github/workflows/industrial_ci_action.yml | 3 +-- .pylintrc | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 .pylintrc diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 5d02441f..fab9a633 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -47,5 +47,4 @@ jobs: DOCKER_IMAGE: ghcr.io/cwrurobotics/rov-24:main ROS_REPO: ${{ matrix.ROS_REPO }} # Crazy one liner for install python dependencies - AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' - PYLINT_CHECK: true \ No newline at end of file + AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' \ No newline at end of file diff --git a/.pylintrc b/.pylintrc deleted file mode 100644 index 20fba39a..00000000 --- a/.pylintrc +++ /dev/null @@ -1,2 +0,0 @@ -[pylint] -disable=duplicate-code \ No newline at end of file From 45cdf7da66591078b19447ff1e9aa506ee99c268 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 21:18:16 -0500 Subject: [PATCH 11/36] fix flake8 test --- src/pi/camera_streamer/test/test_flake8.py | 2 +- src/pi/manipulators/test/test_flake8.py | 2 +- src/pi/pi_main/test/test_flake8.py | 2 +- src/pi/pixhawk_communication/test/test_flake8.py | 2 +- src/pi/realsense/test/test_flake8.py | 2 +- src/surface/gui/test/test_flake8.py | 2 +- src/surface/keyboard_driver/test/test_flake8.py | 2 +- src/surface/ps5_controller/test/test_flake8.py | 2 +- src/surface/ros2_video_streamer | 2 +- src/surface/rov_gazebo/test/test_flake8.py | 2 +- src/surface/surface_main/test/test_flake8.py | 2 +- src/surface/task_selector/test/test_flake8.py | 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/pi/camera_streamer/test/test_flake8.py b/src/pi/camera_streamer/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/pi/camera_streamer/test/test_flake8.py +++ b/src/pi/camera_streamer/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/pi/manipulators/test/test_flake8.py b/src/pi/manipulators/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/pi/manipulators/test/test_flake8.py +++ b/src/pi/manipulators/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/pi/pi_main/test/test_flake8.py b/src/pi/pi_main/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/pi/pi_main/test/test_flake8.py +++ b/src/pi/pi_main/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/pi/pixhawk_communication/test/test_flake8.py b/src/pi/pixhawk_communication/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/pi/pixhawk_communication/test/test_flake8.py +++ b/src/pi/pixhawk_communication/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/pi/realsense/test/test_flake8.py b/src/pi/realsense/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/pi/realsense/test/test_flake8.py +++ b/src/pi/realsense/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/surface/gui/test/test_flake8.py b/src/surface/gui/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/surface/gui/test/test_flake8.py +++ b/src/surface/gui/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/surface/keyboard_driver/test/test_flake8.py b/src/surface/keyboard_driver/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/surface/keyboard_driver/test/test_flake8.py +++ b/src/surface/keyboard_driver/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/surface/ps5_controller/test/test_flake8.py b/src/surface/ps5_controller/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/surface/ps5_controller/test/test_flake8.py +++ b/src/surface/ps5_controller/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index ec5f178b..9a4c078a 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit ec5f178bcc56df34f83aa157e6f691c2ef45503c +Subproject commit 9a4c078a7e6a677f61958496cd66fbee52ddcf4b diff --git a/src/surface/rov_gazebo/test/test_flake8.py b/src/surface/rov_gazebo/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/surface/rov_gazebo/test/test_flake8.py +++ b/src/surface/rov_gazebo/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/surface/surface_main/test/test_flake8.py b/src/surface/surface_main/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/surface/surface_main/test/test_flake8.py +++ b/src/surface/surface_main/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) diff --git a/src/surface/task_selector/test/test_flake8.py b/src/surface/task_selector/test/test_flake8.py index 84875a75..d9f9ab38 100644 --- a/src/surface/task_selector/test/test_flake8.py +++ b/src/surface/task_selector/test/test_flake8.py @@ -22,5 +22,5 @@ def test_flake8() -> None: """Tests flake8 on this module.""" error_code, errors = main_with_errors(argv=[]) assert error_code == 0, \ - 'Found %d code style errors / warnings:\n' % len(errors) + \ + f'Found {len(errors)} code style errors / warnings:\n' + \ '\n'.join(errors) From 263ab59332cc03e6702acef99fcd0484d7dc0e1e Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 21:24:43 -0500 Subject: [PATCH 12/36] add back pylint check oops --- .github/workflows/industrial_ci_action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index fab9a633..5d02441f 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -47,4 +47,5 @@ jobs: DOCKER_IMAGE: ghcr.io/cwrurobotics/rov-24:main ROS_REPO: ${{ matrix.ROS_REPO }} # Crazy one liner for install python dependencies - AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' \ No newline at end of file + AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' + PYLINT_CHECK: true \ No newline at end of file From 743e8a58dc94ac3388dc2d799c9dbfad10a767df Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 22:43:05 -0500 Subject: [PATCH 13/36] disable duplicate-code --- .github/workflows/industrial_ci_action.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 5d02441f..d8a948f1 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -48,4 +48,5 @@ jobs: ROS_REPO: ${{ matrix.ROS_REPO }} # Crazy one liner for install python dependencies AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' - PYLINT_CHECK: true \ No newline at end of file + PYLINT_CHECK: true + PYLINT_ARGS: 'disable=duplicate-code' \ No newline at end of file From 8f8bc2c031ae45efee5e39264d3dcd616f4715ab Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 22:49:04 -0500 Subject: [PATCH 14/36] pyqt6 pain --- .github/workflows/industrial_ci_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index d8a948f1..afac4366 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -49,4 +49,4 @@ jobs: # Crazy one liner for install python dependencies AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' PYLINT_CHECK: true - PYLINT_ARGS: 'disable=duplicate-code' \ No newline at end of file + PYLINT_ARGS: 'disable=duplicate-code extension-pkg-whitelist=PyQt6' \ No newline at end of file From 2494b70bb6a8472ec5090f3994202209b68b975e Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 22:53:52 -0500 Subject: [PATCH 15/36] more cleanup --- src/surface/gui/gui/app.py | 11 ++++++----- src/surface/gui/gui/event_nodes/client.py | 1 - 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/surface/gui/gui/app.py b/src/surface/gui/gui/app.py index 82a80f14..afcd2aed 100644 --- a/src/surface/gui/gui/app.py +++ b/src/surface/gui/gui/app.py @@ -21,11 +21,7 @@ def __init__(self, node_name: str) -> None: self.node.declare_parameter('theme', '') self.resize(1850, 720) - atexit.register(self.clean_shutdown) - - def clean_shutdown(self) -> None: - if rclpy.utilities.ok(): - rclpy.shutdown() + atexit.register(clean_shutdown) def run_gui(self) -> None: # Kills with Control + C @@ -45,3 +41,8 @@ def run_gui(self) -> None: # TODO: when the app closes it causes an error. Make not cause error? self.app.exec() + + +def clean_shutdown() -> None: + if rclpy.utilities.ok(): + rclpy.shutdown() diff --git a/src/surface/gui/gui/event_nodes/client.py b/src/surface/gui/gui/event_nodes/client.py index 7136b7d5..4fb555e4 100644 --- a/src/surface/gui/gui/event_nodes/client.py +++ b/src/surface/gui/gui/event_nodes/client.py @@ -34,7 +34,6 @@ def __init__(self, srv_type: SrvType, topic: str, signal: pyqtBoundSignal, def __connect_to_service(self) -> None: """Connect this client to a server in a separate thread.""" while not self.cli.wait_for_service(timeout_sec=self.timeout): - # TODO: include namespaces wherever we echo the topic self.get_logger().info( 'Service for GUI event client node on topic' f' {self.expected_namespace}/{self.topic} unavailable, waiting again...') From 56401f5a02cd8bf03c788d2ad481cb94855343b8 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 22:54:30 -0500 Subject: [PATCH 16/36] fixmes are cool with me --- .github/workflows/industrial_ci_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index afac4366..427834fc 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -49,4 +49,4 @@ jobs: # Crazy one liner for install python dependencies AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' PYLINT_CHECK: true - PYLINT_ARGS: 'disable=duplicate-code extension-pkg-whitelist=PyQt6' \ No newline at end of file + PYLINT_ARGS: 'disable=duplicate-code disable=fixme extension-pkg-whitelist=PyQt6' \ No newline at end of file From 6eced2cf398e59f2c33bd0d9b46e338ee0288926 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 23:04:23 -0500 Subject: [PATCH 17/36] zoggers --- .github/workflows/industrial_ci_action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index 427834fc..a428ece5 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -49,4 +49,4 @@ jobs: # Crazy one liner for install python dependencies AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' PYLINT_CHECK: true - PYLINT_ARGS: 'disable=duplicate-code disable=fixme extension-pkg-whitelist=PyQt6' \ No newline at end of file + PYLINT_ARGS: '--disable=duplicate-code,fixme --extension-pkg-whitelist=PyQt6,cv2' \ No newline at end of file From 948772ea16f771af8ba375a9d6bfc75dfa719b11 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 23:05:31 -0500 Subject: [PATCH 18/36] fix import order --- src/surface/ros2_video_streamer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index 9a4c078a..92e07968 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit 9a4c078a7e6a677f61958496cd66fbee52ddcf4b +Subproject commit 92e079682d0daee0e98ae5639b4c26622ec04aac From c96cea5c52418d89b901bbc5f5238dd06f2cc4ae Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 23:08:52 -0500 Subject: [PATCH 19/36] pylint --- .pylintrc | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .pylintrc diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 00000000..33c469c6 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,2 @@ +disable=duplicate-code,fixme +extension-pkg-whitelist=PyQt6,cv2 \ No newline at end of file From 1dbc37d87359980f0ecefb218888ce0e1ad8ef21 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sat, 2 Dec 2023 23:54:17 -0500 Subject: [PATCH 20/36] l --- src/pi/pi_main/pi_main/install_on_boot.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pi/pi_main/pi_main/install_on_boot.py b/src/pi/pi_main/pi_main/install_on_boot.py index 48808544..7a340950 100644 --- a/src/pi/pi_main/pi_main/install_on_boot.py +++ b/src/pi/pi_main/pi_main/install_on_boot.py @@ -27,14 +27,14 @@ def main() -> None: cmd = ['/usr/bin/sudo', '/usr/bin/python3', udev_script, pi_main_share] try: - p = subprocess.run(cmd, capture_output=True, check=True) + process = subprocess.run(cmd, capture_output=True, check=True) # Logs Error - except subprocess.CalledProcessError as e: - print(e.stderr) + except subprocess.CalledProcessError as error: + print(error.stderr) sys.exit(1) # Success Message - print(p.stdout.decode()) + print(process.stdout.decode()) install_path = os.path.join(pi_main_share, "..", "..") workspace_path = os.path.join(install_path, "setup.bash") From a978159b02d41e21c0f0912f053757c622e11fa1 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sun, 3 Dec 2023 00:02:30 -0500 Subject: [PATCH 21/36] add docstrings to pi --- src/pi/camera_streamer/launch/camera_launch.py | 6 ++++++ src/pi/pi_main/launch/pi_launch.py | 7 +++++++ src/pi/pi_main/pi_main/install_on_boot.py | 5 +++++ src/pi/pixhawk_communication/launch/mavros_launch.py | 6 ++++++ 4 files changed, 24 insertions(+) diff --git a/src/pi/camera_streamer/launch/camera_launch.py b/src/pi/camera_streamer/launch/camera_launch.py index 6bdafa40..54430859 100644 --- a/src/pi/camera_streamer/launch/camera_launch.py +++ b/src/pi/camera_streamer/launch/camera_launch.py @@ -3,7 +3,13 @@ def generate_launch_description() -> LaunchDescription: + """Generates LaunchDescription for camera_streamer. + Returns + ------- + LaunchDescription + Launches Front and Bottom Cameras nodes + """ # Symlinks are auto-generated by V4L2 # ls /dev/v4l/by-id to see all the available symlinks # ls /dev/v4l/by-path for usb slot based symlinks diff --git a/src/pi/pi_main/launch/pi_launch.py b/src/pi/pi_main/launch/pi_launch.py index 7a3fef60..09f5deab 100644 --- a/src/pi/pi_main/launch/pi_launch.py +++ b/src/pi/pi_main/launch/pi_launch.py @@ -8,6 +8,13 @@ def generate_launch_description() -> LaunchDescription: + """Generates LaunchDescription for pi_main. + + Returns + ------- + LaunchDescription + Launches camera_streamer package and pixhawk_communication package. + """ NAMESPACE = 'pi' # Manipulator Controller # manip_path: str = get_package_share_directory('manipulators') diff --git a/src/pi/pi_main/pi_main/install_on_boot.py b/src/pi/pi_main/pi_main/install_on_boot.py index 7a340950..246c5277 100644 --- a/src/pi/pi_main/pi_main/install_on_boot.py +++ b/src/pi/pi_main/pi_main/install_on_boot.py @@ -8,6 +8,11 @@ def main() -> None: + """Sets up Pi file environment + + Copies udev rules from this package into udev folder. + Also uses robot_upstart to allow robot to automatically start on power on. + """ pi_main_share = get_package_share_directory('pi_main') launch_dir = os.path.join(pi_main_share, 'launch') diff --git a/src/pi/pixhawk_communication/launch/mavros_launch.py b/src/pi/pixhawk_communication/launch/mavros_launch.py index 796cf701..545d70b1 100644 --- a/src/pi/pixhawk_communication/launch/mavros_launch.py +++ b/src/pi/pixhawk_communication/launch/mavros_launch.py @@ -3,7 +3,13 @@ def generate_launch_description() -> LaunchDescription: + """Generates LaunchDescription for pixhawk_communication package. + Returns + ------- + LaunchDescription + Launches mavros Node. + """ mavros_node = Node( package="mavros", executable="mavros_node", From c8cae3a15f1929cc78267ca96b720fc07552f594 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sun, 3 Dec 2023 00:06:03 -0500 Subject: [PATCH 22/36] add header --- .pylintrc | 1 + 1 file changed, 1 insertion(+) diff --git a/.pylintrc b/.pylintrc index 33c469c6..a5208fdc 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,2 +1,3 @@ +[main] disable=duplicate-code,fixme extension-pkg-whitelist=PyQt6,cv2 \ No newline at end of file From 9aa97462599a46960362a94319f57b9712e274c8 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sun, 3 Dec 2023 00:13:27 -0500 Subject: [PATCH 23/36] fix pep257 failings --- src/pi/camera_streamer/launch/camera_launch.py | 4 +++- src/pi/pi_main/launch/pi_launch.py | 4 +++- src/pi/pi_main/pi_main/install_on_boot.py | 8 +++++--- src/pi/pixhawk_communication/launch/mavros_launch.py | 4 +++- src/pi/realsense/launch/realsense_launch.py | 9 +++++++++ 5 files changed, 23 insertions(+), 6 deletions(-) diff --git a/src/pi/camera_streamer/launch/camera_launch.py b/src/pi/camera_streamer/launch/camera_launch.py index 54430859..845010e0 100644 --- a/src/pi/camera_streamer/launch/camera_launch.py +++ b/src/pi/camera_streamer/launch/camera_launch.py @@ -3,12 +3,14 @@ def generate_launch_description() -> LaunchDescription: - """Generates LaunchDescription for camera_streamer. + """ + Generate LaunchDescription for camera_streamer. Returns ------- LaunchDescription Launches Front and Bottom Cameras nodes + """ # Symlinks are auto-generated by V4L2 # ls /dev/v4l/by-id to see all the available symlinks diff --git a/src/pi/pi_main/launch/pi_launch.py b/src/pi/pi_main/launch/pi_launch.py index 09f5deab..cf6c5318 100644 --- a/src/pi/pi_main/launch/pi_launch.py +++ b/src/pi/pi_main/launch/pi_launch.py @@ -8,12 +8,14 @@ def generate_launch_description() -> LaunchDescription: - """Generates LaunchDescription for pi_main. + """ + Generate LaunchDescription for pi_main. Returns ------- LaunchDescription Launches camera_streamer package and pixhawk_communication package. + """ NAMESPACE = 'pi' # Manipulator Controller diff --git a/src/pi/pi_main/pi_main/install_on_boot.py b/src/pi/pi_main/pi_main/install_on_boot.py index 246c5277..2bf33551 100644 --- a/src/pi/pi_main/pi_main/install_on_boot.py +++ b/src/pi/pi_main/pi_main/install_on_boot.py @@ -8,10 +8,12 @@ def main() -> None: - """Sets up Pi file environment + """ + Sets up Pi file environment + + Copies udev rules from this package into udev folder. + Also uses robot_upstart to allow robot to automatically start on power on. - Copies udev rules from this package into udev folder. - Also uses robot_upstart to allow robot to automatically start on power on. """ pi_main_share = get_package_share_directory('pi_main') diff --git a/src/pi/pixhawk_communication/launch/mavros_launch.py b/src/pi/pixhawk_communication/launch/mavros_launch.py index 545d70b1..71e94a6c 100644 --- a/src/pi/pixhawk_communication/launch/mavros_launch.py +++ b/src/pi/pixhawk_communication/launch/mavros_launch.py @@ -3,12 +3,14 @@ def generate_launch_description() -> LaunchDescription: - """Generates LaunchDescription for pixhawk_communication package. + """ + Generate LaunchDescription for pixhawk_communication package. Returns ------- LaunchDescription Launches mavros Node. + """ mavros_node = Node( package="mavros", diff --git a/src/pi/realsense/launch/realsense_launch.py b/src/pi/realsense/launch/realsense_launch.py index 299b320f..d228b008 100644 --- a/src/pi/realsense/launch/realsense_launch.py +++ b/src/pi/realsense/launch/realsense_launch.py @@ -8,6 +8,15 @@ def generate_launch_description() -> LaunchDescription: + """ + Generate LaunchDescription for the realsense package. + + Returns + ------- + LaunchDescription + Launches realsense launch file. + + """ realsense_path: str = get_package_share_directory('realsense2_camera') From c2d64087c0d93756aeb935fc22463916710ba861 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sun, 3 Dec 2023 00:22:34 -0500 Subject: [PATCH 24/36] docstrings 2 --- src/pi/camera_streamer/launch/camera_launch.py | 1 + src/pi/camera_streamer/setup.py | 1 + src/pi/pi_main/pi_main/{install_on_boot.py => run_on_boot.py} | 3 ++- src/pi/pi_main/pi_main/udev_copy.py | 1 + src/pi/pi_main/setup.py | 3 ++- src/pi/pixhawk_communication/setup.py | 1 + src/pi/realsense/setup.py | 1 + src/surface/gui/setup.py | 1 + src/surface/keyboard_driver/setup.py | 1 + src/surface/ps5_controller/setup.py | 1 + src/surface/ros2_video_streamer | 2 +- src/surface/rov_gazebo/setup.py | 1 + src/surface/surface_main/setup.py | 1 + src/surface/task_selector/setup.py | 1 + 14 files changed, 16 insertions(+), 3 deletions(-) rename src/pi/pi_main/pi_main/{install_on_boot.py => run_on_boot.py} (94%) diff --git a/src/pi/camera_streamer/launch/camera_launch.py b/src/pi/camera_streamer/launch/camera_launch.py index 845010e0..e299828d 100644 --- a/src/pi/camera_streamer/launch/camera_launch.py +++ b/src/pi/camera_streamer/launch/camera_launch.py @@ -1,3 +1,4 @@ +"""camera_streamer launch file""" from launch.launch_description import LaunchDescription from launch_ros.actions import Node diff --git a/src/pi/camera_streamer/setup.py b/src/pi/camera_streamer/setup.py index 3196bb99..611a3215 100644 --- a/src/pi/camera_streamer/setup.py +++ b/src/pi/camera_streamer/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob diff --git a/src/pi/pi_main/pi_main/install_on_boot.py b/src/pi/pi_main/pi_main/run_on_boot.py similarity index 94% rename from src/pi/pi_main/pi_main/install_on_boot.py rename to src/pi/pi_main/pi_main/run_on_boot.py index 2bf33551..0273c27e 100644 --- a/src/pi/pi_main/pi_main/install_on_boot.py +++ b/src/pi/pi_main/pi_main/run_on_boot.py @@ -1,3 +1,4 @@ +"""When run sets up environment for the robot to run on boot""" import os import sys import subprocess @@ -9,7 +10,7 @@ def main() -> None: """ - Sets up Pi file environment + Set up Pi file environment. Copies udev rules from this package into udev folder. Also uses robot_upstart to allow robot to automatically start on power on. diff --git a/src/pi/pi_main/pi_main/udev_copy.py b/src/pi/pi_main/pi_main/udev_copy.py index 539eaac4..1ee98548 100644 --- a/src/pi/pi_main/pi_main/udev_copy.py +++ b/src/pi/pi_main/pi_main/udev_copy.py @@ -1,3 +1,4 @@ +"""Copies udev rules from separate process to ensure ideal protections of sudo.""" import os import shutil import sys diff --git a/src/pi/pi_main/setup.py b/src/pi/pi_main/setup.py index a42a1cbf..b171eb06 100644 --- a/src/pi/pi_main/setup.py +++ b/src/pi/pi_main/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob @@ -29,7 +30,7 @@ tests_require=['pytest'], entry_points={ 'console_scripts': [ - 'install = pi_main.install_on_boot:main', + 'install = pi_main.run_on_boot:main', ], }, ) diff --git a/src/pi/pixhawk_communication/setup.py b/src/pi/pixhawk_communication/setup.py index c428c18f..e91f4913 100644 --- a/src/pi/pixhawk_communication/setup.py +++ b/src/pi/pixhawk_communication/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob diff --git a/src/pi/realsense/setup.py b/src/pi/realsense/setup.py index 3316af12..c272f269 100644 --- a/src/pi/realsense/setup.py +++ b/src/pi/realsense/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob diff --git a/src/surface/gui/setup.py b/src/surface/gui/setup.py index 1c41c15a..f81c62da 100644 --- a/src/surface/gui/setup.py +++ b/src/surface/gui/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob diff --git a/src/surface/keyboard_driver/setup.py b/src/surface/keyboard_driver/setup.py index b6f588dc..b05c10c0 100644 --- a/src/surface/keyboard_driver/setup.py +++ b/src/surface/keyboard_driver/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob diff --git a/src/surface/ps5_controller/setup.py b/src/surface/ps5_controller/setup.py index fd821ee0..adc6e3cb 100644 --- a/src/surface/ps5_controller/setup.py +++ b/src/surface/ps5_controller/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index 92e07968..d08ca82a 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit 92e079682d0daee0e98ae5639b4c26622ec04aac +Subproject commit d08ca82a1508ea769e040a04144d7870e9893ae8 diff --git a/src/surface/rov_gazebo/setup.py b/src/surface/rov_gazebo/setup.py index e3ac645a..e689898e 100644 --- a/src/surface/rov_gazebo/setup.py +++ b/src/surface/rov_gazebo/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob diff --git a/src/surface/surface_main/setup.py b/src/surface/surface_main/setup.py index 4e733f19..a352bb79 100644 --- a/src/surface/surface_main/setup.py +++ b/src/surface/surface_main/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob diff --git a/src/surface/task_selector/setup.py b/src/surface/task_selector/setup.py index 199c32bd..e1f12979 100644 --- a/src/surface/task_selector/setup.py +++ b/src/surface/task_selector/setup.py @@ -1,3 +1,4 @@ +"""setup.py for this module""" import os from glob import glob From e7d2e2a09c18dcb8666ac214ada499a1d4903997 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sun, 3 Dec 2023 00:23:35 -0500 Subject: [PATCH 25/36] fixed test --- .../test/{test_install_on_boot.py => test_run_on_boot.py} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename src/pi/pi_main/test/{test_install_on_boot.py => test_run_on_boot.py} (95%) diff --git a/src/pi/pi_main/test/test_install_on_boot.py b/src/pi/pi_main/test/test_run_on_boot.py similarity index 95% rename from src/pi/pi_main/test/test_install_on_boot.py rename to src/pi/pi_main/test/test_run_on_boot.py index c37ffa54..478314dd 100644 --- a/src/pi/pi_main/test/test_install_on_boot.py +++ b/src/pi/pi_main/test/test_run_on_boot.py @@ -1,6 +1,6 @@ import os -from pi_main.install_on_boot import main +from pi_main.run_on_boot import main ROS_DISTRO = os.getenv("ROS_DISTRO") From b75147edd4465aba7126595e9fb3d91bac8d6a74 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sun, 3 Dec 2023 00:24:31 -0500 Subject: [PATCH 26/36] yipppee --- .github/workflows/industrial_ci_action.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/industrial_ci_action.yml b/.github/workflows/industrial_ci_action.yml index a428ece5..fab9a633 100644 --- a/.github/workflows/industrial_ci_action.yml +++ b/.github/workflows/industrial_ci_action.yml @@ -47,6 +47,4 @@ jobs: DOCKER_IMAGE: ghcr.io/cwrurobotics/rov-24:main ROS_REPO: ${{ matrix.ROS_REPO }} # Crazy one liner for install python dependencies - AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' - PYLINT_CHECK: true - PYLINT_ARGS: '--disable=duplicate-code,fixme --extension-pkg-whitelist=PyQt6,cv2' \ No newline at end of file + AFTER_INSTALL_TARGET_DEPENDENCIES_EMBED: 'for d in /root/target_ws/src/rov-24/src/pi/*/ /root/target_ws/src/rov-24/src/surface/*/; do pip install -e "$d"; done' \ No newline at end of file From 8e791ab0862f7b7157fe3d078afc2f1f1e633322 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sun, 3 Dec 2023 00:26:46 -0500 Subject: [PATCH 27/36] add periods. --- src/pi/camera_streamer/setup.py | 2 +- src/pi/pi_main/setup.py | 2 +- src/pi/pixhawk_communication/setup.py | 2 +- src/pi/realsense/setup.py | 2 +- src/surface/gui/setup.py | 2 +- src/surface/keyboard_driver/setup.py | 2 +- src/surface/ps5_controller/setup.py | 2 +- src/surface/ros2_video_streamer | 2 +- src/surface/rov_gazebo/setup.py | 2 +- src/surface/surface_main/setup.py | 2 +- src/surface/task_selector/setup.py | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/pi/camera_streamer/setup.py b/src/pi/camera_streamer/setup.py index 611a3215..bac93e20 100644 --- a/src/pi/camera_streamer/setup.py +++ b/src/pi/camera_streamer/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/pi/pi_main/setup.py b/src/pi/pi_main/setup.py index b171eb06..ec2ee179 100644 --- a/src/pi/pi_main/setup.py +++ b/src/pi/pi_main/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/pi/pixhawk_communication/setup.py b/src/pi/pixhawk_communication/setup.py index e91f4913..e4cf192c 100644 --- a/src/pi/pixhawk_communication/setup.py +++ b/src/pi/pixhawk_communication/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/pi/realsense/setup.py b/src/pi/realsense/setup.py index c272f269..abc5ab1d 100644 --- a/src/pi/realsense/setup.py +++ b/src/pi/realsense/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/surface/gui/setup.py b/src/surface/gui/setup.py index f81c62da..52daace6 100644 --- a/src/surface/gui/setup.py +++ b/src/surface/gui/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/surface/keyboard_driver/setup.py b/src/surface/keyboard_driver/setup.py index b05c10c0..e71f03a7 100644 --- a/src/surface/keyboard_driver/setup.py +++ b/src/surface/keyboard_driver/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/surface/ps5_controller/setup.py b/src/surface/ps5_controller/setup.py index adc6e3cb..6511a15c 100644 --- a/src/surface/ps5_controller/setup.py +++ b/src/surface/ps5_controller/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index d08ca82a..0380edae 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit d08ca82a1508ea769e040a04144d7870e9893ae8 +Subproject commit 0380edae295cce63e54bf8a58a778d519964c00b diff --git a/src/surface/rov_gazebo/setup.py b/src/surface/rov_gazebo/setup.py index e689898e..5c213d17 100644 --- a/src/surface/rov_gazebo/setup.py +++ b/src/surface/rov_gazebo/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/surface/surface_main/setup.py b/src/surface/surface_main/setup.py index a352bb79..6889b1ae 100644 --- a/src/surface/surface_main/setup.py +++ b/src/surface/surface_main/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob diff --git a/src/surface/task_selector/setup.py b/src/surface/task_selector/setup.py index e1f12979..013a21da 100644 --- a/src/surface/task_selector/setup.py +++ b/src/surface/task_selector/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module""" +"""setup.py for this module.""" import os from glob import glob From 59150f0238ac10d18b89eef68d11f07d2d230059 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Sun, 3 Dec 2023 00:29:56 -0500 Subject: [PATCH 28/36] module docstrings --- src/pi/camera_streamer/launch/camera_launch.py | 2 +- src/pi/pi_main/launch/pi_launch.py | 1 + src/pi/pi_main/pi_main/run_on_boot.py | 2 +- src/pi/pixhawk_communication/launch/mavros_launch.py | 1 + src/pi/realsense/launch/realsense_launch.py | 2 +- 5 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pi/camera_streamer/launch/camera_launch.py b/src/pi/camera_streamer/launch/camera_launch.py index e299828d..be904c14 100644 --- a/src/pi/camera_streamer/launch/camera_launch.py +++ b/src/pi/camera_streamer/launch/camera_launch.py @@ -1,4 +1,4 @@ -"""camera_streamer launch file""" +"""camera_streamer launch file.""" from launch.launch_description import LaunchDescription from launch_ros.actions import Node diff --git a/src/pi/pi_main/launch/pi_launch.py b/src/pi/pi_main/launch/pi_launch.py index cf6c5318..f5283446 100644 --- a/src/pi/pi_main/launch/pi_launch.py +++ b/src/pi/pi_main/launch/pi_launch.py @@ -1,3 +1,4 @@ +"""pi_launch launch file.""" import os from ament_index_python.packages import get_package_share_directory diff --git a/src/pi/pi_main/pi_main/run_on_boot.py b/src/pi/pi_main/pi_main/run_on_boot.py index 0273c27e..ea7f29ad 100644 --- a/src/pi/pi_main/pi_main/run_on_boot.py +++ b/src/pi/pi_main/pi_main/run_on_boot.py @@ -1,4 +1,4 @@ -"""When run sets up environment for the robot to run on boot""" +"""When run sets up environment for the robot to run on boot.""" import os import sys import subprocess diff --git a/src/pi/pixhawk_communication/launch/mavros_launch.py b/src/pi/pixhawk_communication/launch/mavros_launch.py index 71e94a6c..049654cc 100644 --- a/src/pi/pixhawk_communication/launch/mavros_launch.py +++ b/src/pi/pixhawk_communication/launch/mavros_launch.py @@ -1,3 +1,4 @@ +"""mavros_launch launch file.""" from launch.launch_description import LaunchDescription from launch_ros.actions import Node diff --git a/src/pi/realsense/launch/realsense_launch.py b/src/pi/realsense/launch/realsense_launch.py index d228b008..b998f2a0 100644 --- a/src/pi/realsense/launch/realsense_launch.py +++ b/src/pi/realsense/launch/realsense_launch.py @@ -1,3 +1,4 @@ +"""realsense_launch launch file.""" import os from ament_index_python.packages import get_package_share_directory @@ -17,7 +18,6 @@ def generate_launch_description() -> LaunchDescription: Launches realsense launch file. """ - realsense_path: str = get_package_share_directory('realsense2_camera') # Launches Realsense From b95885f0acf81369b1f2313c600e1020c20bb999 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 4 Dec 2023 15:40:08 -0500 Subject: [PATCH 29/36] better setup.py --- src/pi/camera_streamer/setup.py | 2 +- src/pi/manipulators/setup.py | 5 +---- src/pi/pi_main/setup.py | 2 +- src/pi/pixhawk_communication/setup.py | 2 +- src/pi/realsense/setup.py | 2 +- src/surface/gui/setup.py | 2 +- src/surface/keyboard_driver/setup.py | 2 +- src/surface/ps5_controller/setup.py | 2 +- src/surface/ros2_video_streamer | 2 +- src/surface/rov_gazebo/setup.py | 2 +- src/surface/surface_main/setup.py | 2 +- src/surface/task_selector/setup.py | 2 +- 12 files changed, 12 insertions(+), 15 deletions(-) diff --git a/src/pi/camera_streamer/setup.py b/src/pi/camera_streamer/setup.py index bac93e20..1dcab2c8 100644 --- a/src/pi/camera_streamer/setup.py +++ b/src/pi/camera_streamer/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for camera_streamer module.""" import os from glob import glob diff --git a/src/pi/manipulators/setup.py b/src/pi/manipulators/setup.py index 8d4dcc49..9a13a5db 100644 --- a/src/pi/manipulators/setup.py +++ b/src/pi/manipulators/setup.py @@ -1,12 +1,9 @@ +"""setup.py for manipulators module""" import os -import sys from glob import glob from setuptools import setup -major_num = sys.version_info[0] -minor_num = sys.version_info[1] - PACKAGE_NAME = 'manipulators' setup( diff --git a/src/pi/pi_main/setup.py b/src/pi/pi_main/setup.py index ec2ee179..6e345e61 100644 --- a/src/pi/pi_main/setup.py +++ b/src/pi/pi_main/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for pi_main module.""" import os from glob import glob diff --git a/src/pi/pixhawk_communication/setup.py b/src/pi/pixhawk_communication/setup.py index e4cf192c..f55542a6 100644 --- a/src/pi/pixhawk_communication/setup.py +++ b/src/pi/pixhawk_communication/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for pixhawk_communication module.""" import os from glob import glob diff --git a/src/pi/realsense/setup.py b/src/pi/realsense/setup.py index abc5ab1d..05114fa5 100644 --- a/src/pi/realsense/setup.py +++ b/src/pi/realsense/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for the realsense module.""" import os from glob import glob diff --git a/src/surface/gui/setup.py b/src/surface/gui/setup.py index 52daace6..c9480cf9 100644 --- a/src/surface/gui/setup.py +++ b/src/surface/gui/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for the gui module.""" import os from glob import glob diff --git a/src/surface/keyboard_driver/setup.py b/src/surface/keyboard_driver/setup.py index e71f03a7..a46c5b2f 100644 --- a/src/surface/keyboard_driver/setup.py +++ b/src/surface/keyboard_driver/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for the keyboard module.""" import os from glob import glob diff --git a/src/surface/ps5_controller/setup.py b/src/surface/ps5_controller/setup.py index 6511a15c..d844a8c7 100644 --- a/src/surface/ps5_controller/setup.py +++ b/src/surface/ps5_controller/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for the ps5_controller module.""" import os from glob import glob diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index 0380edae..783c1bbb 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit 0380edae295cce63e54bf8a58a778d519964c00b +Subproject commit 783c1bbb574829780c09c13401a6268b15cce045 diff --git a/src/surface/rov_gazebo/setup.py b/src/surface/rov_gazebo/setup.py index 5c213d17..33f49162 100644 --- a/src/surface/rov_gazebo/setup.py +++ b/src/surface/rov_gazebo/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for the rov_gazebo module.""" import os from glob import glob diff --git a/src/surface/surface_main/setup.py b/src/surface/surface_main/setup.py index 6889b1ae..83574567 100644 --- a/src/surface/surface_main/setup.py +++ b/src/surface/surface_main/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for the surface_main module.""" import os from glob import glob diff --git a/src/surface/task_selector/setup.py b/src/surface/task_selector/setup.py index 013a21da..26b3be3c 100644 --- a/src/surface/task_selector/setup.py +++ b/src/surface/task_selector/setup.py @@ -1,4 +1,4 @@ -"""setup.py for this module.""" +"""setup.py for the task_selector module.""" import os from glob import glob From 1bd29538f4b3f5230ca4f86b3a25ddc6505c9698 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 4 Dec 2023 15:44:55 -0500 Subject: [PATCH 30/36] add missing period. --- src/pi/manipulators/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pi/manipulators/setup.py b/src/pi/manipulators/setup.py index 9a13a5db..6c45869d 100644 --- a/src/pi/manipulators/setup.py +++ b/src/pi/manipulators/setup.py @@ -1,4 +1,4 @@ -"""setup.py for manipulators module""" +"""setup.py for manipulators module.""" import os from glob import glob From 3c66723fd5b282c353ab33432af24f68cdb77d61 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 4 Dec 2023 15:58:30 -0500 Subject: [PATCH 31/36] add missing module docstrings --- src/pi/camera_streamer/test/test_flake8.py | 1 + src/pi/camera_streamer/test/test_mypy.py | 1 + src/pi/camera_streamer/test/test_pep257.py | 1 + src/pi/manipulators/test/test_mypy.py | 1 + src/pi/manipulators/test/test_pep257.py | 1 + src/pi/pi_main/test/test_mypy.py | 1 + src/pi/pi_main/test/test_pep257.py | 1 + src/pi/pixhawk_communication/test/test_mypy.py | 1 + src/pi/pixhawk_communication/test/test_pep257.py | 1 + src/pi/realsense/test/test_mypy.py | 1 + src/pi/realsense/test/test_pep257.py | 1 + src/surface/gui/test/test_mypy.py | 1 + src/surface/gui/test/test_pep257.py | 1 + src/surface/keyboard_driver/test/test_mypy.py | 1 + src/surface/keyboard_driver/test/test_pep257.py | 1 + src/surface/ps5_controller/test/test_mypy.py | 1 + src/surface/ps5_controller/test/test_pep257.py | 1 + src/surface/rov_gazebo/test/test_mypy.py | 1 + src/surface/rov_gazebo/test/test_pep257.py | 1 + src/surface/surface_main/test/test_mypy.py | 1 + src/surface/surface_main/test/test_pep257.py | 1 + src/surface/task_selector/test/test_mypy.py | 1 + src/surface/task_selector/test/test_pep257.py | 1 + 23 files changed, 23 insertions(+) diff --git a/src/pi/camera_streamer/test/test_flake8.py b/src/pi/camera_streamer/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/pi/camera_streamer/test/test_flake8.py +++ b/src/pi/camera_streamer/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/pi/camera_streamer/test/test_mypy.py b/src/pi/camera_streamer/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/pi/camera_streamer/test/test_mypy.py +++ b/src/pi/camera_streamer/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/pi/camera_streamer/test/test_pep257.py b/src/pi/camera_streamer/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/pi/camera_streamer/test/test_pep257.py +++ b/src/pi/camera_streamer/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/pi/manipulators/test/test_mypy.py b/src/pi/manipulators/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/pi/manipulators/test/test_mypy.py +++ b/src/pi/manipulators/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/pi/manipulators/test/test_pep257.py b/src/pi/manipulators/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/pi/manipulators/test/test_pep257.py +++ b/src/pi/manipulators/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/pi/pi_main/test/test_mypy.py b/src/pi/pi_main/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/pi/pi_main/test/test_mypy.py +++ b/src/pi/pi_main/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/pi/pi_main/test/test_pep257.py b/src/pi/pi_main/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/pi/pi_main/test/test_pep257.py +++ b/src/pi/pi_main/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/pi/pixhawk_communication/test/test_mypy.py b/src/pi/pixhawk_communication/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/pi/pixhawk_communication/test/test_mypy.py +++ b/src/pi/pixhawk_communication/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/pi/pixhawk_communication/test/test_pep257.py b/src/pi/pixhawk_communication/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/pi/pixhawk_communication/test/test_pep257.py +++ b/src/pi/pixhawk_communication/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/pi/realsense/test/test_mypy.py b/src/pi/realsense/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/pi/realsense/test/test_mypy.py +++ b/src/pi/realsense/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/pi/realsense/test/test_pep257.py b/src/pi/realsense/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/pi/realsense/test/test_pep257.py +++ b/src/pi/realsense/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/gui/test/test_mypy.py b/src/surface/gui/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/surface/gui/test/test_mypy.py +++ b/src/surface/gui/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/surface/gui/test/test_pep257.py b/src/surface/gui/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/surface/gui/test/test_pep257.py +++ b/src/surface/gui/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/keyboard_driver/test/test_mypy.py b/src/surface/keyboard_driver/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/surface/keyboard_driver/test/test_mypy.py +++ b/src/surface/keyboard_driver/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/surface/keyboard_driver/test/test_pep257.py b/src/surface/keyboard_driver/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/surface/keyboard_driver/test/test_pep257.py +++ b/src/surface/keyboard_driver/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/ps5_controller/test/test_mypy.py b/src/surface/ps5_controller/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/surface/ps5_controller/test/test_mypy.py +++ b/src/surface/ps5_controller/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/surface/ps5_controller/test/test_pep257.py b/src/surface/ps5_controller/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/surface/ps5_controller/test/test_pep257.py +++ b/src/surface/ps5_controller/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/rov_gazebo/test/test_mypy.py b/src/surface/rov_gazebo/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/surface/rov_gazebo/test/test_mypy.py +++ b/src/surface/rov_gazebo/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/surface/rov_gazebo/test/test_pep257.py b/src/surface/rov_gazebo/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/surface/rov_gazebo/test/test_pep257.py +++ b/src/surface/rov_gazebo/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/surface_main/test/test_mypy.py b/src/surface/surface_main/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/surface/surface_main/test/test_mypy.py +++ b/src/surface/surface_main/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/surface/surface_main/test/test_pep257.py b/src/surface/surface_main/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/surface/surface_main/test/test_pep257.py +++ b/src/surface/surface_main/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/task_selector/test/test_mypy.py b/src/surface/task_selector/test/test_mypy.py index 2cb49a3d..79fc51ad 100644 --- a/src/surface/task_selector/test/test_mypy.py +++ b/src/surface/task_selector/test/test_mypy.py @@ -1,3 +1,4 @@ +"""Test mypy on this module.""" import os import pytest diff --git a/src/surface/task_selector/test/test_pep257.py b/src/surface/task_selector/test/test_pep257.py index 8e7dfaa7..b95ea531 100644 --- a/src/surface/task_selector/test/test_pep257.py +++ b/src/surface/task_selector/test/test_pep257.py @@ -1,3 +1,4 @@ +"""Test pep257 on this module.""" # Copyright 2015 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); From 592a5b5558e23bbbf35cd3307d2030b984aa57c2 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 4 Dec 2023 15:58:41 -0500 Subject: [PATCH 32/36] yippe --- src/pi/manipulators/test/test_flake8.py | 1 + src/pi/pi_main/test/test_flake8.py | 1 + src/pi/pixhawk_communication/test/test_flake8.py | 1 + src/pi/realsense/test/test_flake8.py | 1 + src/surface/gui/test/test_flake8.py | 1 + src/surface/keyboard_driver/test/test_flake8.py | 1 + src/surface/ps5_controller/test/test_flake8.py | 1 + src/surface/ros2_video_streamer | 2 +- src/surface/rov_gazebo/test/test_flake8.py | 1 + src/surface/surface_main/test/test_flake8.py | 1 + src/surface/task_selector/test/test_flake8.py | 1 + 11 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/pi/manipulators/test/test_flake8.py b/src/pi/manipulators/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/pi/manipulators/test/test_flake8.py +++ b/src/pi/manipulators/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/pi/pi_main/test/test_flake8.py b/src/pi/pi_main/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/pi/pi_main/test/test_flake8.py +++ b/src/pi/pi_main/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/pi/pixhawk_communication/test/test_flake8.py b/src/pi/pixhawk_communication/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/pi/pixhawk_communication/test/test_flake8.py +++ b/src/pi/pixhawk_communication/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/pi/realsense/test/test_flake8.py b/src/pi/realsense/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/pi/realsense/test/test_flake8.py +++ b/src/pi/realsense/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/gui/test/test_flake8.py b/src/surface/gui/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/surface/gui/test/test_flake8.py +++ b/src/surface/gui/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/keyboard_driver/test/test_flake8.py b/src/surface/keyboard_driver/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/surface/keyboard_driver/test/test_flake8.py +++ b/src/surface/keyboard_driver/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/ps5_controller/test/test_flake8.py b/src/surface/ps5_controller/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/surface/ps5_controller/test/test_flake8.py +++ b/src/surface/ps5_controller/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/ros2_video_streamer b/src/surface/ros2_video_streamer index 783c1bbb..0c7d9a1c 160000 --- a/src/surface/ros2_video_streamer +++ b/src/surface/ros2_video_streamer @@ -1 +1 @@ -Subproject commit 783c1bbb574829780c09c13401a6268b15cce045 +Subproject commit 0c7d9a1cb9d15abb115282939e66d1f92d2fdad5 diff --git a/src/surface/rov_gazebo/test/test_flake8.py b/src/surface/rov_gazebo/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/surface/rov_gazebo/test/test_flake8.py +++ b/src/surface/rov_gazebo/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/surface_main/test/test_flake8.py b/src/surface/surface_main/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/surface/surface_main/test/test_flake8.py +++ b/src/surface/surface_main/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/surface/task_selector/test/test_flake8.py b/src/surface/task_selector/test/test_flake8.py index d9f9ab38..8ae474ef 100644 --- a/src/surface/task_selector/test/test_flake8.py +++ b/src/surface/task_selector/test/test_flake8.py @@ -1,3 +1,4 @@ +"""Test flake8 on this module.""" # Copyright 2017 Open Source Robotics Foundation, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); From ac613d4b2f061a040779ea7333fa10dc7c8418d2 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 4 Dec 2023 16:16:51 -0500 Subject: [PATCH 33/36] add example --- README.md | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8e6e1bc1..0849412e 100644 --- a/README.md +++ b/README.md @@ -173,5 +173,26 @@ Any topics or services communicating across will be renamed first into the tethe Documentation will take place at 3 levels: - High Level - Overarching Design Document outlining our general structure and what goes where. -- Device Level - ROS Docs as set out in the ROS2 standards. -- Inline Level - Inline Documentation to the level that someone who has some basic code knowledge can understand what the code does. +- Device Level - Following the markdown tempate in `doc` directory. +- Inline Level - Using reST / Numpy Standard. To autogenerate in VSCode we use autoDocstring with the setting set to Numpy and auto docstring on new line. Below is an example of an inline function docstring. + +```python +def __init__(self, srv_type: SrvType, topic: str, signal: pyqtBoundSignal, + timeout: float = 1.0, expected_namespace: str = '/surface/gui'): + """ + _summary_ + + Parameters + ---------- + srv_type : SrvType + _description_ + topic : str + _description_ + signal : pyqtBoundSignal + _description_ + timeout : float, optional + _description_, by default 1.0 + expected_namespace : str, optional + _description_, by default '/surface/gui' + """ +``` From d4a40580879804bf3b5c87ebba9c07f0e42c386c Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 4 Dec 2023 16:17:37 -0500 Subject: [PATCH 34/36] add extension --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0849412e..50a629d1 100644 --- a/README.md +++ b/README.md @@ -174,7 +174,7 @@ Documentation will take place at 3 levels: - High Level - Overarching Design Document outlining our general structure and what goes where. - Device Level - Following the markdown tempate in `doc` directory. -- Inline Level - Using reST / Numpy Standard. To autogenerate in VSCode we use autoDocstring with the setting set to Numpy and auto docstring on new line. Below is an example of an inline function docstring. +- Inline Level - Using reST / Numpy Standard. To autogenerate in VSCode we use autoDocstring extension with the setting set to Numpy and auto docstring on new line. Below is an example of an inline function docstring. ```python def __init__(self, srv_type: SrvType, topic: str, signal: pyqtBoundSignal, From 24e15949aa7f6ee5d760a6216007970617d73fb7 Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 4 Dec 2023 16:22:58 -0500 Subject: [PATCH 35/36] add to setup --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 50a629d1..2c0fd0a9 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ git clone --recurse-submodules git@github.com:cwruRobotics/rov-24.git If you've never contributed to a git repository before, you might receive an error message saying you don't have access. In that case visit [this tutorial](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh) to set up SSH for local GitHub access. -After cloning the code, we need to set up our IDE: VSCode. If you already have it, great. Otherwise follow [this](https://code.visualstudio.com/download) tutorial. +After cloning the code, we need to set up our IDE: VSCode. If you already have it, great. Otherwise follow [this](https://code.visualstudio.com/download) tutorial. We recommend installing the mypy, flake8 and autoDocstring VSCode extensions. Our setting for autoDocstring are set to Numpy and auto docstring on new line. ### Linux @@ -134,6 +134,8 @@ If you're working on package's `setup.py` or rov_msgs, you'll need to run `🏃 If you want to run our unit tests use this command `colcon test --event-handlers=console_direct+`. +n VSCode, press `F1` or `ctrl+shift+p` and enter `Tasks: Run Test Task` as another method to run the above command. + It runs the tests and pipes the output to the terminal. To test pi_main make sure to type your password into the terminal after running the above command. If you install the flake8 and mypy extension they should help enforce the linters. From 37b4ff44881123133577e1b84775ff34dfca9bad Mon Sep 17 00:00:00 2001 From: Michael Carlstrom Date: Mon, 4 Dec 2023 18:13:31 -0500 Subject: [PATCH 36/36] in vscode --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2c0fd0a9..475afc8a 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ If you're working on package's `setup.py` or rov_msgs, you'll need to run `🏃 If you want to run our unit tests use this command `colcon test --event-handlers=console_direct+`. -n VSCode, press `F1` or `ctrl+shift+p` and enter `Tasks: Run Test Task` as another method to run the above command. +In VSCode, press `F1` or `ctrl+shift+p` and enter `Tasks: Run Test Task` as another method to run the above command. It runs the tests and pipes the output to the terminal. To test pi_main make sure to type your password into the terminal after running the above command.