diff --git a/setup.py b/setup.py index e744e4835..332d6087a 100644 --- a/setup.py +++ b/setup.py @@ -92,7 +92,7 @@ def run(self): "pyyaml", "tiffslide", "matplotlib", - "requests>=2.25.0", + "gdown", "pytest", "coverage", "pytest-cov", diff --git a/testing/test_full.py b/testing/test_full.py index 4680a71ae..9dd860782 100644 --- a/testing/test_full.py +++ b/testing/test_full.py @@ -1,5 +1,5 @@ from pathlib import Path -import requests, zipfile, io, os, csv, random, copy, shutil, yaml, torch, pytest +import gdown, zipfile, os, csv, random, copy, shutil, yaml, torch, pytest import SimpleITK as sitk import numpy as np import pandas as pd @@ -109,9 +109,7 @@ def test_generic_download_data(): print("00: Downloading the sample data") - urlToDownload = ( - "https://upenn.box.com/shared/static/y8162xkq1zz5555ye3pwadry2m2e39bs.zip" - ) + urlToDownload = "https://drive.google.com/uc?id=1c4Yrv-jnK6Tk7Ne1HmMTChv-4nYk43NT" files_check = [ os.path.join(inputDir, "2d_histo_segmentation", "1", "image.tiff"), @@ -122,9 +120,11 @@ def test_generic_download_data(): for file in files_check: if not os.path.isfile(file): print("Downloading and extracting sample data") - r = requests.get(urlToDownload) - z = zipfile.ZipFile(io.BytesIO(r.content)) - z.extractall(testingDir) + output = os.path.join(testingDir, "gandlf_unit_test_data.tgz") + gdown.download(urlToDownload, output, quiet=False) + with zipfile.ZipFile(output, "r") as zip_ref: + zip_ref.extractall(testingDir) + os.remove(output) break sanitize_outputDir()