From c5e60cca8c9f10cbd5ffbd010c8a528bc06ec385 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 25 Nov 2025 12:16:35 -0600 Subject: [PATCH 1/4] Decorate class method per https://github.com/greenc-FNAL/phlex/security/code-scanning/2 --- test/python/test_phlex.py | 1 + 1 file changed, 1 insertion(+) diff --git a/test/python/test_phlex.py b/test/python/test_phlex.py index daef1b420..f78cad153 100644 --- a/test/python/test_phlex.py +++ b/test/python/test_phlex.py @@ -4,6 +4,7 @@ class TestPYPHLEX: + @classmethod def setup_class(cls): import pyphlex From c76dd4ed8ed2b39fbe1cf7d68f182381c67a520c Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 25 Nov 2025 12:29:03 -0600 Subject: [PATCH 2/4] Remove unneeded imports --- test/python/registry.py | 2 -- test/python/test_phlex.py | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/test/python/registry.py b/test/python/registry.py index 1701855ba..3d8c87197 100644 --- a/test/python/registry.py +++ b/test/python/registry.py @@ -1,7 +1,5 @@ -import sys import cppyy -import pyphlex cpp = cppyy.gbl phlex = cpp.phlex.experimental diff --git a/test/python/test_phlex.py b/test/python/test_phlex.py index f78cad153..66feb6536 100644 --- a/test/python/test_phlex.py +++ b/test/python/test_phlex.py @@ -1,12 +1,11 @@ -import py -from pytest import raises class TestPYPHLEX: @classmethod def setup_class(cls): - import pyphlex + import pyphlex # noqa: F401 + __all__ = ['pyphlex'] # For CodeQL def test01_phlex_existence(self): """Test existence of the phlex namespace""" From 9912b51182197ff095a5a5f9f6905ab591b07f57 Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 25 Nov 2025 13:55:46 -0600 Subject: [PATCH 3/4] Restore `pyphlex` import with suitable annotations --- test/python/registry.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/python/registry.py b/test/python/registry.py index 3d8c87197..757d04438 100644 --- a/test/python/registry.py +++ b/test/python/registry.py @@ -1,6 +1,7 @@ - import cppyy +import pyphlex # noqa: F401 +__all__ = ['pyphlex'] cpp = cppyy.gbl phlex = cpp.phlex.experimental From 5702879cd8b4900562cf5e085cfaf43695525a1b Mon Sep 17 00:00:00 2001 From: Chris Green Date: Tue, 25 Nov 2025 13:56:12 -0600 Subject: [PATCH 4/4] Minor comment format tweak --- test/python/test_phlex.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/python/test_phlex.py b/test/python/test_phlex.py index 66feb6536..769b44911 100644 --- a/test/python/test_phlex.py +++ b/test/python/test_phlex.py @@ -4,7 +4,7 @@ class TestPYPHLEX: @classmethod def setup_class(cls): - import pyphlex # noqa: F401 + import pyphlex # noqa: F401 __all__ = ['pyphlex'] # For CodeQL def test01_phlex_existence(self):