Show More
@@ -1,85 +1,81 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 |
|
|||
27 | sh('./setup.py jsversion') |
|
|||
28 | # build minified css and sourcemaps |
|
|||
29 | sh('./setup.py css -x -f') |
|
|||
30 |
|
26 | |||
31 | # Build site addresses for file uploads |
|
27 | # Build site addresses for file uploads | |
32 | release_site = '%s/release/%s' % (archive, version) |
|
28 | release_site = '%s/release/%s' % (archive, version) | |
33 | backup_site = '%s/backup/' % archive |
|
29 | backup_site = '%s/backup/' % archive | |
34 |
|
30 | |||
35 | # Start actual release process |
|
31 | # Start actual release process | |
36 | print() |
|
32 | print() | |
37 | print('Releasing IPython') |
|
33 | print('Releasing IPython') | |
38 | print('=================') |
|
34 | print('=================') | |
39 | print() |
|
35 | print() | |
40 | print('Version:', version) |
|
36 | print('Version:', version) | |
41 | print() |
|
37 | print() | |
42 | print('Source IPython directory:', ipdir) |
|
38 | print('Source IPython directory:', ipdir) | |
43 | print() |
|
39 | print() | |
44 |
|
40 | |||
45 | # Perform local backup, go to tools dir to run it. |
|
41 | # Perform local backup, go to tools dir to run it. | |
46 | cd(tooldir) |
|
42 | cd(tooldir) | |
47 | sh('./make_tarball.py') |
|
43 | sh('./make_tarball.py') | |
48 | sh('mv ipython-*.tgz %s' % ipbackupdir) |
|
44 | sh('mv ipython-*.tgz %s' % ipbackupdir) | |
49 |
|
45 | |||
50 | # Build release files |
|
46 | # Build release files | |
51 | sh('./build_release %s' % ipdir) |
|
47 | sh('./build_release %s' % ipdir) | |
52 |
|
48 | |||
53 | if 'upload' not in sys.argv: |
|
49 | if 'upload' not in sys.argv: | |
54 | print("`./release upload` to register and release") |
|
50 | print("`./release upload` to register and release") | |
55 | sys.exit(0) |
|
51 | sys.exit(0) | |
56 |
|
52 | |||
57 | # Register with the Python Package Index (PyPI) |
|
53 | # Register with the Python Package Index (PyPI) | |
58 | print( 'Registering with PyPI...') |
|
54 | print( 'Registering with PyPI...') | |
59 | cd(ipdir) |
|
55 | cd(ipdir) | |
60 | sh('./setup.py register') |
|
56 | sh('./setup.py register') | |
61 |
|
57 | |||
62 | # Upload all files |
|
58 | # Upload all files | |
63 | sh(sdists + ' upload') |
|
59 | sh(sdists + ' upload') | |
64 | for py in ('2.7', '3.4'): |
|
60 | for py in ('2.7', '3.4'): | |
65 | sh('python%s setupegg.py bdist_wheel upload' % py) |
|
61 | sh('python%s setupegg.py bdist_wheel upload' % py) | |
66 |
|
62 | |||
67 | cd(distdir) |
|
63 | cd(distdir) | |
68 | print( 'Uploading distribution files...') |
|
64 | print( 'Uploading distribution files...') | |
69 |
|
65 | |||
70 | for fname in os.listdir('.'): |
|
66 | for fname in os.listdir('.'): | |
71 | # TODO: update to GitHub releases API |
|
67 | # TODO: update to GitHub releases API | |
72 | continue |
|
68 | continue | |
73 | print('uploading %s to GitHub' % fname) |
|
69 | print('uploading %s to GitHub' % fname) | |
74 | desc = "IPython %s source distribution" % version |
|
70 | desc = "IPython %s source distribution" % version | |
75 | post_download("ipython/ipython", fname, description=desc) |
|
71 | post_download("ipython/ipython", fname, description=desc) | |
76 |
|
72 | |||
77 | # Make target dir if it doesn't exist |
|
73 | # Make target dir if it doesn't exist | |
78 | sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version)) |
|
74 | sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version)) | |
79 | sh('scp * %s' % release_site) |
|
75 | sh('scp * %s' % release_site) | |
80 |
|
76 | |||
81 | print( 'Uploading backup files...') |
|
77 | print( 'Uploading backup files...') | |
82 | cd(ipbackupdir) |
|
78 | cd(ipbackupdir) | |
83 | sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site) |
|
79 | sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site) | |
84 |
|
80 | |||
85 | print('Done!') |
|
81 | print('Done!') |
General Comments 0
You need to be logged in to leave comments.
Login now