Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/custom_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
import contextlib
import os
import re
import subprocess
import subprocess # nosec
from pathlib import Path

NNCF_VERSION_FILE = "src/nncf/version.py"
Expand Down Expand Up @@ -81,12 +81,12 @@ def get_custom_version() -> str:
# Get commit hash
with contextlib.suppress(subprocess.CalledProcessError):
dev_version_id = (
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], cwd=repo_root).strip().decode() # nosec
subprocess.check_output(["git", "rev-parse", "--short", "HEAD"], cwd=repo_root).strip().decode()
)

# Detect modified files
with contextlib.suppress(subprocess.CalledProcessError):
run = subprocess.run(["git", "diff-index", "--quiet", "HEAD"], cwd=repo_root) # nosec
run = subprocess.run(["git", "diff-index", "--quiet", "HEAD"], cwd=repo_root)
if run.returncode == 1:
dev_version_id += "dirty"

Expand Down
4 changes: 2 additions & 2 deletions src/nncf/torch/quantization/extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# limitations under the License.

import os.path
import subprocess
from subprocess import CalledProcessError # nosec

import torch

Expand Down Expand Up @@ -93,7 +93,7 @@ def load(cls):
)
except ExtensionLoaderTimeoutException as e:
raise e
except (subprocess.CalledProcessError, OSError, RuntimeError) as e:
except (CalledProcessError, OSError, RuntimeError) as e:
assert torch.cuda.is_available()
msg = (
"CUDA is available for PyTorch, but NNCF could not compile "
Expand Down
Loading