##// END OF EJS Templates
Continue tool cleanup....
Fernando Perez -
Show More
@@ -1,14 +1,12 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 """Wrapper to run setup.py using setuptools."""
2 """Wrapper to run setup.py using setuptools."""
3
3
4 import sys
4 import sys
5
5
6 # now, import setuptools and call the actual setup
6 # now, import setuptools and call the actual setup
7 import setuptools
7 import setuptools
8 # print sys.argv
9 #sys.argv=['','bdist_egg']
10 execfile('setup.py')
8 execfile('setup.py')
11
9
12 # clean up the junk left around by setuptools
10 # clean up the junk left around by setuptools
13 if "develop" not in sys.argv:
11 if "develop" not in sys.argv:
14 os.system('rm -rf ipython.egg-info build')
12 os.system('rm -rf ipython.egg-info build')
@@ -1,42 +1,42 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 """IPython release build script.
2 """IPython release build script.
3 """
3 """
4 from toollib import *
4 from toollib import *
5
5
6 # Get main ipython dir, this will raise if it doesn't pass some checks
6 # Get main ipython dir, this will raise if it doesn't pass some checks
7 ipdir = get_ipdir()
7 ipdir = get_ipdir()
8 cd(ipdir)
8 cd(ipdir)
9
9
10 # Load release info
10 # Load release info
11 execfile(pjoin('IPython','Release.py'))
11 execfile(pjoin('IPython','Release.py'))
12
12
13 # Check that everything compiles
13 # Check that everything compiles
14 compile_tree()
14 compile_tree()
15
15
16 # Cleanup
16 # Cleanup
17 for d in ['build','dist',pjoin('docs','build'),pjoin('docs','dist')]:
17 for d in ['build','dist',pjoin('docs','build'),pjoin('docs','dist')]:
18 if os.path.isdir(d):
18 if os.path.isdir(d):
19 remove_tree(d)
19 remove_tree(d)
20
20
21 # Build source and binary distros
21 # Build source and binary distros
22 c('./setup.py sdist --formats=gztar')
22 c('./setup.py sdist --formats=gztar')
23
23
24 # Build version-specific RPMs, where we must use the --python option to ensure
24 # Build version-specific RPMs, where we must use the --python option to ensure
25 # that the resulting RPM is really built with the requested python version (so
25 # that the resulting RPM is really built with the requested python version (so
26 # things go to lib/python2.X/...)
26 # things go to lib/python2.X/...)
27 c("python2.5 ./setup.py bdist_rpm --binary-only --release=py25 "
27 c("python2.5 ./setup.py bdist_rpm --binary-only --release=py25 "
28 "--python=/usr/bin/python2.5")
28 "--python=/usr/bin/python2.5")
29 c("python2.6 ./setup.py bdist_rpm --binary-only --release=py26 "
29 c("python2.6 ./setup.py bdist_rpm --binary-only --release=py26 "
30 "--python=/usr/bin/python2.6")
30 "--python=/usr/bin/python2.6")
31
31
32 # Build eggs
32 # Build eggs
33 c('python2.5 ./eggsetup.py bdist_egg')
33 c('python2.5 ./setupegg.py bdist_egg')
34 c('python2.6 ./eggsetup.py bdist_egg')
34 c('python2.6 ./setupegg.py bdist_egg')
35
35
36 # Call the windows build separately, so that the extra Windows scripts don't
36 # Call the windows build separately, so that the extra Windows scripts don't
37 # get pulled into Unix builds (setup.py has code which checks for
37 # get pulled into Unix builds (setup.py has code which checks for
38 # bdist_wininst)
38 # bdist_wininst)
39 c("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
39 c("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
40
40
41 # Change name so retarded Vista runs the installer correctly
41 # Change name so retarded Vista runs the installer correctly
42 c("rename 's/win32/win32-setup/' dist/*.exe")
42 c("rename 's/win32/win32-setup/' dist/*.exe")
@@ -1,55 +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 # Library imports
3 # Library imports
4 import os
4 import os
5 import sys
5 import sys
6
6
7 from distutils.dir_util import remove_tree
7 from distutils.dir_util import remove_tree
8
8
9 # Useful shorthands
9 # Useful shorthands
10 pjoin = os.path.join
10 pjoin = os.path.join
11 cd = os.chdir
11 cd = os.chdir
12
12
13 # Utility functions
13 # Utility functions
14 def c(cmd):
14 def c(cmd):
15 """Run system command, raise SystemExit if it returns an error."""
15 """Run system command, raise SystemExit if it returns an error."""
16 print "$",cmd
16 print "$",cmd
17 #stat = os.system(cmd)
17 stat = os.system(cmd)
18 stat = 0 # Uncomment this and comment previous to run in debug mode
18 #stat = 0 # Uncomment this and comment previous to run in debug mode
19 if stat:
19 if stat:
20 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
20 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
21
21
22
22
23 def get_ipdir():
23 def get_ipdir():
24 """Get IPython directory from command line, or assume it's the one above."""
24 """Get IPython directory from command line, or assume it's the one above."""
25
25
26 # Initialize arguments and check location
26 # Initialize arguments and check location
27 try:
27 try:
28 ipdir = sys.argv[1]
28 ipdir = sys.argv[1]
29 except IndexError:
29 except IndexError:
30 ipdir = '..'
30 ipdir = '..'
31
31
32 ipdir = os.path.abspath(ipdir)
32 ipdir = os.path.abspath(ipdir)
33
33
34 cd(ipdir)
34 cd(ipdir)
35 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
35 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
36 raise SystemExit('Invalid ipython directory: %s' % ipdir)
36 raise SystemExit('Invalid ipython directory: %s' % ipdir)
37 return ipdir
37 return ipdir
38
38
39
39
40 def compile_tree():
40 def compile_tree():
41 """Compile all Python files below current directory."""
41 """Compile all Python files below current directory."""
42 vstr = '.'.join(map(str,sys.version_info[:2]))
42 vstr = '.'.join(map(str,sys.version_info[:2]))
43 stat = os.system('python %s/lib/python%s/compileall.py .' %
43 stat = os.system('python %s/lib/python%s/compileall.py .' %
44 (sys.prefix,vstr))
44 (sys.prefix,vstr))
45 if stat:
45 if stat:
46 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
46 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
47 msg += 'See messages above for the actual file that produced it.\n'
47 msg += 'See messages above for the actual file that produced it.\n'
48 raise SystemExit(msg)
48 raise SystemExit(msg)
49
49
50
50
51 def version_info():
51 def version_info():
52 """Return bzr version info as a dict."""
52 """Return bzr version info as a dict."""
53 out = os.popen('bzr version-info')
53 out = os.popen('bzr version-info')
54 pairs = (l.split(':',1) for l in out)
54 pairs = (l.split(':',1) for l in out)
55 return dict(((k,v.strip()) for (k,v) in pairs))
55 return dict(((k,v.strip()) for (k,v) in pairs))
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now