Skip to content

Commit 84169a0

Browse files
Fix lint in nox file
1 parent d2eba18 commit 84169a0

File tree

1 file changed

+10
-31
lines changed

1 file changed

+10
-31
lines changed

noxfile.py

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (c) Microsoft Corporation. All rights reserved.
22
# Licensed under the MIT License.
33
"""All the action we need during build"""
4-
from hashlib import sha256
4+
import hashlib
55
import io
66
import json
77
import os
@@ -15,23 +15,23 @@
1515
debugpy_urls = {
1616
"MacOS": {
1717
"url": "https://files.pythonhosted.org/packages/b1/46/0304622c2c81215298294eba53c038c6d339b783928117687e756ade7def/debugpy-1.8.0-cp310-cp310-macosx_11_0_x86_64.whl",
18-
"hash": "7fb95ca78f7ac43393cd0e0f2b6deda438ec7c5e47fa5d38553340897d2fbdfb"
19-
18+
"hash": "7fb95ca78f7ac43393cd0e0f2b6deda438ec7c5e47fa5d38553340897d2fbdfb",
2019
},
2120
"Windows64": {
2221
"url": "https://files.pythonhosted.org/packages/61/ad/ba48c35ed40238f05dcf81a10dcafb743ee90f23d2d1a41ba4f030dc0626/debugpy-1.8.0-cp310-cp310-win_amd64.whl",
23-
"hash": "5d9de202f5d42e62f932507ee8b21e30d49aae7e46d5b1dd5c908db1d7068637"
22+
"hash": "5d9de202f5d42e62f932507ee8b21e30d49aae7e46d5b1dd5c908db1d7068637",
2423
},
2524
"Linux": {
2625
"url": "https://files.pythonhosted.org/packages/01/18/4be69e4b466f6452ac42b2a2cb7e581a3f1af194f1dd563d5bdabdcd8c21/debugpy-1.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
27-
"hash": "ef9ab7df0b9a42ed9c878afd3eaaff471fce3fa73df96022e1f5c9f8f8c87ada"
26+
"hash": "ef9ab7df0b9a42ed9c878afd3eaaff471fce3fa73df96022e1f5c9f8f8c87ada",
2827
},
2928
"Windows32": {
3029
"ulr": "https://files.pythonhosted.org/packages/1a/62/325e4b4b512b8b17fa10769bd7e8c64bc3e9957155c1f5eac70df7660e14/debugpy-1.8.0-cp310-cp310-win32.whl",
31-
"hash": "a8b7a2fd27cd9f3553ac112f356ad4ca93338feadd8910277aff71ab24d8775f"
32-
}
30+
"hash": "a8b7a2fd27cd9f3553ac112f356ad4ca93338feadd8910277aff71ab24d8775f",
31+
},
3332
}
3433

34+
3535
def _install_bundle(session: nox.Session) -> None:
3636
session.install(
3737
"-t",
@@ -131,12 +131,12 @@ def _setup_template_environment(session: nox.Session) -> None:
131131

132132
@nox.session(python="3.7")
133133
def install_bundled_libs(session):
134-
#install debugpy by url and platform
134+
# Install debugpy by url and platform
135135
"""Installs the libraries that will be bundled with the extension."""
136136
session.install("wheel")
137137
_install_bundle(session)
138138

139-
target = os.environ.get('VSCETARGET')
139+
target = os.environ.get("VSCETARGET")
140140
print("target:", target)
141141
if "linux" in target:
142142
download_url(f"{os.getcwd()}/bundled/libs", debugpy_urls["Linux"])
@@ -147,27 +147,6 @@ def install_bundled_libs(session):
147147
else:
148148
_install_package(f"{os.getcwd()}/bundled/libs", "debugpy")
149149

150-
151-
152-
153-
154-
@nox.session()
155-
def install_bundled_libs_win64(session):
156-
download_url(f"{os.getcwd()}/bundled/libs", debugpy_urls["Windows64"])
157-
158-
def install_bundled_libs_win32(session):
159-
_install_bundle(session)
160-
download_url(f"{os.getcwd()}/bundled/libs", debugpy_urls["Windows64"])
161-
162-
163-
def install_bundled_libs_linux(session):
164-
_install_bundle(session)
165-
166-
def install_bundled_libs_macos(session):
167-
_install_bundle(session)
168-
169-
170-
171150

172151
@nox.session(python="3.7")
173152
def setup(session: nox.Session) -> None:
@@ -205,7 +184,7 @@ def download_url(root, value):
205184
print(value["url"])
206185
with url_lib.urlopen(value["url"]) as response:
207186
data = response.read()
208-
if sha256(data) == value["hash"]:
187+
if hashlib.sha256(data) == value["hash"]:
209188
with zipfile.ZipFile(io.BytesIO(data), "r") as wheel:
210189
for zip_info in wheel.infolist():
211190
# Ignore dist info since we are merging multiple wheels

0 commit comments

Comments
 (0)