Show More
@@ -1,28 +1,28 b'' | |||||
1 | #!/usr/bin/env python |
|
1 | #!/usr/bin/env python | |
2 | """IPython release build script. |
|
2 | """IPython release build script. | |
3 | """ |
|
3 | """ | |
4 |
|
4 | |||
5 | import os |
|
5 | import os | |
6 | from shutil import rmtree |
|
6 | from shutil import rmtree | |
7 |
|
7 | |||
8 | from toollib import * |
|
8 | from toollib import sh, pjoin, get_ipdir, cd, compile_tree, execfile, sdists, wheels | |
9 |
|
9 | |||
10 | # Get main ipython dir, this will raise if it doesn't pass some checks |
|
10 | # Get main ipython dir, this will raise if it doesn't pass some checks | |
11 | ipdir = get_ipdir() |
|
11 | ipdir = get_ipdir() | |
12 | cd(ipdir) |
|
12 | cd(ipdir) | |
13 |
|
13 | |||
14 | # Load release info |
|
14 | # Load release info | |
15 | execfile(pjoin('IPython', 'core', 'release.py'), globals()) |
|
15 | execfile(pjoin('IPython', 'core', 'release.py'), globals()) | |
16 |
|
16 | |||
17 | # Check that everything compiles |
|
17 | # Check that everything compiles | |
18 | compile_tree() |
|
18 | compile_tree() | |
19 |
|
19 | |||
20 | # Cleanup |
|
20 | # Cleanup | |
21 | for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'), |
|
21 | for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'), | |
22 | pjoin('docs', 'source', 'api', 'generated')]: |
|
22 | pjoin('docs', 'source', 'api', 'generated')]: | |
23 | if os.path.isdir(d): |
|
23 | if os.path.isdir(d): | |
24 | rmtree(d) |
|
24 | rmtree(d) | |
25 |
|
25 | |||
26 | # Build source and binary distros |
|
26 | # Build source and binary distros | |
27 | sh(sdists) |
|
27 | sh(sdists) | |
28 | sh(wheels) |
|
28 | sh(wheels) |
@@ -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 | import os | |
|
9 | import sys | |||
|
10 | ||||
|
11 | from toollib import (get_ipdir, pjoin, cd, execfile, version, sh, archive, | |||
|
12 | sdists, archive_user, archive_dir) | |||
9 | from gh_api import post_download |
|
13 | from gh_api import post_download | |
10 |
|
14 | |||
11 | # Get main ipython dir, this will raise if it doesn't pass some checks |
|
15 | # Get main ipython dir, this will raise if it doesn't pass some checks | |
12 | ipdir = get_ipdir() |
|
16 | ipdir = get_ipdir() | |
13 | tooldir = pjoin(ipdir, 'tools') |
|
17 | tooldir = pjoin(ipdir, 'tools') | |
14 | distdir = pjoin(ipdir, 'dist') |
|
18 | distdir = pjoin(ipdir, 'dist') | |
15 |
|
19 | |||
16 | # Where I keep static backups of each release |
|
20 | # Where I keep static backups of each release | |
17 | ipbackupdir = os.path.expanduser('~/ipython/backup') |
|
21 | ipbackupdir = os.path.expanduser('~/ipython/backup') | |
18 | if not os.path.exists(ipbackupdir): |
|
22 | if not os.path.exists(ipbackupdir): | |
19 | os.makedirs(ipbackupdir) |
|
23 | os.makedirs(ipbackupdir) | |
20 |
|
24 | |||
21 | # Start in main IPython dir |
|
25 | # Start in main IPython dir | |
22 | cd(ipdir) |
|
26 | cd(ipdir) | |
23 |
|
27 | |||
24 | # Load release info |
|
28 | # Load release info | |
25 | execfile(pjoin('IPython','core','release.py'), globals()) |
|
29 | execfile(pjoin('IPython','core','release.py'), globals()) | |
26 |
|
30 | |||
27 | # Build site addresses for file uploads |
|
31 | # Build site addresses for file uploads | |
28 | release_site = '%s/release/%s' % (archive, version) |
|
32 | release_site = '%s/release/%s' % (archive, version) | |
29 | backup_site = '%s/backup/' % archive |
|
33 | backup_site = '%s/backup/' % archive | |
30 |
|
34 | |||
31 | # Start actual release process |
|
35 | # Start actual release process | |
32 | print() |
|
36 | print() | |
33 | print('Releasing IPython') |
|
37 | print('Releasing IPython') | |
34 | print('=================') |
|
38 | print('=================') | |
35 | print() |
|
39 | print() | |
36 | print('Version:', version) |
|
40 | print('Version:', version) | |
37 | print() |
|
41 | print() | |
38 | print('Source IPython directory:', ipdir) |
|
42 | print('Source IPython directory:', ipdir) | |
39 | print() |
|
43 | print() | |
40 |
|
44 | |||
41 | # Perform local backup, go to tools dir to run it. |
|
45 | # Perform local backup, go to tools dir to run it. | |
42 | cd(tooldir) |
|
46 | cd(tooldir) | |
43 | sh('./make_tarball.py') |
|
47 | sh('./make_tarball.py') | |
44 | sh('mv ipython-*.tgz %s' % ipbackupdir) |
|
48 | sh('mv ipython-*.tgz %s' % ipbackupdir) | |
45 |
|
49 | |||
46 | # Build release files |
|
50 | # Build release files | |
47 | sh('./build_release %s' % ipdir) |
|
51 | sh('./build_release %s' % ipdir) | |
48 |
|
52 | |||
49 | if 'upload' not in sys.argv: |
|
53 | if 'upload' not in sys.argv: | |
50 | print("`./release upload` to register and release") |
|
54 | print("`./release upload` to register and release") | |
51 | sys.exit(0) |
|
55 | sys.exit(0) | |
52 |
|
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