Show More
@@ -1,72 +1,77 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 |
|
18 | |||
19 | # Start in main IPython dir |
|
19 | # Start in main IPython dir | |
20 | cd(ipdir) |
|
20 | cd(ipdir) | |
21 |
|
21 | |||
22 | # Load release info |
|
22 | # Load release info | |
23 | execfile(pjoin('IPython','core','release.py')) |
|
23 | execfile(pjoin('IPython','core','release.py')) | |
|
24 | # ensure js version is in sync | |||
|
25 | sh('./setup.py jsversion') | |||
24 |
|
26 | |||
25 | # Build site addresses for file uploads |
|
27 | # Build site addresses for file uploads | |
26 | release_site = '%s/release/%s' % (archive, version) |
|
28 | release_site = '%s/release/%s' % (archive, version) | |
27 | backup_site = '%s/backup/' % archive |
|
29 | backup_site = '%s/backup/' % archive | |
28 |
|
30 | |||
29 | # Start actual release process |
|
31 | # Start actual release process | |
30 | print() |
|
32 | print() | |
31 | print('Releasing IPython') |
|
33 | print('Releasing IPython') | |
32 | print('=================') |
|
34 | print('=================') | |
33 | print() |
|
35 | print() | |
34 | print('Version:', version) |
|
36 | print('Version:', version) | |
35 | print() |
|
37 | print() | |
36 | print('Source IPython directory:', ipdir) |
|
38 | print('Source IPython directory:', ipdir) | |
37 | print() |
|
39 | print() | |
38 |
|
40 | |||
39 | # Perform local backup, go to tools dir to run it. |
|
41 | # Perform local backup, go to tools dir to run it. | |
40 | cd(tooldir) |
|
42 | cd(tooldir) | |
41 | sh('./make_tarball.py') |
|
43 | sh('./make_tarball.py') | |
42 | sh('mv ipython-*.tgz %s' % ipbackupdir) |
|
44 | sh('mv ipython-*.tgz %s' % ipbackupdir) | |
43 |
|
45 | |||
44 | # Build release files |
|
46 | # Build release files | |
45 | sh('./build_release %s' % ipdir) |
|
47 | sh('./build_release %s' % ipdir) | |
46 |
|
48 | |||
47 | # Register with the Python Package Index (PyPI) |
|
49 | # Register with the Python Package Index (PyPI) | |
48 | print( 'Registering with PyPI...') |
|
50 | print( 'Registering with PyPI...') | |
49 | cd(ipdir) |
|
51 | cd(ipdir) | |
50 | sh('./setup.py register') |
|
52 | sh('./setup.py register') | |
51 |
|
53 | |||
52 | # Upload all files |
|
54 | # Upload all files | |
53 | sh(sdists + ' upload') |
|
55 | sh(sdists + ' upload') | |
|
56 | for py in ('2.7', '3.3'): | |||
|
57 | sh('python%s setupegg.py bdist_wheel' % py) | |||
|
58 | ||||
54 | cd(distdir) |
|
59 | cd(distdir) | |
55 | print( 'Uploading distribution files...') |
|
60 | print( 'Uploading distribution files...') | |
56 |
|
61 | |||
57 | for fname in os.listdir('.'): |
|
62 | for fname in os.listdir('.'): | |
58 | # GitHub doesn't have an API for uploads at the moment |
|
63 | # GitHub doesn't have an API for uploads at the moment | |
59 | continue |
|
64 | continue | |
60 | print('uploading %s to GitHub' % fname) |
|
65 | print('uploading %s to GitHub' % fname) | |
61 | desc = "IPython %s source distribution" % version |
|
66 | desc = "IPython %s source distribution" % version | |
62 | post_download("ipython/ipython", fname, description=desc) |
|
67 | post_download("ipython/ipython", fname, description=desc) | |
63 |
|
68 | |||
64 | # Make target dir if it doesn't exist |
|
69 | # Make target dir if it doesn't exist | |
65 | sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version)) |
|
70 | sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version)) | |
66 | sh('scp * %s' % release_site) |
|
71 | sh('scp * %s' % release_site) | |
67 |
|
72 | |||
68 | print( 'Uploading backup files...') |
|
73 | print( 'Uploading backup files...') | |
69 | cd(ipbackupdir) |
|
74 | cd(ipbackupdir) | |
70 | sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site) |
|
75 | sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site) | |
71 |
|
76 | |||
72 | print('Done!') |
|
77 | print('Done!') |
General Comments 0
You need to be logged in to leave comments.
Login now