##// END OF EJS Templates
Update release-related tools, make more py3k-friendly.
Fernando Perez -
Show More
@@ -1,52 +1,63 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
7
7 from toollib import *
8 from toollib import *
8
9
9 # 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
10 ipdir = get_ipdir()
11 ipdir = get_ipdir()
11 tooldir = pjoin(ipdir,'tools')
12 tooldir = pjoin(ipdir, 'tools')
12 distdir = pjoin(ipdir,'dist')
13 distdir = pjoin(ipdir, 'dist')
14
13 # Where I keep static backups of each release
15 # Where I keep static backups of each release
14 ipbackupdir = os.path.expanduser('~/ipython/backup')
16 ipbackupdir = os.path.expanduser('~/ipython/backup')
15
17
18 # SSH root address of the archive site
19 archive = 'ipython@archive.ipython.org:archive.ipython.org'
16 # Start in main IPython dir
20 # Start in main IPython dir
17 cd(ipdir)
21 cd(ipdir)
18
22
19 # Load release info
23 # Load release info
20 execfile(pjoin('IPython','core','release.py'))
24 execfile(pjoin('IPython','core','release.py'))
21
25
22 print
26 # Build site addresses for file uploads
23 print "Releasing IPython"
27 release_site = '%s/release/%s' % (archive, version)
24 print "================="
28 backup_site = '%s/backup/%s' % (archive, version)
25 print
29
26 print 'Source IPython directory:', ipdir
30 # Start actual release process
27 print
31 print()
32 print('Releasing IPython')
33 print('=================')
34 print()
35 print('Version:', version)
36 print()
37 print('Source IPython directory:', ipdir)
38 print()
28
39
29 # Perform local backup, go to tools dir to run it.
40 # Perform local backup, go to tools dir to run it.
30 cd(tooldir)
41 cd(tooldir)
31 c('./make_tarball.py')
42 sh('./make_tarball.py')
32 c('mv ipython-*.tgz %s' % ipbackupdir)
43 sh('mv ipython-*.tgz %s' % ipbackupdir)
33
44
34 # Build release files
45 # Build release files
35 c('./build_release %s' % ipdir)
46 sh('./build_release %s' % ipdir)
36
47
37 # Register with the Python Package Index (PyPI)
48 # Register with the Python Package Index (PyPI)
38 print "Registering with PyPI..."
49 print( 'Registering with PyPI...')
39 cd(ipdir)
50 cd(ipdir)
40 c('./setup.py register')
51 sh('./setup.py register')
41
52
42 # Upload all files
53 # Upload all files
43 c('./setup.py sdist --formats=gztar,zip upload')
54 sh('./setup.py sdist --formats=gztar,zip upload')
44 cd(distdir)
55 cd(distdir)
45 print "Uploading distribution files..."
56 print( 'Uploading distribution files...')
46 c('scp * ipython@ipython.scipy.org:www/dist/')
57 sh('scp * %s' % release_site)
47
58
48 print "Uploading backup files..."
59 print( 'Uploading backup files...')
49 cd(ipbackupdir)
60 cd(ipbackupdir)
50 c('scp `ls -1tr *tgz | tail -1` ipython@ipython.scipy.org:www/backup/')
61 sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site)
51
62
52 print "Done!"
63 print('Done!')
@@ -1,5 +1,7 b''
1 """Various utilities common to IPython release and maintenance tools.
1 """Various utilities common to IPython release and maintenance tools.
2 """
2 """
3 from __future__ import print_function
4
3 # Library imports
5 # Library imports
4 import os
6 import os
5 import sys
7 import sys
@@ -13,7 +15,7 b' cd = os.chdir'
13 # Utility functions
15 # Utility functions
14 def sh(cmd):
16 def sh(cmd):
15 """Run system command in shell, raise SystemExit if it returns an error."""
17 """Run system command in shell, raise SystemExit if it returns an error."""
16 print "$",cmd
18 print("$", cmd)
17 stat = os.system(cmd)
19 stat = os.system(cmd)
18 #stat = 0 # Uncomment this and comment previous to run in debug mode
20 #stat = 0 # Uncomment this and comment previous to run in debug mode
19 if stat:
21 if stat:
General Comments 0
You need to be logged in to leave comments. Login now