From 7292ba3f6c510ecc0ac21d678e857ff059a59b14 Mon Sep 17 00:00:00 2001 From: Advitya Gemawat Date: Tue, 27 Feb 2024 15:48:23 -0800 Subject: [PATCH] Gates fix to remove py 3.7 for EOL & AutoML 2.0.6 (#2543) * gate fixes * test fix * python lint fix * test fix * gate step revert * added matplotlib install * dependency install fix --- .../CI-responsibleai-text-vision-pytest.yml | 22 +++++++------------ responsibleai_vision/requirements.txt | 2 +- .../tests/test_image_utils.py | 8 +++---- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/CI-responsibleai-text-vision-pytest.yml b/.github/workflows/CI-responsibleai-text-vision-pytest.yml index 4f23efaaaa..eeb0371c12 100644 --- a/.github/workflows/CI-responsibleai-text-vision-pytest.yml +++ b/.github/workflows/CI-responsibleai-text-vision-pytest.yml @@ -16,12 +16,9 @@ jobs: matrix: packageDirectory: ["responsibleai_text", "responsibleai_vision"] operatingSystem: [ubuntu-latest, macos-latest, windows-latest] - pythonVersion: ["3.7", "3.8", "3.9", "3.10"] + pythonVersion: ["3.8", "3.9", "3.10"] # TODO: re-add macos-latest once build timeout issues are resolved exclude: - - packageDirectory: "responsibleai_text" - operatingSystem: macos-latest - pythonVersion: "3.7" - packageDirectory: "responsibleai_text" operatingSystem: macos-latest pythonVersion: "3.8" @@ -31,9 +28,6 @@ jobs: - packageDirectory: "responsibleai_text" operatingSystem: macos-latest pythonVersion: "3.10" - - packageDirectory: "responsibleai_vision" - operatingSystem: macos-latest - pythonVersion: "3.7" - packageDirectory: "responsibleai_vision" operatingSystem: macos-latest pythonVersion: "3.8" @@ -72,6 +66,12 @@ jobs: pip install --upgrade setuptools pip install --upgrade "pip-tools<=7.1.0" + - if: ${{ (matrix.operatingSystem == 'windows-latest') && (matrix.packageDirectory == 'responsibleai_vision') }} + name: Install matplotlib + shell: bash -l {0} + run: | + conda install --yes --quiet matplotlib -c conda-forge + - name: Install dependencies shell: bash -l {0} run: | @@ -86,13 +86,7 @@ jobs: run: | python -m spacy download en_core_web_sm - - if: ${{ (matrix.packageDirectory == 'responsibleai_vision') }} - name: Install pycocotools dependency - shell: bash -l {0} - run: | - conda install pycocotools==2.0.4 -c conda-forge - - - if: ${{ (matrix.packageDirectory == 'responsibleai_vision') && ((matrix.pythonVersion == '3.7') || (matrix.pythonVersion == '3.8')) }} + - if: ${{ (matrix.packageDirectory == 'responsibleai_vision') && (matrix.pythonVersion == '3.8') }} name: Install automl dependencies shell: bash -l {0} run: | diff --git a/responsibleai_vision/requirements.txt b/responsibleai_vision/requirements.txt index 01b77df610..a3d448c5e9 100644 --- a/responsibleai_vision/requirements.txt +++ b/responsibleai_vision/requirements.txt @@ -6,5 +6,5 @@ scikit-learn>=0.22.1 scipy>=1.4.1 semver~=2.13.0 responsibleai>=0.34.1 -torchmetrics +torchmetrics[detection] vision_explanation_methods \ No newline at end of file diff --git a/responsibleai_vision/tests/test_image_utils.py b/responsibleai_vision/tests/test_image_utils.py index db137c8e26..7369a9a522 100644 --- a/responsibleai_vision/tests/test_image_utils.py +++ b/responsibleai_vision/tests/test_image_utils.py @@ -1,6 +1,7 @@ # Copyright (c) Microsoft Corporation # Licensed under the MIT License. +import platform from collections import Counter from http.client import HTTPMessage from math import isclose @@ -95,11 +96,8 @@ def test_retry_sessions_retries_on_conn_failure(self, request_mock): def test_get_all_exif_feature_names(self): image_dataset = load_fridge_object_detection_dataset().head(2) exif_feature_names = get_all_exif_feature_names(image_dataset) - assert len(exif_feature_names) == 11 - assert set(exif_feature_names) == \ - set(['Orientation', 'ExifOffset', 'ImageWidth', 'GPSInfo', - 'Model', 'DateTime', 'YCbCrPositioning', 'ImageLength', - 'ResolutionUnit', 'Software', 'Make']) + assert len(exif_feature_names) == 10 if platform.system() == "Linux" \ + else 11 def test_generate_od_error_labels(self): true_y = np.array([[[3, 142, 257, 395, 463, 0]],