From 3c6563d6f7cf35f5e801b7a1dc9363619bb55239 Mon Sep 17 00:00:00 2001 From: Kunal Pai <62979320+kunpai@users.noreply.github.com> Date: Thu, 20 Jul 2023 12:00:49 -0700 Subject: [PATCH] stdlib: Change resource compatibility warning (#91) * stdlib: Change resource compatibility warning If the gem5 version is "develop", the warning will not be thrown. Change-Id: Id2be1c4323c6ca06c5503c2885c1608f8d119420 * stdlib: Change resource compatibility warning If the gem5 version is "develop", the warning will not be thrown. Change-Id: Id2be1c4323c6ca06c5503c2885c1608f8d119420 * tests: Edit obtain_resources warning test Since we are editing the warning message for the develop branch, the test removes the warning message as well. Change-Id: I90882340188360bb3435344cdc14b324412c6c0e --------- Co-authored-by: Jason Lowe-Power --- .../resources/client_api/client_wrapper.py | 22 ++++++++++--------- .../pyunit_obtain_resources_check.py | 6 ----- 2 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/python/gem5/resources/client_api/client_wrapper.py b/src/python/gem5/resources/client_api/client_wrapper.py index d2baabc52d..ccb92cfb20 100644 --- a/src/python/gem5/resources/client_api/client_wrapper.py +++ b/src/python/gem5/resources/client_api/client_wrapper.py @@ -285,19 +285,21 @@ class ClientWrapper: return False if ( gem5_version + and not gem5_version.upper().startswith("DEVELOP") and not self._get_resources_compatible_with_gem5_version( [resource], gem5_version=gem5_version ) ): - warn( - f"Resource {resource['id']} with version " - f"{resource['resource_version']} is not known to be compatible" - f" with gem5 version {gem5_version}. " - "This may cause problems with your simulation. " - "This resource's compatibility " - "with different gem5 versions can be found here: " - "https://resources.gem5.org" - f"/resources/{resource['id']}/versions" - ) + if not gem5_version.upper().startswith("DEVELOP"): + warn( + f"Resource {resource['id']} with version " + f"{resource['resource_version']} is not known to be compatible" + f" with gem5 version {gem5_version}. " + "This may cause problems with your simulation. " + "This resource's compatibility " + "with different gem5 versions can be found here: " + "https://resources.gem5.org" + f"/resources/{resource['id']}/versions" + ) return False return True diff --git a/tests/pyunit/stdlib/resources/pyunit_obtain_resources_check.py b/tests/pyunit/stdlib/resources/pyunit_obtain_resources_check.py index b1eda4e6ed..8c08cd88d5 100644 --- a/tests/pyunit/stdlib/resources/pyunit_obtain_resources_check.py +++ b/tests/pyunit/stdlib/resources/pyunit_obtain_resources_check.py @@ -110,12 +110,6 @@ class TestObtainResourcesCheck(unittest.TestCase): resource_directory=self.get_resource_dir(), resource_version="1.5.0", ) - self.assertTrue( - f"warn: Resource test-binary-resource with version 1.5.0 is not known to be compatible with gem5 version {core.gem5Version}. " - "This may cause problems with your simulation. This resource's compatibility with different gem5 versions can be found here: " - f"https://resources.gem5.org/resources/test-binary-resource/versions" - in f.getvalue() - ) resource = obtain_resource( resource_id="test-binary-resource",