File tree Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Expand file tree Collapse file tree 1 file changed +53
-0
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python3
2
+
3
+ # Script for downloading mypy_mypyc wheels in preparation for a release
4
+
5
+ import os
6
+ import os .path
7
+ import sys
8
+ from urllib .request import urlopen
9
+
10
+
11
+ PLATFORMS = [
12
+ 'macosx_10_6_x86_64.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64' ,
13
+ 'manylinux1_x86_64' ,
14
+ 'win_amd64' ,
15
+ ]
16
+ MIN_VER = 5
17
+ MAX_VER = 7
18
+ BASE_URL = "https://github.com/mypyc/mypy_mypyc-wheels/releases/download"
19
+ URL = "{base}/v{version}/mypy_mypyc-{version}-cp3{pyver}-cp3{pyver}m-{platform}.whl"
20
+
21
+ def download (url ):
22
+ print ('Downloading' , url )
23
+ name = os .path .join ('dist' , os .path .split (url )[1 ])
24
+ with urlopen (url ) as f :
25
+ data = f .read ()
26
+ with open (name , 'wb' ) as f :
27
+ f .write (data )
28
+
29
+ def download_files (version ):
30
+ for pyver in range (MIN_VER , MAX_VER + 1 ):
31
+ for platform in PLATFORMS :
32
+ url = URL .format (
33
+ base = BASE_URL ,
34
+ version = version ,
35
+ pyver = pyver ,
36
+ platform = platform )
37
+ # argh, there is an inconsistency here and I don't know why
38
+ if 'win_' in platform :
39
+ parts = url .rsplit ('/' , 1 )
40
+ parts [1 ] = parts [1 ].replace ("+dev" , ".dev" )
41
+ url = '/' .join (parts )
42
+
43
+ download (url )
44
+
45
+ def main (argv ):
46
+ if len (argv ) != 2 :
47
+ sys .exit ("Usage: download-mypy-wheels.py version" )
48
+
49
+ os .makedirs ('dist' , exist_ok = True )
50
+ download_files (argv [1 ])
51
+
52
+ if __name__ == '__main__' :
53
+ main (sys .argv )
You can’t perform that action at this time.
0 commit comments