Skip to content

Commit 5e109a4

Browse files
committed
Update package dependencies for Python 3.12 compatibility
- Add Python version constraints for mmengine, mmcv, and mmdet - Update CI workflow to skip MMCV tests on Python 3.12 - Adjust MMDetection test to support Python 3.11 and lower
1 parent bd15212 commit 5e109a4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ jobs:
7272
# coco analyse
7373
sahi coco analyse --dataset_json_path tests/data/coco_evaluate/dataset.json --result_json_path tests/data/coco_evaluate/result.json --out_dir tests/data/coco_evaluate/
7474
- name: Test SAHI CLI with MMCV
75+
if: ${{ matrix.python-version }} != '3.12'
7576
run: |
7677
source .venv/bin/activate
7778
set -e

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ ci = [
5757
# pytorch should be present for all python versions
5858
"torch==2.3.1+cpu",
5959
"torchvision==0.18.1+cpu",
60-
"mmengine",
61-
"mmcv>=2.2.0",
62-
"mmdet>=3.3.0",
60+
"mmengine;python_version<'3.12'",
61+
"mmcv==2.1.0;python_version<'3.12'",
62+
"mmdet==3.3.0;python_version<'3.12'",
6363
# deepsparse is only available for python<3.12
6464
"deepsparse;python_version<'3.12'",
6565
"onnxruntime<1.20;python_version<'3.12'",

tests/test_mmdetectionmodel.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from sahi.utils.cv import read_image
1212
from sahi.utils.mmdet import MmdetTestConstants, download_mmdet_cascade_mask_rcnn_model, download_mmdet_yolox_tiny_model
1313

14-
# pytestmark = pytest.mark.skipif(sys.version_info[:2] > (3, 10), reason="Requires Python 3.10 or lower")
14+
pytestmark = pytest.mark.skipif(sys.version_info[:2] > (3, 11), reason="MMDet 3.3.0 requires Python 3.11 or lower")
1515
MODEL_DEVICE = "cpu"
1616
CONFIDENCE_THRESHOLD = 0.5
1717
IMAGE_SIZE = 320

0 commit comments

Comments
 (0)