Skip to content

Commit 28e2f1a

Browse files
committed
fix: 🐞 isort fixes and proper enablement to suplement typing style
Signed-off-by: Onuralp SEZER <[email protected]>
1 parent 176fef1 commit 28e2f1a

File tree

13 files changed

+15
-26
lines changed

13 files changed

+15
-26
lines changed

β€Ž.pre-commit-config.yaml

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,13 @@ repos:
2626
- id: end-of-file-fixer
2727
- id: mixed-line-ending
2828

29-
3029
- repo: https://github.com/PyCQA/bandit
3130
rev: '1.7.9'
3231
hooks:
3332
- id: bandit
3433
args: ["-c", "pyproject.toml"]
3534
additional_dependencies: ["bandit[toml]"]
3635

37-
- repo: https://github.com/pycqa/isort
38-
rev: 5.13.2
39-
hooks:
40-
- id: isort
41-
name: isort (python)
42-
- id: isort
43-
name: isort (pyi)
44-
types: [pyi]
45-
46-
4736
- repo: https://github.com/astral-sh/ruff-pre-commit
4837
rev: v0.5.7
4938
hooks:

β€Ždemo.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -972,7 +972,7 @@
972972
}
973973
],
974974
"source": [
975-
"from supervision.assets import download_assets, VideoAssets\n",
975+
"from supervision.assets import VideoAssets, download_assets\n",
976976
"\n",
977977
"download_assets(VideoAssets.VEHICLES)\n",
978978
"VIDEO_PATH = VideoAssets.VEHICLES.value"

β€Žpyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,6 @@ types-pyyaml = "^6.0.12.20240808"
9898
types-requests = "^2.32.0.20240712"
9999
types-tqdm = "^4.66.0.20240417"
100100

101-
[tool.isort]
102-
line_length = 88
103-
profile = "black"
104101

105102
[tool.bandit]
106103
target = ["test", "supervision"]
@@ -163,9 +160,12 @@ exclude = [
163160
line-length = 88
164161
indent-width = 4
165162

163+
[tool.ruff.lint.isort]
164+
order-by-type = true
165+
166166
[tool.ruff.lint]
167167
# Enable pycodestyle (`E`) and Pyflakes (`F`) codes by default.
168-
select = ["E", "F"]
168+
select = ["E", "F", "I"]
169169
ignore = []
170170
# Allow autofix for all enabled rules (when `--fix`) is provided.
171171
fixable = [

β€Žtest/annotators/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from contextlib import ExitStack as DoesNotRaise
2-
from test.test_utils import mock_detections
32
from typing import Optional
43

54
import numpy as np
65
import pytest
76

87
from supervision.annotators.utils import ColorLookup, resolve_color_idx
98
from supervision.detection.core import Detections
9+
from test.test_utils import mock_detections
1010

1111

1212
@pytest.mark.parametrize(

β€Žtest/dataset/formats/test_pascal_voc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from contextlib import ExitStack as DoesNotRaise
2-
from test.test_utils import mock_detections
32
from typing import List, Optional
43

54
import defusedxml.ElementTree as ET
@@ -11,6 +10,7 @@
1110
object_to_pascal_voc,
1211
parse_polygon_points,
1312
)
13+
from test.test_utils import mock_detections
1414

1515

1616
def are_xml_elements_equal(elem1, elem2):

β€Žtest/dataset/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
from contextlib import ExitStack as DoesNotRaise
2-
from test.test_utils import mock_detections
32
from typing import List, Optional
43

54
import numpy as np
65
import pytest
76

87
from supervision import DetectionDataset
8+
from test.test_utils import mock_detections
99

1010

1111
@pytest.mark.parametrize(

β€Žtest/dataset/test_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
from contextlib import ExitStack as DoesNotRaise
2-
from test.test_utils import mock_detections
32
from typing import Dict, List, Optional, Tuple, TypeVar
43

54
import numpy as np
@@ -15,6 +14,7 @@
1514
rle_to_mask,
1615
train_test_split,
1716
)
17+
from test.test_utils import mock_detections
1818

1919
T = TypeVar("T")
2020

β€Žtest/detection/test_core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
from contextlib import ExitStack as DoesNotRaise
2-
from test.test_utils import mock_detections
32
from typing import List, Optional, Union
43

54
import numpy as np
65
import pytest
76

87
from supervision.detection.core import Detections, merge_inner_detection_object_pair
98
from supervision.geometry.core import Position
9+
from test.test_utils import mock_detections
1010

1111
PREDICTIONS = np.array(
1212
[

β€Žtest/detection/test_csv.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import csv
22
import os
3-
from test.test_utils import mock_detections
43
from typing import Any, Dict, List
54

65
import pytest
76

87
import supervision as sv
8+
from test.test_utils import mock_detections
99

1010

1111
@pytest.mark.parametrize(

β€Žtest/detection/test_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import json
22
import os
3-
from test.test_utils import mock_detections
43
from typing import Any, Dict, List
54

65
import pytest
76

87
import supervision as sv
8+
from test.test_utils import mock_detections
99

1010

1111
@pytest.mark.parametrize(

0 commit comments

Comments
Β (0)