From 7b9ee828f317b686da5029193f9057ca6c35aacd Mon Sep 17 00:00:00 2001 From: "Jaroslaw, Szczepanski" Date: Tue, 10 Feb 2026 12:48:07 +0100 Subject: [PATCH 1/2] [SDL] Enable Bandit B404 test --- pyproject.toml | 2 +- src/custom_version.py | 2 +- src/nncf/torch/quantization/extensions.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index e3edf2e136b..ce08ed0c990 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -207,7 +207,7 @@ pythonpath = "." exclude_dirs = ["tools", "tests", "**/venv*", "build"] skips = [ "B101", # assert_used - "B404", # import_subprocess + # "B404", # import_subprocess - required by SDL "B614", # pytorch_load "B615", # huggingface_unsafe_download ] diff --git a/src/custom_version.py b/src/custom_version.py index 905efd7f22d..6777fc454c9 100644 --- a/src/custom_version.py +++ b/src/custom_version.py @@ -48,7 +48,7 @@ import contextlib import os import re -import subprocess +import subprocess # nosec B404 from pathlib import Path NNCF_VERSION_FILE = "src/nncf/version.py" diff --git a/src/nncf/torch/quantization/extensions.py b/src/nncf/torch/quantization/extensions.py index ee2328e6a45..8895155b2f6 100644 --- a/src/nncf/torch/quantization/extensions.py +++ b/src/nncf/torch/quantization/extensions.py @@ -10,7 +10,7 @@ # limitations under the License. import os.path -import subprocess +import subprocess # nosec B404 import torch From 5f6f71b9ad85964f6f7c14fa67a33ae9589e1c3d Mon Sep 17 00:00:00 2001 From: "Jaroslaw, Szczepanski" Date: Tue, 10 Feb 2026 13:37:38 +0100 Subject: [PATCH 2/2] Remove skip B404 test from Bandit scans --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index ce08ed0c990..1868d71adb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -207,7 +207,6 @@ pythonpath = "." exclude_dirs = ["tools", "tests", "**/venv*", "build"] skips = [ "B101", # assert_used - # "B404", # import_subprocess - required by SDL "B614", # pytorch_load "B615", # huggingface_unsafe_download ]