Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

Commit 788ceb1

Browse files
authored
Merge pull request #157 from creachadair/ambience
Derive the libuast os/arch selector from sys.platform.
2 parents 815835d + d897c7c commit 788ceb1

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

setup.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
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.
1717
VERSION = "3.x.x-dev"
18-
LIBUAST_VERSION = "v3.3.0"
19-
LIBUAST_ARCH = "linux-amd64"
18+
LIBUAST_VERSION = "v3.3.1"
2019
SDK_V1_VERSION = "v1.17.0"
2120
SDK_V1_MAJOR = SDK_V1_VERSION.split('.')[0]
2221
SDK_V2_VERSION = "v2.16.4"
@@ -132,6 +131,18 @@ def create_inits(sdk_major):
132131
open(f, "w").close()
133132

134133

134+
def get_libuast_arch():
135+
"""Return the os-arch tag to use when fetching libuast.
136+
"""
137+
138+
# See https://github.com/bblfsh/client-python/issues/156.
139+
if sys.platform == 'win32':
140+
return 'windows-amd64'
141+
elif sys.platform:
142+
return sys.platform + '-amd64'
143+
return 'linux-amd64'
144+
145+
135146
def get_libuast():
136147
if not GET_LIBUAST:
137148
return
@@ -141,8 +152,9 @@ def get_libuast():
141152
mkdir(local_libuast)
142153

143154
# Retrieve libuast
144-
untar_url("https://github.com/bblfsh/libuast/releases/download/%s/libuast-%s.tar.gz" % (LIBUAST_VERSION, LIBUAST_ARCH))
145-
mv(LIBUAST_ARCH, local_libuast)
155+
untar_url("https://github.com/bblfsh/libuast/releases/download/%s/libuast-%s.tar.gz" % (
156+
LIBUAST_VERSION, get_libuast_arch()))
157+
mv(get_libuast_arch(), local_libuast)
146158

147159

148160
def proto_download_v1():

0 commit comments

Comments
 (0)