|
17 | 17 | "url": "https://files.pythonhosted.org/packages/39/2f/c8a8cfac6c7fa3d9e163a6bf46e6d27d027b7a1331028e99a6ef7fd3699d/debugpy-1.7.0-py2.py3-none-any.whl",
|
18 | 18 | "hash": (
|
19 | 19 | "sha256",
|
20 |
| - "f6de2e6f24f62969e0f0ef682d78c98161c4dca29e9fb05df4d2989005005502", |
| 20 | + "f6de2e6f24f62969e0f0ef682d78c98161c4dca29e9fb05df4d298900500550", |
21 | 21 | ),
|
22 | 22 | },
|
23 | 23 | "macOS": {
|
24 | 24 | "url": "https://files.pythonhosted.org/packages/bd/a3/5e37ce13c7dd850b72a52be544a058ed49606ebbbf8b95b2ba3c1db5620a/debugpy-1.7.0-cp311-cp311-macosx_11_0_universal2.whl",
|
25 |
| - "sha256": ( |
| 25 | + "hash": ( |
26 | 26 | "sha256",
|
27 | 27 | "538765a41198aa88cc089295b39c7322dd598f9ef1d52eaae12145c63bf9430a",
|
28 | 28 | ),
|
@@ -79,7 +79,6 @@ def tests(session: nox.Session) -> None:
|
79 | 79 |
|
80 | 80 | @nox.session()
|
81 | 81 | def install_bundled_libs(session):
|
82 |
| - # Install debugpy by URL and platform |
83 | 82 | """Installs the libraries that will be bundled with the extension."""
|
84 | 83 | session.install("wheel")
|
85 | 84 | session.install(
|
@@ -112,15 +111,15 @@ def install_bundled_libs(session):
|
112 | 111 | def download_url(value):
|
113 | 112 | with url_lib.urlopen(value["url"]) as response:
|
114 | 113 | data = response.read()
|
115 |
| - if hashlib.sha256(data).hexdigest() != value["hash"][1]: |
116 |
| - raise Exception("Failed hash verification for {}.".format(value["url"])) |
| 114 | + hash_algorithm, hash_digest = value["hash"] |
| 115 | + if hashlib.new(hash_algorithm, data).hexdigest() != hash_digest: |
| 116 | + raise ValueError("Failed hash verification for {}.".format(value["url"])) |
117 | 117 | print("Download: ", value["url"])
|
118 | 118 | with zipfile.ZipFile(io.BytesIO(data), "r") as wheel:
|
| 119 | + libs_dir = pathlib.Path.cwd() / "bundled" / "libs" |
119 | 120 | for zip_info in wheel.infolist():
|
120 | 121 | print("\t" + zip_info.filename)
|
121 |
| - wheel.extract( |
122 |
| - zip_info.filename, pathlib.Path.cwd() / "bundled" / "libs" |
123 |
| - ) |
| 122 | + wheel.extract(zip_info.filename, libs_dir) |
124 | 123 |
|
125 | 124 |
|
126 | 125 | @nox.session()
|
|
0 commit comments