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