From 9743829093af3fdf49ba96dfd7f0bbeaf82afcf5 Mon Sep 17 00:00:00 2001 From: Matthijs van der Burgh Date: Thu, 7 Sep 2023 15:08:12 +0200 Subject: [PATCH] (pykdl_ros) also run isort --- tf2_pykdl_ros/package.xml | 1 + tf2_pykdl_ros/pyproject.toml | 3 +++ tf2_pykdl_ros/setup.py | 1 + tf2_pykdl_ros/test/test_copyright.py | 2 +- tf2_pykdl_ros/test/test_flake8.py | 2 +- tf2_pykdl_ros/test/test_pep257.py | 2 +- tf2_pykdl_ros/test/test_tf2_ros_integration.py | 17 +++++++---------- .../test/test_tf2_ros_transform_node.py | 11 ++++++----- tf2_pykdl_ros/tf2_pykdl_ros/__init__.py | 13 +++++-------- 9 files changed, 26 insertions(+), 26 deletions(-) diff --git a/tf2_pykdl_ros/package.xml b/tf2_pykdl_ros/package.xml index 474ac27..8a481b7 100644 --- a/tf2_pykdl_ros/package.xml +++ b/tf2_pykdl_ros/package.xml @@ -24,6 +24,7 @@ builtin_interfaces rclpy tf2_geometry_msgs + python3-flake8-isort python3-pytest diff --git a/tf2_pykdl_ros/pyproject.toml b/tf2_pykdl_ros/pyproject.toml index 6d7785e..bbb24c4 100644 --- a/tf2_pykdl_ros/pyproject.toml +++ b/tf2_pykdl_ros/pyproject.toml @@ -1,5 +1,8 @@ [tool.black] line-length = 120 +[tool.isort] +line_length = 120 + [tool.pytest.ini_options] filterwarnings = ["ignore:SelectableGroups dict interface is deprecated. Use select.:DeprecationWarning"] diff --git a/tf2_pykdl_ros/setup.py b/tf2_pykdl_ros/setup.py index ffea419..91171bd 100644 --- a/tf2_pykdl_ros/setup.py +++ b/tf2_pykdl_ros/setup.py @@ -1,4 +1,5 @@ from os import path + from setuptools import find_packages, setup package_name = "tf2_pykdl_ros" diff --git a/tf2_pykdl_ros/test/test_copyright.py b/tf2_pykdl_ros/test/test_copyright.py index 95f0381..60c2d1e 100644 --- a/tf2_pykdl_ros/test/test_copyright.py +++ b/tf2_pykdl_ros/test/test_copyright.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ament_copyright.main import main import pytest +from ament_copyright.main import main # Remove the `skip` decorator once the source file(s) have a copyright header diff --git a/tf2_pykdl_ros/test/test_flake8.py b/tf2_pykdl_ros/test/test_flake8.py index 54d0279..a7e1231 100644 --- a/tf2_pykdl_ros/test/test_flake8.py +++ b/tf2_pykdl_ros/test/test_flake8.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ament_flake8.main import main_with_errors import pytest +from ament_flake8.main import main_with_errors @pytest.mark.flake8 diff --git a/tf2_pykdl_ros/test/test_pep257.py b/tf2_pykdl_ros/test/test_pep257.py index a2c3deb..4eddb46 100644 --- a/tf2_pykdl_ros/test/test_pep257.py +++ b/tf2_pykdl_ros/test/test_pep257.py @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ament_pep257.main import main import pytest +from ament_pep257.main import main @pytest.mark.linter diff --git a/tf2_pykdl_ros/test/test_tf2_ros_integration.py b/tf2_pykdl_ros/test/test_tf2_ros_integration.py index 8490509..d5aec82 100644 --- a/tf2_pykdl_ros/test/test_tf2_ros_integration.py +++ b/tf2_pykdl_ros/test/test_tf2_ros_integration.py @@ -1,17 +1,14 @@ import unittest -from builtin_interfaces.msg import Time -from geometry_msgs.msg import ( - PointStamped, - PoseStamped, - TransformStamped, - TwistStamped as TwistStampedMsg, - WrenchStamped as WrenchStampedMsg, -) import PyKDL as kdl -from pykdl_ros import VectorStamped, FrameStamped, TwistStamped, WrenchStamped -import tf2_ros import tf2_geometry_msgs # noqa: F401 +import tf2_ros +from builtin_interfaces.msg import Time +from geometry_msgs.msg import PointStamped, PoseStamped, TransformStamped +from geometry_msgs.msg import TwistStamped as TwistStampedMsg +from geometry_msgs.msg import WrenchStamped as WrenchStampedMsg +from pykdl_ros import FrameStamped, TwistStamped, VectorStamped, WrenchStamped + import tf2_pykdl_ros # noqa: F401 diff --git a/tf2_pykdl_ros/test/test_tf2_ros_transform_node.py b/tf2_pykdl_ros/test/test_tf2_ros_transform_node.py index cad394d..6b03445 100755 --- a/tf2_pykdl_ros/test/test_tf2_ros_transform_node.py +++ b/tf2_pykdl_ros/test/test_tf2_ros_transform_node.py @@ -2,14 +2,15 @@ import unittest -from builtin_interfaces.msg import Time -from geometry_msgs.msg import TransformStamped import PyKDL as kdl -from pykdl_ros import VectorStamped, FrameStamped, TwistStamped, WrenchStamped import rclpy -from rclpy.duration import Duration -import tf2_ros import tf2_geometry_msgs # noqa: F401 +import tf2_ros +from builtin_interfaces.msg import Time +from geometry_msgs.msg import TransformStamped +from pykdl_ros import FrameStamped, TwistStamped, VectorStamped, WrenchStamped +from rclpy.duration import Duration + import tf2_pykdl_ros # noqa: F401 diff --git a/tf2_pykdl_ros/tf2_pykdl_ros/__init__.py b/tf2_pykdl_ros/tf2_pykdl_ros/__init__.py index a37eeaf..d97bcbf 100644 --- a/tf2_pykdl_ros/tf2_pykdl_ros/__init__.py +++ b/tf2_pykdl_ros/tf2_pykdl_ros/__init__.py @@ -1,14 +1,11 @@ from typing import Union -from geometry_msgs.msg import ( - PointStamped, - PoseStamped, - TransformStamped, - TwistStamped as TwistStampedMsg, - WrenchStamped as WrenchStampedMsg, -) + import PyKDL as kdl -from pykdl_ros import VectorStamped, FrameStamped, TwistStamped, WrenchStamped import tf2_ros +from geometry_msgs.msg import PointStamped, PoseStamped, TransformStamped +from geometry_msgs.msg import TwistStamped as TwistStampedMsg +from geometry_msgs.msg import WrenchStamped as WrenchStampedMsg +from pykdl_ros import FrameStamped, TwistStamped, VectorStamped, WrenchStamped def transform_to_kdl(t: TransformStamped) -> kdl.Frame: