1
1
# Copyright (c) Microsoft Corporation. All rights reserved.
2
2
# Licensed under the MIT License.
3
3
"""All the action we need during build"""
4
- from hashlib import sha256
4
+ import hashlib
5
5
import io
6
6
import json
7
7
import os
15
15
debugpy_urls = {
16
16
"MacOS" : {
17
17
"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" ,
20
19
},
21
20
"Windows64" : {
22
21
"url" : "https://files.pythonhosted.org/packages/61/ad/ba48c35ed40238f05dcf81a10dcafb743ee90f23d2d1a41ba4f030dc0626/debugpy-1.8.0-cp310-cp310-win_amd64.whl" ,
23
- "hash" : "5d9de202f5d42e62f932507ee8b21e30d49aae7e46d5b1dd5c908db1d7068637"
22
+ "hash" : "5d9de202f5d42e62f932507ee8b21e30d49aae7e46d5b1dd5c908db1d7068637" ,
24
23
},
25
24
"Linux" : {
26
25
"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" ,
28
27
},
29
28
"Windows32" : {
30
29
"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
+ },
33
32
}
34
33
34
+
35
35
def _install_bundle (session : nox .Session ) -> None :
36
36
session .install (
37
37
"-t" ,
@@ -131,12 +131,12 @@ def _setup_template_environment(session: nox.Session) -> None:
131
131
132
132
@nox .session (python = "3.7" )
133
133
def install_bundled_libs (session ):
134
- #install debugpy by url and platform
134
+ # Install debugpy by url and platform
135
135
"""Installs the libraries that will be bundled with the extension."""
136
136
session .install ("wheel" )
137
137
_install_bundle (session )
138
138
139
- target = os .environ .get (' VSCETARGET' )
139
+ target = os .environ .get (" VSCETARGET" )
140
140
print ("target:" , target )
141
141
if "linux" in target :
142
142
download_url (f"{ os .getcwd ()} /bundled/libs" , debugpy_urls ["Linux" ])
@@ -147,27 +147,6 @@ def install_bundled_libs(session):
147
147
else :
148
148
_install_package (f"{ os .getcwd ()} /bundled/libs" , "debugpy" )
149
149
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
-
171
150
172
151
@nox .session (python = "3.7" )
173
152
def setup (session : nox .Session ) -> None :
@@ -205,7 +184,7 @@ def download_url(root, value):
205
184
print (value ["url" ])
206
185
with url_lib .urlopen (value ["url" ]) as response :
207
186
data = response .read ()
208
- if sha256 (data ) == value ["hash" ]:
187
+ if hashlib . sha256 (data ) == value ["hash" ]:
209
188
with zipfile .ZipFile (io .BytesIO (data ), "r" ) as wheel :
210
189
for zip_info in wheel .infolist ():
211
190
# Ignore dist info since we are merging multiple wheels
0 commit comments