Show More
@@ -0,0 +1,46 b'' | |||||
|
1 | """ | |||
|
2 | build [and upload] Windows IPython releases | |||
|
3 | ||||
|
4 | usage: | |||
|
5 | ||||
|
6 | python tools/release_windows.py [--github] [--pypi] | |||
|
7 | ||||
|
8 | Meant to be run on Windows | |||
|
9 | ||||
|
10 | Requires that you have python and python3 on your PATH | |||
|
11 | """ | |||
|
12 | ||||
|
13 | import glob | |||
|
14 | import os | |||
|
15 | import shutil | |||
|
16 | import sys | |||
|
17 | ||||
|
18 | from toollib import sh | |||
|
19 | try: | |||
|
20 | import gh_api | |||
|
21 | except ImportError: | |||
|
22 | gh_api = None | |||
|
23 | ||||
|
24 | github = '--github' in sys.argv | |||
|
25 | ||||
|
26 | cmd_t = "{py} setup.py bdist_wininst --plat-name=py{v}-{plat}" | |||
|
27 | ||||
|
28 | if '--pypi' in sys.argv: | |||
|
29 | cmd_t += ' --upload' | |||
|
30 | ||||
|
31 | for py in ['python', 'python3']: | |||
|
32 | # deliberately mangle the name, | |||
|
33 | # so easy_install doesn't find these and do horrible wrong things | |||
|
34 | v = 3 if py.endswith('3') else 2 | |||
|
35 | try: | |||
|
36 | shutil.rmtree('build') | |||
|
37 | except OSError: | |||
|
38 | pass | |||
|
39 | for plat in ['32b-Windows', '64b-Windows']: | |||
|
40 | cmd = cmd_t.format(**locals()) | |||
|
41 | sh(cmd) | |||
|
42 | if github and gh_api: | |||
|
43 | exe = glob.glob(os.path.join("dist", "ipython-*{v}-{plat}.exe".format(**locals())))[0] | |||
|
44 | print ("Uploading %s to GitHub" % exe) | |||
|
45 | desc = "IPython Installer for Python {v}.x on {plat}".format(**locals()) | |||
|
46 | gh_api.post_download('ipython/ipython', exe, description=desc) |
General Comments 0
You need to be logged in to leave comments.
Login now