##// END OF EJS Templates
add explicits imports on release tools
Matthias Bussonnier -
Show More
@@ -1,28 +1,28 b''
1 1 #!/usr/bin/env python
2 2 """IPython release build script.
3 3 """
4 4
5 5 import os
6 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 10 # Get main ipython dir, this will raise if it doesn't pass some checks
11 11 ipdir = get_ipdir()
12 12 cd(ipdir)
13 13
14 14 # Load release info
15 15 execfile(pjoin('IPython', 'core', 'release.py'), globals())
16 16
17 17 # Check that everything compiles
18 18 compile_tree()
19 19
20 20 # Cleanup
21 21 for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'),
22 22 pjoin('docs', 'source', 'api', 'generated')]:
23 23 if os.path.isdir(d):
24 24 rmtree(d)
25 25
26 26 # Build source and binary distros
27 27 sh(sdists)
28 28 sh(wheels)
@@ -1,81 +1,85 b''
1 1 #!/usr/bin/env python
2 2 """IPython release script.
3 3
4 4 This should ONLY be run at real release time.
5 5 """
6 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 13 from gh_api import post_download
10 14
11 15 # Get main ipython dir, this will raise if it doesn't pass some checks
12 16 ipdir = get_ipdir()
13 17 tooldir = pjoin(ipdir, 'tools')
14 18 distdir = pjoin(ipdir, 'dist')
15 19
16 20 # Where I keep static backups of each release
17 21 ipbackupdir = os.path.expanduser('~/ipython/backup')
18 22 if not os.path.exists(ipbackupdir):
19 23 os.makedirs(ipbackupdir)
20 24
21 25 # Start in main IPython dir
22 26 cd(ipdir)
23 27
24 28 # Load release info
25 29 execfile(pjoin('IPython','core','release.py'), globals())
26 30
27 31 # Build site addresses for file uploads
28 32 release_site = '%s/release/%s' % (archive, version)
29 33 backup_site = '%s/backup/' % archive
30 34
31 35 # Start actual release process
32 36 print()
33 37 print('Releasing IPython')
34 38 print('=================')
35 39 print()
36 40 print('Version:', version)
37 41 print()
38 42 print('Source IPython directory:', ipdir)
39 43 print()
40 44
41 45 # Perform local backup, go to tools dir to run it.
42 46 cd(tooldir)
43 47 sh('./make_tarball.py')
44 48 sh('mv ipython-*.tgz %s' % ipbackupdir)
45 49
46 50 # Build release files
47 51 sh('./build_release %s' % ipdir)
48 52
49 53 if 'upload' not in sys.argv:
50 54 print("`./release upload` to register and release")
51 55 sys.exit(0)
52 56
53 57 # Register with the Python Package Index (PyPI)
54 58 print( 'Registering with PyPI...')
55 59 cd(ipdir)
56 60 sh('./setup.py register')
57 61
58 62 # Upload all files
59 63 sh(sdists + ' upload')
60 64 for py in ('2.7', '3.4'):
61 65 sh('python%s setupegg.py bdist_wheel upload' % py)
62 66
63 67 cd(distdir)
64 68 print( 'Uploading distribution files...')
65 69
66 70 for fname in os.listdir('.'):
67 71 # TODO: update to GitHub releases API
68 72 continue
69 73 print('uploading %s to GitHub' % fname)
70 74 desc = "IPython %s source distribution" % version
71 75 post_download("ipython/ipython", fname, description=desc)
72 76
73 77 # Make target dir if it doesn't exist
74 78 sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version))
75 79 sh('scp * %s' % release_site)
76 80
77 81 print( 'Uploading backup files...')
78 82 cd(ipbackupdir)
79 83 sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site)
80 84
81 85 print('Done!')
General Comments 0
You need to be logged in to leave comments. Login now