Skip to content

Commit

Permalink
Fix networkx requirement (#52)
Browse files Browse the repository at this point in the history
Also fix bandit issues.
  • Loading branch information
LeonidBeynenson committed Dec 28, 2021
1 parent 28b8f3d commit a21ecd4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions anomalib/data/mvtec.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,11 +291,11 @@ def _download(self) -> None:

logger.info("Downloading MVTec Dataset")
with DownloadProgressBar(unit="B", unit_scale=True, miniters=1, desc=dataset_name) as progress_bar:
urlretrieve(
urlretrieve( # nosec
url=f"ftp://guest:GU.205dldo@ftp.softronics.ch/mvtec_anomaly_detection/{dataset_name}",
filename=self.filename,
reporthook=progress_bar.update_to,
)
) # nosec

self._extract()
self._clean()
Expand Down
2 changes: 1 addition & 1 deletion requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ defusedxml==0.7.1
kornia==0.5.6
lxml==4.6.5
matplotlib==3.4.3
networkx==2.5.1
networkx~=2.5
nncf==2.0.0
numpy~=1.19.5
omegaconf==2.1.1
Expand Down
2 changes: 1 addition & 1 deletion tests/helpers/detection.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Helpers for detection tests."""
import os
import xml.etree.cElementTree as ET
import xml.etree.cElementTree as ET # nosec
from glob import glob
from typing import List, Tuple

Expand Down
2 changes: 1 addition & 1 deletion tests/models/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def category() -> str:
"zipper",
]

category = random.choice(categories)
category = random.choice(categories) # nosec
return category


Expand Down
2 changes: 1 addition & 1 deletion tests/utils/test_download_progress_bar.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_output_on_download(capfd):
with tempfile.TemporaryDirectory() as dir_loc:
destination = os.path.join(dir_loc, "jelly.jpg")
with DownloadProgressBar(unit="B", unit_scale=True, miniters=1, desc=url.split("/")[-1]) as p_bar:
urlretrieve(url, filename=destination, reporthook=p_bar.update_to)
urlretrieve(url, filename=destination, reporthook=p_bar.update_to) # nosec # noqa

assert os.path.exists(destination), "Failed retrieving the file"
_, err = capfd.readouterr()
Expand Down

0 comments on commit a21ecd4

Please sign in to comment.