diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml index 2bf9b6dd..977b3f8b 100644 --- a/.github/workflows/ci-tests.yml +++ b/.github/workflows/ci-tests.yml @@ -48,7 +48,7 @@ jobs: run: uv run python -c "import supervision; from supervision import assets; from supervision import metrics; print(supervision.__version__)" - name: 🧪 Run the Test - run: uv run pytest --cov=supervision --cov-report=xml --ignore=examples + run: uv run pytest src/ tests/ --cov=supervision --cov-report=xml - name: Generate Coverage Report run: | diff --git a/pyproject.toml b/pyproject.toml index 1be923f5..7b987a21 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -100,8 +100,10 @@ include-package-data = false supervision = [ "py.typed" ] [tool.setuptools.packages.find] +where = [ "src" ] include = [ "supervision*" ] -exclude = [ "docs*", "test*", "examples*" ] + +#exclude = [ "docs*", "tests*", "examples*" ] [tool.ruff] target-version = "py39" @@ -160,10 +162,10 @@ lint.select = [ ] lint.ignore = [ ] lint.per-file-ignores."__init__.py" = [ "E402", "F401" ] -lint.per-file-ignores."supervision/**" = [ +lint.per-file-ignores."src/**" = [ "S101", # TODO: Replace asserts with proper error handling ] -lint.per-file-ignores."test/**" = [ +lint.per-file-ignores."tests/**" = [ "PT011", # TODO: `pytest.raises(Exception)` is too broad, set the `match` parameter or use a more specific exception "S101", # Use of `assert` detected ] @@ -198,17 +200,17 @@ python_version = "3.9" ignore_missing_imports = false explicit_package_bases = true strict = true -exclude = [ - ".github", - "docs", - "test", - "examples", - "setup.py", -] +mypy_path = "src" +#exclude = [ +# "docs", +# "test", +# "examples", +# "setup.py", +#] [[tool.mypy.overrides]] module = [ - "test.*", + "tests.*", "examples.*", # TODO: fix type errors in the following modules "supervision.classification.core", diff --git a/supervision/__init__.py b/src/supervision/__init__.py similarity index 100% rename from supervision/__init__.py rename to src/supervision/__init__.py diff --git a/supervision/annotators/__init__.py b/src/supervision/annotators/__init__.py similarity index 100% rename from supervision/annotators/__init__.py rename to src/supervision/annotators/__init__.py diff --git a/supervision/annotators/base.py b/src/supervision/annotators/base.py similarity index 100% rename from supervision/annotators/base.py rename to src/supervision/annotators/base.py diff --git a/supervision/annotators/core.py b/src/supervision/annotators/core.py similarity index 100% rename from supervision/annotators/core.py rename to src/supervision/annotators/core.py diff --git a/supervision/annotators/utils.py b/src/supervision/annotators/utils.py similarity index 100% rename from supervision/annotators/utils.py rename to src/supervision/annotators/utils.py diff --git a/supervision/assets/__init__.py b/src/supervision/assets/__init__.py similarity index 100% rename from supervision/assets/__init__.py rename to src/supervision/assets/__init__.py diff --git a/supervision/assets/downloader.py b/src/supervision/assets/downloader.py similarity index 100% rename from supervision/assets/downloader.py rename to src/supervision/assets/downloader.py diff --git a/supervision/assets/list.py b/src/supervision/assets/list.py similarity index 100% rename from supervision/assets/list.py rename to src/supervision/assets/list.py diff --git a/supervision/classification/__init__.py b/src/supervision/classification/__init__.py similarity index 100% rename from supervision/classification/__init__.py rename to src/supervision/classification/__init__.py diff --git a/supervision/classification/core.py b/src/supervision/classification/core.py similarity index 100% rename from supervision/classification/core.py rename to src/supervision/classification/core.py diff --git a/supervision/config.py b/src/supervision/config.py similarity index 100% rename from supervision/config.py rename to src/supervision/config.py diff --git a/supervision/dataset/__init__.py b/src/supervision/dataset/__init__.py similarity index 100% rename from supervision/dataset/__init__.py rename to src/supervision/dataset/__init__.py diff --git a/supervision/dataset/core.py b/src/supervision/dataset/core.py similarity index 100% rename from supervision/dataset/core.py rename to src/supervision/dataset/core.py diff --git a/supervision/dataset/formats/__init__.py b/src/supervision/dataset/formats/__init__.py similarity index 100% rename from supervision/dataset/formats/__init__.py rename to src/supervision/dataset/formats/__init__.py diff --git a/supervision/dataset/formats/coco.py b/src/supervision/dataset/formats/coco.py similarity index 100% rename from supervision/dataset/formats/coco.py rename to src/supervision/dataset/formats/coco.py diff --git a/supervision/dataset/formats/pascal_voc.py b/src/supervision/dataset/formats/pascal_voc.py similarity index 100% rename from supervision/dataset/formats/pascal_voc.py rename to src/supervision/dataset/formats/pascal_voc.py diff --git a/supervision/dataset/formats/yolo.py b/src/supervision/dataset/formats/yolo.py similarity index 100% rename from supervision/dataset/formats/yolo.py rename to src/supervision/dataset/formats/yolo.py diff --git a/supervision/dataset/utils.py b/src/supervision/dataset/utils.py similarity index 100% rename from supervision/dataset/utils.py rename to src/supervision/dataset/utils.py diff --git a/supervision/detection/__init__.py b/src/supervision/detection/__init__.py similarity index 100% rename from supervision/detection/__init__.py rename to src/supervision/detection/__init__.py diff --git a/supervision/detection/core.py b/src/supervision/detection/core.py similarity index 100% rename from supervision/detection/core.py rename to src/supervision/detection/core.py diff --git a/supervision/detection/line_zone.py b/src/supervision/detection/line_zone.py similarity index 100% rename from supervision/detection/line_zone.py rename to src/supervision/detection/line_zone.py diff --git a/supervision/detection/tools/__init__.py b/src/supervision/detection/tools/__init__.py similarity index 100% rename from supervision/detection/tools/__init__.py rename to src/supervision/detection/tools/__init__.py diff --git a/supervision/detection/tools/csv_sink.py b/src/supervision/detection/tools/csv_sink.py similarity index 100% rename from supervision/detection/tools/csv_sink.py rename to src/supervision/detection/tools/csv_sink.py diff --git a/supervision/detection/tools/inference_slicer.py b/src/supervision/detection/tools/inference_slicer.py similarity index 100% rename from supervision/detection/tools/inference_slicer.py rename to src/supervision/detection/tools/inference_slicer.py diff --git a/supervision/detection/tools/json_sink.py b/src/supervision/detection/tools/json_sink.py similarity index 100% rename from supervision/detection/tools/json_sink.py rename to src/supervision/detection/tools/json_sink.py diff --git a/supervision/detection/tools/polygon_zone.py b/src/supervision/detection/tools/polygon_zone.py similarity index 100% rename from supervision/detection/tools/polygon_zone.py rename to src/supervision/detection/tools/polygon_zone.py diff --git a/supervision/detection/tools/smoother.py b/src/supervision/detection/tools/smoother.py similarity index 100% rename from supervision/detection/tools/smoother.py rename to src/supervision/detection/tools/smoother.py diff --git a/supervision/detection/tools/transformers.py b/src/supervision/detection/tools/transformers.py similarity index 100% rename from supervision/detection/tools/transformers.py rename to src/supervision/detection/tools/transformers.py diff --git a/supervision/detection/utils/__init__.py b/src/supervision/detection/utils/__init__.py similarity index 100% rename from supervision/detection/utils/__init__.py rename to src/supervision/detection/utils/__init__.py diff --git a/supervision/detection/utils/boxes.py b/src/supervision/detection/utils/boxes.py similarity index 100% rename from supervision/detection/utils/boxes.py rename to src/supervision/detection/utils/boxes.py diff --git a/supervision/detection/utils/converters.py b/src/supervision/detection/utils/converters.py similarity index 100% rename from supervision/detection/utils/converters.py rename to src/supervision/detection/utils/converters.py diff --git a/supervision/detection/utils/internal.py b/src/supervision/detection/utils/internal.py similarity index 100% rename from supervision/detection/utils/internal.py rename to src/supervision/detection/utils/internal.py diff --git a/supervision/detection/utils/iou_and_nms.py b/src/supervision/detection/utils/iou_and_nms.py similarity index 100% rename from supervision/detection/utils/iou_and_nms.py rename to src/supervision/detection/utils/iou_and_nms.py diff --git a/supervision/detection/utils/masks.py b/src/supervision/detection/utils/masks.py similarity index 100% rename from supervision/detection/utils/masks.py rename to src/supervision/detection/utils/masks.py diff --git a/supervision/detection/utils/polygons.py b/src/supervision/detection/utils/polygons.py similarity index 100% rename from supervision/detection/utils/polygons.py rename to src/supervision/detection/utils/polygons.py diff --git a/supervision/detection/utils/vlms.py b/src/supervision/detection/utils/vlms.py similarity index 100% rename from supervision/detection/utils/vlms.py rename to src/supervision/detection/utils/vlms.py diff --git a/supervision/detection/vlm.py b/src/supervision/detection/vlm.py similarity index 100% rename from supervision/detection/vlm.py rename to src/supervision/detection/vlm.py diff --git a/supervision/draw/__init__.py b/src/supervision/draw/__init__.py similarity index 100% rename from supervision/draw/__init__.py rename to src/supervision/draw/__init__.py diff --git a/supervision/draw/base.py b/src/supervision/draw/base.py similarity index 100% rename from supervision/draw/base.py rename to src/supervision/draw/base.py diff --git a/supervision/draw/color.py b/src/supervision/draw/color.py similarity index 100% rename from supervision/draw/color.py rename to src/supervision/draw/color.py diff --git a/supervision/draw/utils.py b/src/supervision/draw/utils.py similarity index 100% rename from supervision/draw/utils.py rename to src/supervision/draw/utils.py diff --git a/supervision/geometry/__init__.py b/src/supervision/geometry/__init__.py similarity index 100% rename from supervision/geometry/__init__.py rename to src/supervision/geometry/__init__.py diff --git a/supervision/geometry/core.py b/src/supervision/geometry/core.py similarity index 100% rename from supervision/geometry/core.py rename to src/supervision/geometry/core.py diff --git a/supervision/geometry/utils.py b/src/supervision/geometry/utils.py similarity index 100% rename from supervision/geometry/utils.py rename to src/supervision/geometry/utils.py diff --git a/supervision/key_points/__init__.py b/src/supervision/key_points/__init__.py similarity index 100% rename from supervision/key_points/__init__.py rename to src/supervision/key_points/__init__.py diff --git a/supervision/key_points/annotators.py b/src/supervision/key_points/annotators.py similarity index 100% rename from supervision/key_points/annotators.py rename to src/supervision/key_points/annotators.py diff --git a/supervision/key_points/core.py b/src/supervision/key_points/core.py similarity index 100% rename from supervision/key_points/core.py rename to src/supervision/key_points/core.py diff --git a/supervision/key_points/skeletons.py b/src/supervision/key_points/skeletons.py similarity index 100% rename from supervision/key_points/skeletons.py rename to src/supervision/key_points/skeletons.py diff --git a/supervision/metrics/__init__.py b/src/supervision/metrics/__init__.py similarity index 100% rename from supervision/metrics/__init__.py rename to src/supervision/metrics/__init__.py diff --git a/supervision/metrics/core.py b/src/supervision/metrics/core.py similarity index 100% rename from supervision/metrics/core.py rename to src/supervision/metrics/core.py diff --git a/supervision/metrics/detection.py b/src/supervision/metrics/detection.py similarity index 100% rename from supervision/metrics/detection.py rename to src/supervision/metrics/detection.py diff --git a/supervision/metrics/f1_score.py b/src/supervision/metrics/f1_score.py similarity index 100% rename from supervision/metrics/f1_score.py rename to src/supervision/metrics/f1_score.py diff --git a/supervision/metrics/mean_average_precision.py b/src/supervision/metrics/mean_average_precision.py similarity index 100% rename from supervision/metrics/mean_average_precision.py rename to src/supervision/metrics/mean_average_precision.py diff --git a/supervision/metrics/mean_average_recall.py b/src/supervision/metrics/mean_average_recall.py similarity index 100% rename from supervision/metrics/mean_average_recall.py rename to src/supervision/metrics/mean_average_recall.py diff --git a/supervision/metrics/precision.py b/src/supervision/metrics/precision.py similarity index 100% rename from supervision/metrics/precision.py rename to src/supervision/metrics/precision.py diff --git a/supervision/metrics/recall.py b/src/supervision/metrics/recall.py similarity index 100% rename from supervision/metrics/recall.py rename to src/supervision/metrics/recall.py diff --git a/supervision/metrics/utils/__init__.py b/src/supervision/metrics/utils/__init__.py similarity index 100% rename from supervision/metrics/utils/__init__.py rename to src/supervision/metrics/utils/__init__.py diff --git a/supervision/metrics/utils/object_size.py b/src/supervision/metrics/utils/object_size.py similarity index 100% rename from supervision/metrics/utils/object_size.py rename to src/supervision/metrics/utils/object_size.py diff --git a/supervision/metrics/utils/utils.py b/src/supervision/metrics/utils/utils.py similarity index 100% rename from supervision/metrics/utils/utils.py rename to src/supervision/metrics/utils/utils.py diff --git a/supervision/py.typed b/src/supervision/py.typed similarity index 100% rename from supervision/py.typed rename to src/supervision/py.typed diff --git a/supervision/tracker/__init__.py b/src/supervision/tracker/__init__.py similarity index 100% rename from supervision/tracker/__init__.py rename to src/supervision/tracker/__init__.py diff --git a/supervision/tracker/byte_tracker/__init__.py b/src/supervision/tracker/byte_tracker/__init__.py similarity index 100% rename from supervision/tracker/byte_tracker/__init__.py rename to src/supervision/tracker/byte_tracker/__init__.py diff --git a/supervision/tracker/byte_tracker/core.py b/src/supervision/tracker/byte_tracker/core.py similarity index 100% rename from supervision/tracker/byte_tracker/core.py rename to src/supervision/tracker/byte_tracker/core.py diff --git a/supervision/tracker/byte_tracker/kalman_filter.py b/src/supervision/tracker/byte_tracker/kalman_filter.py similarity index 100% rename from supervision/tracker/byte_tracker/kalman_filter.py rename to src/supervision/tracker/byte_tracker/kalman_filter.py diff --git a/supervision/tracker/byte_tracker/matching.py b/src/supervision/tracker/byte_tracker/matching.py similarity index 100% rename from supervision/tracker/byte_tracker/matching.py rename to src/supervision/tracker/byte_tracker/matching.py diff --git a/supervision/tracker/byte_tracker/single_object_track.py b/src/supervision/tracker/byte_tracker/single_object_track.py similarity index 100% rename from supervision/tracker/byte_tracker/single_object_track.py rename to src/supervision/tracker/byte_tracker/single_object_track.py diff --git a/supervision/tracker/byte_tracker/utils.py b/src/supervision/tracker/byte_tracker/utils.py similarity index 100% rename from supervision/tracker/byte_tracker/utils.py rename to src/supervision/tracker/byte_tracker/utils.py diff --git a/supervision/utils/__init__.py b/src/supervision/utils/__init__.py similarity index 100% rename from supervision/utils/__init__.py rename to src/supervision/utils/__init__.py diff --git a/supervision/utils/conversion.py b/src/supervision/utils/conversion.py similarity index 100% rename from supervision/utils/conversion.py rename to src/supervision/utils/conversion.py diff --git a/supervision/utils/file.py b/src/supervision/utils/file.py similarity index 100% rename from supervision/utils/file.py rename to src/supervision/utils/file.py diff --git a/supervision/utils/image.py b/src/supervision/utils/image.py similarity index 100% rename from supervision/utils/image.py rename to src/supervision/utils/image.py diff --git a/supervision/utils/internal.py b/src/supervision/utils/internal.py similarity index 100% rename from supervision/utils/internal.py rename to src/supervision/utils/internal.py diff --git a/supervision/utils/iterables.py b/src/supervision/utils/iterables.py similarity index 100% rename from supervision/utils/iterables.py rename to src/supervision/utils/iterables.py diff --git a/supervision/utils/notebook.py b/src/supervision/utils/notebook.py similarity index 100% rename from supervision/utils/notebook.py rename to src/supervision/utils/notebook.py diff --git a/supervision/utils/video.py b/src/supervision/utils/video.py similarity index 100% rename from supervision/utils/video.py rename to src/supervision/utils/video.py diff --git a/supervision/validators/__init__.py b/src/supervision/validators/__init__.py similarity index 100% rename from supervision/validators/__init__.py rename to src/supervision/validators/__init__.py diff --git a/test/__init__.py b/tests/__init__.py similarity index 100% rename from test/__init__.py rename to tests/__init__.py diff --git a/test/annotators/__init__.py b/tests/annotators/__init__.py similarity index 100% rename from test/annotators/__init__.py rename to tests/annotators/__init__.py diff --git a/test/annotators/test_core.py b/tests/annotators/test_core.py similarity index 99% rename from test/annotators/test_core.py rename to tests/annotators/test_core.py index 0b07830d..233b15c5 100644 --- a/test/annotators/test_core.py +++ b/tests/annotators/test_core.py @@ -31,7 +31,7 @@ from supervision.annotators.utils import ColorLookup from supervision.detection.core import Detections from supervision.draw.color import Color from supervision.geometry.core import Position -from test.helpers import _create_detections, assert_image_mostly_same +from tests.helpers import _create_detections, assert_image_mostly_same @pytest.fixture diff --git a/test/annotators/test_utils.py b/tests/annotators/test_utils.py similarity index 99% rename from test/annotators/test_utils.py rename to tests/annotators/test_utils.py index 37264369..c223c80a 100644 --- a/test/annotators/test_utils.py +++ b/tests/annotators/test_utils.py @@ -7,7 +7,7 @@ import pytest from supervision.annotators.utils import ColorLookup, resolve_color_idx, wrap_text from supervision.detection.core import Detections -from test.helpers import _create_detections +from tests.helpers import _create_detections @pytest.mark.parametrize( diff --git a/test/assets/__init__.py b/tests/assets/__init__.py similarity index 100% rename from test/assets/__init__.py rename to tests/assets/__init__.py diff --git a/test/assets/test_downloader.py b/tests/assets/test_downloader.py similarity index 100% rename from test/assets/test_downloader.py rename to tests/assets/test_downloader.py diff --git a/test/assets/test_list.py b/tests/assets/test_list.py similarity index 100% rename from test/assets/test_list.py rename to tests/assets/test_list.py diff --git a/test/classification/__init__.py b/tests/classification/__init__.py similarity index 100% rename from test/classification/__init__.py rename to tests/classification/__init__.py diff --git a/test/classification/test_core.py b/tests/classification/test_core.py similarity index 100% rename from test/classification/test_core.py rename to tests/classification/test_core.py diff --git a/test/conftest.py b/tests/conftest.py similarity index 96% rename from test/conftest.py rename to tests/conftest.py index cd03031e..60273c78 100644 --- a/test/conftest.py +++ b/tests/conftest.py @@ -2,7 +2,7 @@ import numpy as np import pytest import supervision as sv -from test.helpers import _create_key_points +from tests.helpers import _create_key_points @pytest.fixture diff --git a/test/dataset/__init__.py b/tests/dataset/__init__.py similarity index 100% rename from test/dataset/__init__.py rename to tests/dataset/__init__.py diff --git a/test/dataset/formats/__init__.py b/tests/dataset/formats/__init__.py similarity index 100% rename from test/dataset/formats/__init__.py rename to tests/dataset/formats/__init__.py diff --git a/test/dataset/formats/test_coco.py b/tests/dataset/formats/test_coco.py similarity index 100% rename from test/dataset/formats/test_coco.py rename to tests/dataset/formats/test_coco.py diff --git a/test/dataset/formats/test_pascal_voc.py b/tests/dataset/formats/test_pascal_voc.py similarity index 99% rename from test/dataset/formats/test_pascal_voc.py rename to tests/dataset/formats/test_pascal_voc.py index fe31e666..1a918848 100644 --- a/test/dataset/formats/test_pascal_voc.py +++ b/tests/dataset/formats/test_pascal_voc.py @@ -11,7 +11,7 @@ from supervision.dataset.formats.pascal_voc import ( object_to_pascal_voc, parse_polygon_points, ) -from test.helpers import _create_detections +from tests.helpers import _create_detections def are_xml_elements_equal(elem1, elem2): diff --git a/test/dataset/formats/test_yolo.py b/tests/dataset/formats/test_yolo.py similarity index 100% rename from test/dataset/formats/test_yolo.py rename to tests/dataset/formats/test_yolo.py diff --git a/test/dataset/test_core.py b/tests/dataset/test_core.py similarity index 99% rename from test/dataset/test_core.py rename to tests/dataset/test_core.py index 2ebdbe8f..3be0e9ea 100644 --- a/test/dataset/test_core.py +++ b/tests/dataset/test_core.py @@ -5,7 +5,7 @@ from contextlib import ExitStack as DoesNotRaise import pytest from supervision import DetectionDataset -from test.helpers import _create_detections +from tests.helpers import _create_detections @pytest.mark.parametrize( diff --git a/test/dataset/test_utils.py b/tests/dataset/test_utils.py similarity index 99% rename from test/dataset/test_utils.py rename to tests/dataset/test_utils.py index 71fce1e3..5e6563d4 100644 --- a/test/dataset/test_utils.py +++ b/tests/dataset/test_utils.py @@ -16,7 +16,7 @@ from supervision.dataset.utils import ( rle_to_mask, train_test_split, ) -from test.helpers import _create_detections +from tests.helpers import _create_detections T = TypeVar("T") diff --git a/test/detection/__init__.py b/tests/detection/__init__.py similarity index 100% rename from test/detection/__init__.py rename to tests/detection/__init__.py diff --git a/test/detection/test_core.py b/tests/detection/test_core.py similarity index 99% rename from test/detection/test_core.py rename to tests/detection/test_core.py index 8cdb3393..935a734c 100644 --- a/test/detection/test_core.py +++ b/tests/detection/test_core.py @@ -7,7 +7,7 @@ import pytest from supervision.detection.core import Detections, merge_inner_detection_object_pair from supervision.geometry.core import Position -from test.helpers import _create_detections +from tests.helpers import _create_detections PREDICTIONS = np.array( [ diff --git a/test/detection/test_csv.py b/tests/detection/test_csv.py similarity index 99% rename from test/detection/test_csv.py rename to tests/detection/test_csv.py index 99440b7f..12d52058 100644 --- a/test/detection/test_csv.py +++ b/tests/detection/test_csv.py @@ -5,7 +5,7 @@ from typing import Any import pytest import supervision as sv -from test.helpers import _create_detections +from tests.helpers import _create_detections @pytest.mark.parametrize( diff --git a/test/detection/test_from_adapters.py b/tests/detection/test_from_adapters.py similarity index 99% rename from test/detection/test_from_adapters.py rename to tests/detection/test_from_adapters.py index f31988ea..7cc0d0d3 100644 --- a/test/detection/test_from_adapters.py +++ b/tests/detection/test_from_adapters.py @@ -6,7 +6,7 @@ import pytest import supervision.detection.core as detection_core from supervision.config import CLASS_NAME_DATA_FIELD from supervision.detection.core import Detections -from test.helpers import ( +from tests.helpers import ( _FakeUltralyticsBoxes, _FakeUltralyticsResults, _FakeYoloNasPrediction, diff --git a/test/detection/test_json.py b/tests/detection/test_json.py similarity index 99% rename from test/detection/test_json.py rename to tests/detection/test_json.py index a64ce927..0d1218aa 100644 --- a/test/detection/test_json.py +++ b/tests/detection/test_json.py @@ -5,7 +5,7 @@ from typing import Any import pytest import supervision as sv -from test.helpers import _create_detections +from tests.helpers import _create_detections @pytest.mark.parametrize( diff --git a/test/detection/test_line_counter.py b/tests/detection/test_line_counter.py similarity index 99% rename from test/detection/test_line_counter.py rename to tests/detection/test_line_counter.py index caa2889f..257f8c98 100644 --- a/test/detection/test_line_counter.py +++ b/tests/detection/test_line_counter.py @@ -6,7 +6,7 @@ import pytest from supervision import LineZone from supervision.geometry.core import Point, Position, Vector -from test.helpers import _create_detections +from tests.helpers import _create_detections @pytest.mark.parametrize( diff --git a/test/detection/test_polygon_zone_annotator.py b/tests/detection/test_polygon_zone_annotator.py similarity index 100% rename from test/detection/test_polygon_zone_annotator.py rename to tests/detection/test_polygon_zone_annotator.py diff --git a/test/detection/test_polygonzone.py b/tests/detection/test_polygonzone.py similarity index 98% rename from test/detection/test_polygonzone.py rename to tests/detection/test_polygonzone.py index d64c1fc4..82599f30 100644 --- a/test/detection/test_polygonzone.py +++ b/tests/detection/test_polygonzone.py @@ -4,7 +4,7 @@ import numpy as np import pytest import supervision as sv -from test.helpers import _create_detections +from tests.helpers import _create_detections DETECTION_BOXES = np.array( [ diff --git a/test/detection/test_vlm.py b/tests/detection/test_vlm.py similarity index 100% rename from test/detection/test_vlm.py rename to tests/detection/test_vlm.py diff --git a/test/detection/tools/test_inference_slicer.py b/tests/detection/tools/test_inference_slicer.py similarity index 100% rename from test/detection/tools/test_inference_slicer.py rename to tests/detection/tools/test_inference_slicer.py diff --git a/test/detection/utils/__init__.py b/tests/detection/utils/__init__.py similarity index 100% rename from test/detection/utils/__init__.py rename to tests/detection/utils/__init__.py diff --git a/test/detection/utils/test_boxes.py b/tests/detection/utils/test_boxes.py similarity index 100% rename from test/detection/utils/test_boxes.py rename to tests/detection/utils/test_boxes.py diff --git a/test/detection/utils/test_converters.py b/tests/detection/utils/test_converters.py similarity index 100% rename from test/detection/utils/test_converters.py rename to tests/detection/utils/test_converters.py diff --git a/test/detection/utils/test_internal.py b/tests/detection/utils/test_internal.py similarity index 100% rename from test/detection/utils/test_internal.py rename to tests/detection/utils/test_internal.py diff --git a/test/detection/utils/test_iou_and_nms.py b/tests/detection/utils/test_iou_and_nms.py similarity index 99% rename from test/detection/utils/test_iou_and_nms.py rename to tests/detection/utils/test_iou_and_nms.py index d0bb0ad2..aa5a3253 100644 --- a/test/detection/utils/test_iou_and_nms.py +++ b/tests/detection/utils/test_iou_and_nms.py @@ -14,7 +14,7 @@ from supervision.detection.utils.iou_and_nms import ( mask_non_max_merge, mask_non_max_suppression, ) -from test.helpers import _generate_random_boxes +from tests.helpers import _generate_random_boxes @pytest.mark.parametrize( diff --git a/test/detection/utils/test_masks.py b/tests/detection/utils/test_masks.py similarity index 100% rename from test/detection/utils/test_masks.py rename to tests/detection/utils/test_masks.py diff --git a/test/detection/utils/test_polygons.py b/tests/detection/utils/test_polygons.py similarity index 100% rename from test/detection/utils/test_polygons.py rename to tests/detection/utils/test_polygons.py diff --git a/test/detection/utils/test_vlms.py b/tests/detection/utils/test_vlms.py similarity index 100% rename from test/detection/utils/test_vlms.py rename to tests/detection/utils/test_vlms.py diff --git a/test/draw/__init__.py b/tests/draw/__init__.py similarity index 100% rename from test/draw/__init__.py rename to tests/draw/__init__.py diff --git a/test/draw/test_color.py b/tests/draw/test_color.py similarity index 100% rename from test/draw/test_color.py rename to tests/draw/test_color.py diff --git a/test/geometry/__init__.py b/tests/geometry/__init__.py similarity index 100% rename from test/geometry/__init__.py rename to tests/geometry/__init__.py diff --git a/test/geometry/test_core.py b/tests/geometry/test_core.py similarity index 100% rename from test/geometry/test_core.py rename to tests/geometry/test_core.py diff --git a/test/geometry/test_utils.py b/tests/geometry/test_utils.py similarity index 100% rename from test/geometry/test_utils.py rename to tests/geometry/test_utils.py diff --git a/test/helpers.py b/tests/helpers.py similarity index 97% rename from test/helpers.py rename to tests/helpers.py index 0c8fc349..7a7bbdcb 100644 --- a/test/helpers.py +++ b/tests/helpers.py @@ -45,7 +45,6 @@ def _create_detections( Examples: >>> import numpy as np - >>> from test.helpers import _create_detections >>> detections = _create_detections( ... xyxy=[[0, 0, 10, 10], [20, 20, 30, 30]], ... confidence=[0.5, 0.8], @@ -102,7 +101,6 @@ def _create_key_points( Examples: >>> import numpy as np - >>> from test.helpers import _create_key_points >>> key_points = _create_key_points( ... xy=[[[0, 0], [10, 10]], [[20, 20], [30, 30]]], ... confidence=[[0.5, 0.8], [0.9, 0.1]], @@ -159,7 +157,6 @@ def _generate_random_boxes( `(x_min, y_min, x_max, y_max)`. Examples: - >>> from test.helpers import _generate_random_boxes >>> boxes = _generate_random_boxes( ... count=2, image_size=(1000, 1000), ... min_box_size=10, max_box_size=20, seed=42) @@ -199,7 +196,6 @@ def assert_almost_equal(actual, expected, tolerance=1e-5): and `expected`. Examples: - >>> from test.helpers import assert_almost_equal >>> assert_almost_equal(0.500001, 0.5) >>> assert_almost_equal(0.6, 0.5, tolerance=0.2) >>> assert_almost_equal(0.6, 0.5) diff --git a/test/key_points/__init__.py b/tests/key_points/__init__.py similarity index 100% rename from test/key_points/__init__.py rename to tests/key_points/__init__.py diff --git a/test/key_points/test_annotators.py b/tests/key_points/test_annotators.py similarity index 98% rename from test/key_points/test_annotators.py rename to tests/key_points/test_annotators.py index db2f8413..fcef9882 100644 --- a/test/key_points/test_annotators.py +++ b/tests/key_points/test_annotators.py @@ -1,7 +1,7 @@ import numpy as np import supervision as sv -from test.helpers import assert_image_mostly_same +from tests.helpers import assert_image_mostly_same class TestVertexAnnotator: diff --git a/test/key_points/test_core.py b/tests/key_points/test_core.py similarity index 99% rename from test/key_points/test_core.py rename to tests/key_points/test_core.py index 49cba4d6..5b3e4361 100644 --- a/test/key_points/test_core.py +++ b/tests/key_points/test_core.py @@ -4,7 +4,7 @@ import numpy as np import pytest from supervision.key_points.core import KeyPoints -from test.helpers import _create_key_points +from tests.helpers import _create_key_points KEY_POINTS = _create_key_points( xy=[ diff --git a/test/key_points/test_skeletons.py b/tests/key_points/test_skeletons.py similarity index 100% rename from test/key_points/test_skeletons.py rename to tests/key_points/test_skeletons.py diff --git a/test/metrics/__init__.py b/tests/metrics/__init__.py similarity index 100% rename from test/metrics/__init__.py rename to tests/metrics/__init__.py diff --git a/test/metrics/conftest.py b/tests/metrics/conftest.py similarity index 100% rename from test/metrics/conftest.py rename to tests/metrics/conftest.py diff --git a/test/metrics/test_detection.py b/tests/metrics/test_detection.py similarity index 99% rename from test/metrics/test_detection.py rename to tests/metrics/test_detection.py index 094831d2..9f395b8d 100644 --- a/test/metrics/test_detection.py +++ b/tests/metrics/test_detection.py @@ -12,7 +12,7 @@ from supervision.metrics.detection import ( MeanAveragePrecision, detections_to_tensor, ) -from test.helpers import _create_detections, assert_almost_equal +from tests.helpers import _create_detections, assert_almost_equal class TestDetectionMetrics: diff --git a/test/metrics/test_f1_score.py b/tests/metrics/test_f1_score.py similarity index 99% rename from test/metrics/test_f1_score.py rename to tests/metrics/test_f1_score.py index 7e6ceae7..9ccd8704 100644 --- a/test/metrics/test_f1_score.py +++ b/tests/metrics/test_f1_score.py @@ -4,7 +4,7 @@ import pytest from supervision.detection.core import Detections from supervision.metrics.core import AveragingMethod, MetricTarget from supervision.metrics.f1_score import F1Score -from test.helpers import assert_almost_equal +from tests.helpers import assert_almost_equal class TestF1Score: diff --git a/test/metrics/test_mean_average_precision.py b/tests/metrics/test_mean_average_precision.py similarity index 100% rename from test/metrics/test_mean_average_precision.py rename to tests/metrics/test_mean_average_precision.py diff --git a/test/metrics/test_mean_average_precision_area.py b/tests/metrics/test_mean_average_precision_area.py similarity index 100% rename from test/metrics/test_mean_average_precision_area.py rename to tests/metrics/test_mean_average_precision_area.py diff --git a/test/metrics/test_precision.py b/tests/metrics/test_precision.py similarity index 100% rename from test/metrics/test_precision.py rename to tests/metrics/test_precision.py diff --git a/test/metrics/test_recall.py b/tests/metrics/test_recall.py similarity index 99% rename from test/metrics/test_recall.py rename to tests/metrics/test_recall.py index 48ab16aa..02ebb93f 100644 --- a/test/metrics/test_recall.py +++ b/tests/metrics/test_recall.py @@ -4,7 +4,7 @@ import pytest from supervision.detection.core import Detections from supervision.metrics.core import AveragingMethod, MetricTarget from supervision.metrics.recall import Recall -from test.helpers import assert_almost_equal +from tests.helpers import assert_almost_equal class TestRecall: diff --git a/test/tracker/__init__.py b/tests/tracker/__init__.py similarity index 100% rename from test/tracker/__init__.py rename to tests/tracker/__init__.py diff --git a/test/tracker/test_byte_tracker.py b/tests/tracker/test_byte_tracker.py similarity index 100% rename from test/tracker/test_byte_tracker.py rename to tests/tracker/test_byte_tracker.py diff --git a/test/utils/__init__.py b/tests/utils/__init__.py similarity index 100% rename from test/utils/__init__.py rename to tests/utils/__init__.py diff --git a/test/utils/assets/1.jpg b/tests/utils/assets/1.jpg similarity index 100% rename from test/utils/assets/1.jpg rename to tests/utils/assets/1.jpg diff --git a/test/utils/assets/2.jpg b/tests/utils/assets/2.jpg similarity index 100% rename from test/utils/assets/2.jpg rename to tests/utils/assets/2.jpg diff --git a/test/utils/assets/3.jpg b/tests/utils/assets/3.jpg similarity index 100% rename from test/utils/assets/3.jpg rename to tests/utils/assets/3.jpg diff --git a/test/utils/assets/4.jpg b/tests/utils/assets/4.jpg similarity index 100% rename from test/utils/assets/4.jpg rename to tests/utils/assets/4.jpg diff --git a/test/utils/assets/5.jpg b/tests/utils/assets/5.jpg similarity index 100% rename from test/utils/assets/5.jpg rename to tests/utils/assets/5.jpg diff --git a/test/utils/assets/all_images_tile.png b/tests/utils/assets/all_images_tile.png similarity index 100% rename from test/utils/assets/all_images_tile.png rename to tests/utils/assets/all_images_tile.png diff --git a/test/utils/assets/all_images_tile_and_custom_colors.png b/tests/utils/assets/all_images_tile_and_custom_colors.png similarity index 100% rename from test/utils/assets/all_images_tile_and_custom_colors.png rename to tests/utils/assets/all_images_tile_and_custom_colors.png diff --git a/test/utils/assets/all_images_tile_and_custom_colors_and_titles.png b/tests/utils/assets/all_images_tile_and_custom_colors_and_titles.png similarity index 100% rename from test/utils/assets/all_images_tile_and_custom_colors_and_titles.png rename to tests/utils/assets/all_images_tile_and_custom_colors_and_titles.png diff --git a/test/utils/assets/all_images_tile_and_custom_grid.png b/tests/utils/assets/all_images_tile_and_custom_grid.png similarity index 100% rename from test/utils/assets/all_images_tile_and_custom_grid.png rename to tests/utils/assets/all_images_tile_and_custom_grid.png diff --git a/test/utils/assets/all_images_tile_and_titles_with_custom_configs.png b/tests/utils/assets/all_images_tile_and_titles_with_custom_configs.png similarity index 100% rename from test/utils/assets/all_images_tile_and_titles_with_custom_configs.png rename to tests/utils/assets/all_images_tile_and_titles_with_custom_configs.png diff --git a/test/utils/assets/four_images_tile.png b/tests/utils/assets/four_images_tile.png similarity index 100% rename from test/utils/assets/four_images_tile.png rename to tests/utils/assets/four_images_tile.png diff --git a/test/utils/assets/single_image_tile.png b/tests/utils/assets/single_image_tile.png similarity index 100% rename from test/utils/assets/single_image_tile.png rename to tests/utils/assets/single_image_tile.png diff --git a/test/utils/assets/single_image_tile_enforced_grid.png b/tests/utils/assets/single_image_tile_enforced_grid.png similarity index 100% rename from test/utils/assets/single_image_tile_enforced_grid.png rename to tests/utils/assets/single_image_tile_enforced_grid.png diff --git a/test/utils/assets/three_images_tile.png b/tests/utils/assets/three_images_tile.png similarity index 100% rename from test/utils/assets/three_images_tile.png rename to tests/utils/assets/three_images_tile.png diff --git a/test/utils/assets/two_images_tile.png b/tests/utils/assets/two_images_tile.png similarity index 100% rename from test/utils/assets/two_images_tile.png rename to tests/utils/assets/two_images_tile.png diff --git a/test/utils/conftest.py b/tests/utils/conftest.py similarity index 100% rename from test/utils/conftest.py rename to tests/utils/conftest.py diff --git a/test/utils/test_conversion.py b/tests/utils/test_conversion.py similarity index 100% rename from test/utils/test_conversion.py rename to tests/utils/test_conversion.py diff --git a/test/utils/test_file.py b/tests/utils/test_file.py similarity index 100% rename from test/utils/test_file.py rename to tests/utils/test_file.py diff --git a/test/utils/test_image.py b/tests/utils/test_image.py similarity index 100% rename from test/utils/test_image.py rename to tests/utils/test_image.py diff --git a/test/utils/test_internal.py b/tests/utils/test_internal.py similarity index 100% rename from test/utils/test_internal.py rename to tests/utils/test_internal.py diff --git a/test/utils/test_iterables.py b/tests/utils/test_iterables.py similarity index 100% rename from test/utils/test_iterables.py rename to tests/utils/test_iterables.py diff --git a/test/utils/test_video.py b/tests/utils/test_video.py similarity index 100% rename from test/utils/test_video.py rename to tests/utils/test_video.py