1515# The VERSION line is edited automatically during deployments.
1616# You may change the contents of the string, but do not otherwise edit the line.
1717VERSION = "3.x.x-dev"
18+
19+ # LIBUAST_URL is a format url which points to the libuast package
20+ # (see LIBUAST_VERSION and get_libuast_arch()). The url is used to download
21+ # and install uast library.
22+ LIBUAST_URL = "https://github.com/bblfsh/libuast/releases/download/{version}/libuast-{arch}.tar.gz"
1823LIBUAST_VERSION = "v3.4.2"
24+
1925SDK_V1_VERSION = "v1.17.0"
2026SDK_V1_MAJOR = SDK_V1_VERSION .split ('.' )[0 ]
21- SDK_V2_VERSION = "v2.16.4"
22- SDK_V2_MAJOR = SDK_V2_VERSION .split ('.' )[0 ]
27+
28+ # SDK_URL is a format url which points to the sdk package.
29+ # The url is used to download and install python bindings for bblfsh sdk.
30+ SDK_URL = "https://github.com/bblfsh/sdk/archive/{version}.tar.gz"
31+ SDK_V3_VERSION = "v3.3.0"
32+ SDK_V3_PROTOCOL = "v2" # package gopkg.in.bblfsh.sdk.v2.protocol
33+
2334
2435FORMAT_ARGS = globals ()
2536
@@ -152,8 +163,7 @@ def get_libuast():
152163 mkdir (local_libuast )
153164
154165 # Retrieve libuast
155- untar_url ("https://github.com/bblfsh/libuast/releases/download/%s/libuast-%s.tar.gz" % (
156- LIBUAST_VERSION , get_libuast_arch ()))
166+ untar_url (LIBUAST_URL .format (version = LIBUAST_VERSION , arch = get_libuast_arch ()))
157167 mv (get_libuast_arch (), local_libuast )
158168
159169
@@ -170,10 +180,10 @@ def proto_download_v1():
170180
171181
172182def proto_download_v2 ():
173- untar_url ("https://github.com/bblfsh/sdk/archive/%s.tar.gz"
174- % SDK_V2_VERSION )
175- sdkdir = "sdk-" + SDK_V2_VERSION [ 1 :]
176- destdir = j ( "proto" , "gopkg.in" , "bblfsh" , "sdk.{SDK_V2_MAJOR}" )
183+ untar_url (SDK_URL . format ( version = SDK_V3_VERSION ))
184+ sdkdir = "sdk-" + SDK_V3_VERSION [ 1 :]
185+ destdir = j ( "proto" , "gopkg.in" , "bblfsh" , "sdk.{SDK_V3_PROTOCOL}" )
186+
177187 cp (j (sdkdir , "protocol" , "driver.proto" ),
178188 j (destdir , "protocol" , "generated.proto" ))
179189 cp (j (sdkdir , "uast" , "role" , "generated.proto" ),
@@ -261,18 +271,18 @@ def importlib_import_replacer(match):
261271 protoc (j ("gopkg.in" , "bblfsh" , "sdk." + SDK_V1_MAJOR , "protocol" , "generated.proto" ), True )
262272 protoc (j ("gopkg.in" , "bblfsh" , "sdk." + SDK_V1_MAJOR , "uast" , "generated.proto" ))
263273
264- protoc (j ("gopkg.in" , "bblfsh" , "sdk." + SDK_V2_MAJOR , "uast" , "generated.proto" ))
265- protoc (j ("gopkg.in" , "bblfsh" , "sdk." + SDK_V2_MAJOR , "protocol" , "generated.proto" ), True )
274+ protoc (j ("gopkg.in" , "bblfsh" , "sdk." + SDK_V3_PROTOCOL , "uast" , "generated.proto" ))
275+ protoc (j ("gopkg.in" , "bblfsh" , "sdk." + SDK_V3_PROTOCOL , "protocol" , "generated.proto" ), True )
266276
267277
268278def do_get_deps ():
269279 get_libuast ()
270280
271281 create_dirs (SDK_V1_MAJOR )
272- create_dirs (SDK_V2_MAJOR )
282+ create_dirs (SDK_V3_PROTOCOL )
273283
274284 create_inits (SDK_V1_MAJOR )
275- create_inits (SDK_V2_MAJOR )
285+ create_inits (SDK_V3_PROTOCOL )
276286
277287 proto_download_v1 ()
278288 proto_download_v2 ()
0 commit comments