Repository: ansys/ansys-tools-protoc-helper (language: python)

Issue:
Switch to isort for import sorting
See https://github.com/ansys/ansys-tools-protoc-helper/pull/34#discussion_r1090482484


Discussion / hints:

Fix patch:
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index dd9be22..562f2b8 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -3,11 +3,10 @@ repos:
   rev: 22.10.0
   hooks:
   - id: black
-- repo: https://github.com/asottile/reorder_python_imports
-  rev: v3.9.0
+- repo: https://github.com/pycqa/isort
+  rev:  5.11.5
   hooks:
-  - id: reorder-python-imports
-    args: ["--py37-plus"]
+  - id: isort
 - repo: https://github.com/PyCQA/flake8
   rev: 5.0.4
   hooks:
diff --git a/ansys/tools/protoc_helper/_compile_protos.py b/ansys/tools/protoc_helper/_compile_protos.py
index 456cae2..6e7a195 100644
--- a/ansys/tools/protoc_helper/_compile_protos.py
+++ b/ansys/tools/protoc_helper/_compile_protos.py
@@ -6,11 +6,10 @@
 import tempfile
 import warnings
 
-import importlib_resources  # Replace with importlib.resources once only Py3.9+ is supported
-import pkg_resources
 from grpc.tools import protoc
+import importlib_resources  # Replace with importlib.resources once only Py3.9+ is supported
 from importlib_resources.abc import Traversable
-
+import pkg_resources
 
 __all__ = ["compile_proto_files"]
 
diff --git a/pyproject.toml b/pyproject.toml
index ba5e380..fc07b0c 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -48,6 +48,13 @@ name = "ansys.tools.protoc_helper"
 line-length = 100
 target-version = ['py37']
 
+[tool.isort]
+profile = "black"
+force_sort_within_sections = true
+line_length = 100
+default_section = "THIRDPARTY"
+src_paths = ["doc", "ansys", "test"]
+
 [tool.pydocstyle]
 convention = "numpy"
 


Test patch:
diff --git a/test/test_data/testpkg-greeter-protos/setup.py b/test/test_data/testpkg-greeter-protos/setup.py
index 037d35b..58d552a 100644
--- a/test/test_data/testpkg-greeter-protos/setup.py
+++ b/test/test_data/testpkg-greeter-protos/setup.py
@@ -2,7 +2,6 @@
 
 from ansys.tools.protoc_helper import CMDCLASS_OVERRIDE
 
-
 if __name__ == "__main__":
     setuptools.setup(
         name="testpkg-greeter-protos",
diff --git a/test/test_data/testpkg-hello-protos/setup.py b/test/test_data/testpkg-hello-protos/setup.py
index 52418d9..1f8438e 100644
--- a/test/test_data/testpkg-hello-protos/setup.py
+++ b/test/test_data/testpkg-hello-protos/setup.py
@@ -2,7 +2,6 @@
 
 from ansys.tools.protoc_helper import CMDCLASS_OVERRIDE
 
-
 if __name__ == "__main__":
     setuptools.setup(
         name="testpkg-hello-protos",
diff --git a/test/test_integration.py b/test/test_integration.py
index dcfc070..04a2021 100644
--- a/test/test_integration.py
+++ b/test/test_integration.py
@@ -9,8 +9,8 @@
 import venv
 
 import pytest
-from conftest import PKG_ROOT_DIR
-from conftest import TEST_DATA_DIR
+
+from conftest import PKG_ROOT_DIR, TEST_DATA_DIR
 
 
 @pytest.fixture