This repository was archived by the owner on Jun 12, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Expand file tree Collapse file tree 2 files changed +48
-1
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ wheels:
153
153
154
154
155
155
download-wheels :
156
- cd pandas && python scripts/download_wheels.py $(PANDAS_VERSION )
156
+ ./ scripts/download_wheels.py $(PANDAS_VERSION )
157
157
# TODO: Fetch from https://www.lfd.uci.edu/~gohlke/pythonlibs/
158
158
159
159
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ """Fetch wheels from wheels.scipy.org for a pandas version."""
3
+ import argparse
4
+ import pathlib
5
+ import sys
6
+ import urllib .parse
7
+ import urllib .request
8
+
9
+ from lxml import html
10
+
11
+
12
+ def parse_args (args = None ):
13
+ parser = argparse .ArgumentParser (description = __doc__ )
14
+ parser .add_argument ("version" , type = str , help = "Pandas version (0.23.0)" )
15
+ return parser .parse_args (args )
16
+
17
+
18
+ def fetch (version ):
19
+ base = "http://wheels.scipy.org"
20
+ tree = html .parse (base )
21
+ root = tree .getroot ()
22
+
23
+ dest = pathlib .Path ("dist" )
24
+ dest .mkdir (exist_ok = True )
25
+
26
+ files = [
27
+ x
28
+ for x in root .xpath ("//a/text()" )
29
+ if x .startswith (f"pandas-{ version } " ) and not dest .joinpath (x ).exists ()
30
+ ]
31
+
32
+ N = len (files )
33
+
34
+ for i , filename in enumerate (files , 1 ):
35
+ out = str (dest .joinpath (filename ))
36
+ link = urllib .request .urljoin (base , filename )
37
+ urllib .request .urlretrieve (link , out )
38
+ print (f"Downloaded { link } to { out } [{ i } /{ N } ]" )
39
+
40
+
41
+ def main (args = None ):
42
+ args = parse_args (args )
43
+ fetch (args .version )
44
+
45
+
46
+ if __name__ == "__main__" :
47
+ sys .exit (main ())
You can’t perform that action at this time.
0 commit comments