##// END OF EJS Templates
Factor build logic into function
Matthias Bussonnier -
Show More
@@ -1,28 +1,32 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 """IPython release build script.
2 """IPython release build script.
3 """
3 """
4
5 import os
4 import os
6 from shutil import rmtree
5 from shutil import rmtree
7
6
8 from toollib import sh, pjoin, get_ipdir, cd, compile_tree, execfile, sdists, wheels
7 from toollib import sh, pjoin, get_ipdir, cd, compile_tree, execfile, sdists, buildwheels
8
9 def build_release():
10
11 # Get main ipython dir, this will raise if it doesn't pass some checks
12 ipdir = get_ipdir()
13 cd(ipdir)
9
14
10 # Get main ipython dir, this will raise if it doesn't pass some checks
15 # Load release info
11 ipdir = get_ipdir()
16 execfile(pjoin('IPython', 'core', 'release.py'), globals())
12 cd(ipdir)
13
17
14 # Load release info
18 # Check that everything compiles
15 execfile(pjoin('IPython', 'core', 'release.py'), globals())
19 compile_tree('*')
16
20
17 # Check that everything compiles
21 # Cleanup
18 compile_tree('*')
22 for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'),
23 pjoin('docs', 'source', 'api', 'generated')]:
24 if os.path.isdir(d):
25 rmtree(d)
19
26
20 # Cleanup
27 # Build source and binary distros
21 for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'),
28 sh(sdists)
22 pjoin('docs', 'source', 'api', 'generated')]:
29 buildwheels()
23 if os.path.isdir(d):
24 rmtree(d)
25
30
26 # Build source and binary distros
31 if __name__ == '__main__':
27 sh(sdists)
32 build_release()
28 sh(wheels)
@@ -9,7 +9,7 b' import os'
9 import sys
9 import sys
10
10
11 from toollib import (get_ipdir, pjoin, cd, execfile, sh, archive,
11 from toollib import (get_ipdir, pjoin, cd, execfile, sh, archive,
12 sdists, archive_user, archive_dir)
12 sdists, archive_user, archive_dir, buildwheels)
13 from gh_api import post_download
13 from gh_api import post_download
14
14
15 # 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
@@ -56,8 +56,8 b' cd(ipdir)'
56
56
57 # Upload all files
57 # Upload all files
58 sh(sdists)
58 sh(sdists)
59 for py in ('2', '3'):
59
60 sh('python%s setupegg.py bdist_wheel' % py)
60 buildwheels()
61
61
62 if 'upload' not in sys.argv:
62 if 'upload' not in sys.argv:
63 print("`./release upload` to register and release")
63 print("`./release upload` to register and release")
@@ -20,7 +20,9 b" archive = '%s:%s' % (archive_user, archive_dir)"
20 # Source dists
20 # Source dists
21 sdists = './setup.py sdist --formats=gztar,zip'
21 sdists = './setup.py sdist --formats=gztar,zip'
22 # Binary dists
22 # Binary dists
23 wheels = './setupegg.py bdist_wheel'
23 def buildwheels():
24 for py in ('2', '3'):
25 sh('python%s setupegg.py bdist_wheel' % py)
24
26
25 # Utility functions
27 # Utility functions
26 def sh(cmd):
28 def sh(cmd):
General Comments 0
You need to be logged in to leave comments. Login now