From 86f8f4a70161ad8cb0f7f95ee423b098f0fb6d3b Mon Sep 17 00:00:00 2001 From: Karl W Schulz Date: Thu, 27 Apr 2023 07:49:51 -0500 Subject: [PATCH 1/2] switch to use of importlib to avoid imp module deprecation (fixes #119) Signed-off-by: Karl W Schulz --- tests/test_analyze_commands.py | 4 ++-- tests/test_analyze_workloads.py | 5 +++-- tests/test_import_workloads.py | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/tests/test_analyze_commands.py b/tests/test_analyze_commands.py index e79cdfef9b..fb6ebe075d 100644 --- a/tests/test_analyze_commands.py +++ b/tests/test_analyze_commands.py @@ -2,9 +2,9 @@ import os.path from pathlib import Path from unittest.mock import patch import pytest -import imp +from importlib.machinery import SourceFileLoader -omniperf = imp.load_source("omniperf", "src/omniperf") +omniperf = SourceFileLoader("omniperf", "src/omniperf").load_module() def test_valid_path_mi100(): diff --git a/tests/test_analyze_workloads.py b/tests/test_analyze_workloads.py index cfe23f076a..20e5ecc1bd 100644 --- a/tests/test_analyze_workloads.py +++ b/tests/test_analyze_workloads.py @@ -1,8 +1,9 @@ import pytest from unittest.mock import patch -import imp +from importlib.machinery import SourceFileLoader + +omniperf = SourceFileLoader("omniperf", "src/omniperf").load_module() -omniperf = imp.load_source("omniperf", "src/omniperf") ################################################## ## Generated tests ## ################################################## diff --git a/tests/test_import_workloads.py b/tests/test_import_workloads.py index 5a0f2f11f3..7b169f8a9d 100644 --- a/tests/test_import_workloads.py +++ b/tests/test_import_workloads.py @@ -1,8 +1,8 @@ import pytest from unittest.mock import patch -import imp +from importlib.machinery import SourceFileLoader -omniperf = imp.load_source("omniperf", "src/omniperf") +omniperf = SourceFileLoader("omniperf", "src/omniperf").load_module() ################################################## ## Generated tests ## From c0ea032cf6c3c98a0b661d3e2fb74b45314cc342 Mon Sep 17 00:00:00 2001 From: coleramos425 Date: Tue, 2 May 2023 16:25:32 -0500 Subject: [PATCH 2/2] Fixing my CI mistake Karl inherited when branching Signed-off-by: coleramos425 --- .github/workflows/rhel-8.yml | 2 +- .github/workflows/ubuntu-focal.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rhel-8.yml b/.github/workflows/rhel-8.yml index f1f334f9b4..5fe6d5aede 100644 --- a/.github/workflows/rhel-8.yml +++ b/.github/workflows/rhel-8.yml @@ -35,7 +35,7 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - #token: ${{ secrets.GH_PAT }} + token: ${{ secrets.GH_PAT }} - name: Install Python prereqs run: | python3.9 -m pip install -r requirements.txt diff --git a/.github/workflows/ubuntu-focal.yml b/.github/workflows/ubuntu-focal.yml index d4c9a8ddae..d9683af8c1 100644 --- a/.github/workflows/ubuntu-focal.yml +++ b/.github/workflows/ubuntu-focal.yml @@ -34,7 +34,7 @@ jobs: uses: actions/checkout@v3 with: submodules: recursive - #token: ${{ secrets.GH_PAT }} + token: ${{ secrets.GH_PAT }} - name: Install Python prereqs run: | python3 -m pip install -r requirements.txt