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