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