From 1d87b8155a93dc6dcbdee636814d9ca612afc23d Mon Sep 17 00:00:00 2001 From: Igor Davidyuk Date: Fri, 7 Jun 2024 17:04:07 +0300 Subject: [PATCH 1/5] Fix `is_geti` version check The SaaS returns a strange build time tag that breaks the version validation. --- geti_sdk/platform_versions.py | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/geti_sdk/platform_versions.py b/geti_sdk/platform_versions.py index 8d58bcea..633f2f71 100644 --- a/geti_sdk/platform_versions.py +++ b/geti_sdk/platform_versions.py @@ -59,18 +59,10 @@ def __gt__(self, other): raise TypeError( f"Unsupported comparison operation, {other} is not a GetiVersion." ) - if self.is_geti and other.is_geti: - if self.version != other.version: - return self.version > other.version - else: - return self.time_tag > other.time_tag + if self.version != other.version: + return self.version > other.version else: - if self.is_geti and not other.is_geti: - return True - elif not self.is_geti and other.is_geti: - return False - else: - return self.time_tag > other.time_tag + return self.time_tag > other.time_tag def __lt__(self, other): """ @@ -159,18 +151,6 @@ def is_sc_1_1(self) -> bool: and self._SC11_TIMETAG <= self.time_tag <= self._GETI10_TIMETAG ) - @property - def is_geti(self) -> bool: - """ - Return True if the version corresponds to any version of the Geti platform. - Return False if it corresponds to any SC version. - """ - return ( - self.version > Version("1.0.0b0") - and self.time_tag >= self._GETI10_TIMETAG - and not (self.is_sc_1_1 or self.is_sc_mvp) - ) - SC_MVP_VERSION = GetiVersion("1.0.0-release-20220129184214") SC_11_VERSION = GetiVersion("1.1.0-release-20220624125113") From 253316e75a8ac21fd28f16eb1f9225771b1e458b Mon Sep 17 00:00:00 2001 From: Igor Davidyuk Date: Fri, 7 Jun 2024 17:10:58 +0300 Subject: [PATCH 2/5] Update test_platform_version_unit.py --- tests/pre-merge/unit/test_platform_version_unit.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/pre-merge/unit/test_platform_version_unit.py b/tests/pre-merge/unit/test_platform_version_unit.py index f44d4e76..c2aba573 100644 --- a/tests/pre-merge/unit/test_platform_version_unit.py +++ b/tests/pre-merge/unit/test_platform_version_unit.py @@ -26,15 +26,6 @@ def test_version_parsing_and_comparison(self): Test parsing the version from a version string, for different release versions of the Intel Geti platform. Also test comparisons between versions """ - - assert SC_MVP_VERSION.is_sc_mvp and not SC_MVP_VERSION.is_geti - assert ( - SC_11_VERSION.is_sc_1_1 - and not SC_11_VERSION.is_geti - and not SC_11_VERSION.is_sc_mvp - ) - assert GETI_10_VERSION.is_geti - assert GETI_10_VERSION > SC_11_VERSION assert SC_11_VERSION > SC_MVP_VERSION assert not SC_MVP_VERSION > GETI_10_VERSION From 9b1521ade2130c3d5f8622a06c7d07ec0b225295 Mon Sep 17 00:00:00 2001 From: Igor Davidyuk Date: Fri, 7 Jun 2024 17:12:03 +0300 Subject: [PATCH 3/5] Update test_geti_session.py --- tests/pre-merge/integration/http_session/test_geti_session.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/pre-merge/integration/http_session/test_geti_session.py b/tests/pre-merge/integration/http_session/test_geti_session.py index 1d393fdc..c4b7d490 100644 --- a/tests/pre-merge/integration/http_session/test_geti_session.py +++ b/tests/pre-merge/integration/http_session/test_geti_session.py @@ -32,9 +32,8 @@ def test_product_version(self, fxt_geti_session: GetiSession): version_tests = [ fxt_geti_session.version.is_sc_mvp, fxt_geti_session.version.is_sc_1_1, - fxt_geti_session.version.is_geti, ] - assert sum(version_tests) == 1 + assert sum(version_tests) == 0 @pytest.mark.vcr() def test_logout(self, fxt_geti_session: GetiSession): From 3b9dcaf887d5d31755052b2af23a6f1af72b7bfa Mon Sep 17 00:00:00 2001 From: Igor Davidyuk Date: Fri, 7 Jun 2024 17:18:51 +0300 Subject: [PATCH 4/5] Update test_platform_version_unit.py --- tests/pre-merge/unit/test_platform_version_unit.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/pre-merge/unit/test_platform_version_unit.py b/tests/pre-merge/unit/test_platform_version_unit.py index c2aba573..c8f4de83 100644 --- a/tests/pre-merge/unit/test_platform_version_unit.py +++ b/tests/pre-merge/unit/test_platform_version_unit.py @@ -15,8 +15,6 @@ from geti_sdk.platform_versions import ( GETI_10_VERSION, GETI_11_VERSION, - SC_11_VERSION, - SC_MVP_VERSION, ) @@ -26,8 +24,5 @@ def test_version_parsing_and_comparison(self): Test parsing the version from a version string, for different release versions of the Intel Geti platform. Also test comparisons between versions """ - assert GETI_10_VERSION > SC_11_VERSION - assert SC_11_VERSION > SC_MVP_VERSION - assert not SC_MVP_VERSION > GETI_10_VERSION assert GETI_10_VERSION < GETI_11_VERSION assert GETI_11_VERSION >= GETI_10_VERSION From eefd5e9b08c0f42225f786be30c7bac1f027afb2 Mon Sep 17 00:00:00 2001 From: Igor Davidyuk Date: Fri, 7 Jun 2024 17:29:30 +0300 Subject: [PATCH 5/5] Update test_platform_version_unit.py --- tests/pre-merge/unit/test_platform_version_unit.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/pre-merge/unit/test_platform_version_unit.py b/tests/pre-merge/unit/test_platform_version_unit.py index c8f4de83..6033a0a2 100644 --- a/tests/pre-merge/unit/test_platform_version_unit.py +++ b/tests/pre-merge/unit/test_platform_version_unit.py @@ -12,10 +12,7 @@ # See the License for the specific language governing permissions # and limitations under the License. -from geti_sdk.platform_versions import ( - GETI_10_VERSION, - GETI_11_VERSION, -) +from geti_sdk.platform_versions import GETI_10_VERSION, GETI_11_VERSION class TestGetiVersion: