Show More
@@ -1,81 +1,85 b'' | |||
|
1 | 1 | #!/usr/bin/env python |
|
2 | 2 | """IPython release script. |
|
3 | 3 | |
|
4 | 4 | This should ONLY be run at real release time. |
|
5 | 5 | """ |
|
6 | 6 | from __future__ import print_function |
|
7 | 7 | |
|
8 | 8 | from toollib import * |
|
9 | 9 | from gh_api import post_download |
|
10 | 10 | |
|
11 | 11 | # Get main ipython dir, this will raise if it doesn't pass some checks |
|
12 | 12 | ipdir = get_ipdir() |
|
13 | 13 | tooldir = pjoin(ipdir, 'tools') |
|
14 | 14 | distdir = pjoin(ipdir, 'dist') |
|
15 | 15 | |
|
16 | 16 | # Where I keep static backups of each release |
|
17 | 17 | ipbackupdir = os.path.expanduser('~/ipython/backup') |
|
18 | 18 | if not os.path.exists(ipbackupdir): |
|
19 | 19 | os.makedirs(ipbackupdir) |
|
20 | 20 | |
|
21 | 21 | # Start in main IPython dir |
|
22 | 22 | cd(ipdir) |
|
23 | 23 | |
|
24 | 24 | # Load release info |
|
25 | 25 | execfile(pjoin('IPython','core','release.py'), globals()) |
|
26 | 26 | # ensure js version is in sync |
|
27 | 27 | sh('./setup.py jsversion') |
|
28 | 28 | # build minified css and sourcemaps |
|
29 | 29 | sh('./setup.py css -x -f') |
|
30 | 30 | |
|
31 | 31 | # Build site addresses for file uploads |
|
32 | 32 | release_site = '%s/release/%s' % (archive, version) |
|
33 | 33 | backup_site = '%s/backup/' % archive |
|
34 | 34 | |
|
35 | 35 | # Start actual release process |
|
36 | 36 | print() |
|
37 | 37 | print('Releasing IPython') |
|
38 | 38 | print('=================') |
|
39 | 39 | print() |
|
40 | 40 | print('Version:', version) |
|
41 | 41 | print() |
|
42 | 42 | print('Source IPython directory:', ipdir) |
|
43 | 43 | print() |
|
44 | 44 | |
|
45 | 45 | # Perform local backup, go to tools dir to run it. |
|
46 | 46 | cd(tooldir) |
|
47 | 47 | sh('./make_tarball.py') |
|
48 | 48 | sh('mv ipython-*.tgz %s' % ipbackupdir) |
|
49 | 49 | |
|
50 | 50 | # Build release files |
|
51 | 51 | sh('./build_release %s' % ipdir) |
|
52 | 52 | |
|
53 | if 'upload' not in sys.argv: | |
|
54 | print("`./release upload` to register and release") | |
|
55 | sys.exit(0) | |
|
56 | ||
|
53 | 57 | # Register with the Python Package Index (PyPI) |
|
54 | 58 | print( 'Registering with PyPI...') |
|
55 | 59 | cd(ipdir) |
|
56 | 60 | sh('./setup.py register') |
|
57 | 61 | |
|
58 | 62 | # Upload all files |
|
59 | 63 | sh(sdists + ' upload') |
|
60 | 64 | for py in ('2.7', '3.4'): |
|
61 | 65 | sh('python%s setupegg.py bdist_wheel upload' % py) |
|
62 | 66 | |
|
63 | 67 | cd(distdir) |
|
64 | 68 | print( 'Uploading distribution files...') |
|
65 | 69 | |
|
66 | 70 | for fname in os.listdir('.'): |
|
67 | 71 | # TODO: update to GitHub releases API |
|
68 | 72 | continue |
|
69 | 73 | print('uploading %s to GitHub' % fname) |
|
70 | 74 | desc = "IPython %s source distribution" % version |
|
71 | 75 | post_download("ipython/ipython", fname, description=desc) |
|
72 | 76 | |
|
73 | 77 | # Make target dir if it doesn't exist |
|
74 | 78 | sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version)) |
|
75 | 79 | sh('scp * %s' % release_site) |
|
76 | 80 | |
|
77 | 81 | print( 'Uploading backup files...') |
|
78 | 82 | cd(ipbackupdir) |
|
79 | 83 | sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site) |
|
80 | 84 | |
|
81 | 85 | print('Done!') |
General Comments 0
You need to be logged in to leave comments.
Login now