##// END OF EJS Templates
Update utilities to be all Python, use numbered paths in testing uploads.
Fernando Perez -
Show More
@@ -1,63 +1,61 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 from __future__ import print_function
7
7
8 from toollib import *
8 from toollib import *
9
9
10 # 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
11 ipdir = get_ipdir()
11 ipdir = get_ipdir()
12 tooldir = pjoin(ipdir, 'tools')
12 tooldir = pjoin(ipdir, 'tools')
13 distdir = pjoin(ipdir, 'dist')
13 distdir = pjoin(ipdir, 'dist')
14
14
15 # Where I keep static backups of each release
15 # Where I keep static backups of each release
16 ipbackupdir = os.path.expanduser('~/ipython/backup')
16 ipbackupdir = os.path.expanduser('~/ipython/backup')
17
17
18 # SSH root address of the archive site
19 archive = 'ipython@archive.ipython.org:archive.ipython.org'
20 # Start in main IPython dir
18 # Start in main IPython dir
21 cd(ipdir)
19 cd(ipdir)
22
20
23 # Load release info
21 # Load release info
24 execfile(pjoin('IPython','core','release.py'))
22 execfile(pjoin('IPython','core','release.py'))
25
23
26 # Build site addresses for file uploads
24 # Build site addresses for file uploads
27 release_site = '%s/release/%s' % (archive, version)
25 release_site = '%s/release/%s' % (archive, version)
28 backup_site = '%s/backup/%s' % (archive, version)
26 backup_site = '%s/backup/%s' % (archive, version)
29
27
30 # Start actual release process
28 # Start actual release process
31 print()
29 print()
32 print('Releasing IPython')
30 print('Releasing IPython')
33 print('=================')
31 print('=================')
34 print()
32 print()
35 print('Version:', version)
33 print('Version:', version)
36 print()
34 print()
37 print('Source IPython directory:', ipdir)
35 print('Source IPython directory:', ipdir)
38 print()
36 print()
39
37
40 # Perform local backup, go to tools dir to run it.
38 # Perform local backup, go to tools dir to run it.
41 cd(tooldir)
39 cd(tooldir)
42 sh('./make_tarball.py')
40 sh('./make_tarball.py')
43 sh('mv ipython-*.tgz %s' % ipbackupdir)
41 sh('mv ipython-*.tgz %s' % ipbackupdir)
44
42
45 # Build release files
43 # Build release files
46 sh('./build_release %s' % ipdir)
44 sh('./build_release %s' % ipdir)
47
45
48 # Register with the Python Package Index (PyPI)
46 # Register with the Python Package Index (PyPI)
49 print( 'Registering with PyPI...')
47 print( 'Registering with PyPI...')
50 cd(ipdir)
48 cd(ipdir)
51 sh('./setup.py register')
49 sh('./setup.py register')
52
50
53 # Upload all files
51 # Upload all files
54 sh('./setup.py sdist --formats=gztar,zip upload')
52 sh('./setup.py sdist --formats=gztar,zip upload')
55 cd(distdir)
53 cd(distdir)
56 print( 'Uploading distribution files...')
54 print( 'Uploading distribution files...')
57 sh('scp * %s' % release_site)
55 sh('scp * %s' % release_site)
58
56
59 print( 'Uploading backup files...')
57 print( 'Uploading backup files...')
60 cd(ipbackupdir)
58 cd(ipbackupdir)
61 sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site)
59 sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site)
62
60
63 print('Done!')
61 print('Done!')
@@ -1,6 +1,19 b''
1 #!/bin/sh
1 #!/usr/bin/env python
2 # Simple upload script to push up into the testing directory a local build
2 """Simple upload script to push up into the testing directory a local build
3 ipdir=$PWD/..
3 """
4 from __future__ import print_function
4
5
5 cd $ipdir/dist
6 from toollib import *
6 scp * ipython@archive.ipython.org:archive.ipython.org/testing/
7
8 # Get main ipython dir, this will raise if it doesn't pass some checks
9 ipdir = get_ipdir()
10 distdir = pjoin(ipdir, 'dist')
11
12 # Load release info
13 execfile(pjoin(ipdir, 'IPython','core','release.py'))
14
15 # Build site addresses for file uploads
16 testing_site = '%s/testing/%s' % (archive, version)
17
18 cd(distdir)
19 sh('scp * %s' % testing_site)
@@ -1,50 +1,55 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
3 from __future__ import print_function
4
4
5 # Library imports
5 # Library imports
6 import os
6 import os
7 import sys
7 import sys
8
8
9 from distutils.dir_util import remove_tree
9 from distutils.dir_util import remove_tree
10
10
11 # Useful shorthands
11 # Useful shorthands
12 pjoin = os.path.join
12 pjoin = os.path.join
13 cd = os.chdir
13 cd = os.chdir
14
14
15 # Constants
16
17 # SSH root address of the archive site
18 archive = 'ipython@archive.ipython.org:archive.ipython.org'
19
15 # Utility functions
20 # Utility functions
16 def sh(cmd):
21 def sh(cmd):
17 """Run system command in shell, raise SystemExit if it returns an error."""
22 """Run system command in shell, raise SystemExit if it returns an error."""
18 print("$", cmd)
23 print("$", cmd)
19 stat = os.system(cmd)
24 stat = os.system(cmd)
20 #stat = 0 # Uncomment this and comment previous to run in debug mode
25 #stat = 0 # Uncomment this and comment previous to run in debug mode
21 if stat:
26 if stat:
22 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
27 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
23
28
24 # Backwards compatibility
29 # Backwards compatibility
25 c = sh
30 c = sh
26
31
27 def get_ipdir():
32 def get_ipdir():
28 """Get IPython directory from command line, or assume it's the one above."""
33 """Get IPython directory from command line, or assume it's the one above."""
29
34
30 # Initialize arguments and check location
35 # Initialize arguments and check location
31 try:
36 try:
32 ipdir = sys.argv[1]
37 ipdir = sys.argv[1]
33 except IndexError:
38 except IndexError:
34 ipdir = '..'
39 ipdir = '..'
35
40
36 ipdir = os.path.abspath(ipdir)
41 ipdir = os.path.abspath(ipdir)
37
42
38 cd(ipdir)
43 cd(ipdir)
39 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
44 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
40 raise SystemExit('Invalid ipython directory: %s' % ipdir)
45 raise SystemExit('Invalid ipython directory: %s' % ipdir)
41 return ipdir
46 return ipdir
42
47
43
48
44 def compile_tree():
49 def compile_tree():
45 """Compile all Python files below current directory."""
50 """Compile all Python files below current directory."""
46 stat = os.system('python -m compileall .')
51 stat = os.system('python -m compileall .')
47 if stat:
52 if stat:
48 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
53 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
49 msg += 'See messages above for the actual file that produced it.\n'
54 msg += 'See messages above for the actual file that produced it.\n'
50 raise SystemExit(msg)
55 raise SystemExit(msg)
General Comments 0
You need to be logged in to leave comments. Login now