Skip to content

Commit 6dbadcc

Browse files
Fix nox hash comparison
1 parent 84169a0 commit 6dbadcc

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

noxfile.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -181,10 +181,10 @@ def _get_urls(data, version):
181181

182182

183183
def download_url(root, value):
184-
print(value["url"])
185184
with url_lib.urlopen(value["url"]) as response:
186185
data = response.read()
187-
if hashlib.sha256(data) == value["hash"]:
186+
if hashlib.sha256(data).hexdigest() == value["hash"]:
187+
print("Download: ", value["url"])
188188
with zipfile.ZipFile(io.BytesIO(data), "r") as wheel:
189189
for zip_info in wheel.infolist():
190190
# Ignore dist info since we are merging multiple wheels
@@ -195,7 +195,6 @@ def download_url(root, value):
195195

196196

197197
def _download_and_extract(root, url):
198-
print("donload and extract")
199198
if "manylinux" in url or "macosx" in url or "win_amd64" in url:
200199
root = os.getcwd() if root is None or root == "." else root
201200
print(url)
@@ -206,12 +205,11 @@ def _download_and_extract(root, url):
206205
# Ignore dist info since we are merging multiple wheels
207206
if ".dist-info/" in zip_info.filename:
208207
continue
209-
# print("\t" + zip_info.filename)
208+
print("\t" + zip_info.filename)
210209
wheel.extract(zip_info.filename, root)
211210

212211

213212
def _install_package(root, package_name, version="latest"):
214-
print("package")
215213
from packaging.version import parse as version_parser
216214

217215
data = _get_pypi_package_data(package_name)
@@ -220,7 +218,7 @@ def _install_package(root, package_name, version="latest"):
220218
use_version = max(data["releases"].keys(), key=version_parser)
221219
else:
222220
use_version = version
223-
print(_get_urls(data, use_version))
221+
224222
for url in _get_urls(data, use_version):
225223
_download_and_extract(root, url)
226224

0 commit comments

Comments
 (0)