##// END OF EJS Templates
Clean up version info tools and remove bzr references.
Fernando Perez -
Show More
@@ -1,35 +1,35 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','core','release.py'))
11 execfile(pjoin('IPython','core','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 pjoin('docs','source','api','generated')]:
18 pjoin('docs','source','api','generated')]:
19 if os.path.isdir(d):
19 if os.path.isdir(d):
20 remove_tree(d)
20 remove_tree(d)
21
21
22 # Build source and binary distros
22 # Build source and binary distros
23 c('./setup.py sdist --formats=gztar,zip')
23 sh('./setup.py sdist --formats=gztar,zip')
24
24
25 # Build eggs
25 # Build eggs
26 c('python2.6 ./setupegg.py bdist_egg')
26 sh('python2.6 ./setupegg.py bdist_egg')
27
27
28 # Call the windows build separately, so that the extra Windows scripts don't
28 # Call the windows build separately, so that the extra Windows scripts don't
29 # get pulled into Unix builds (setup.py has code which checks for
29 # get pulled into Unix builds (setup.py has code which checks for
30 # bdist_wininst)
30 # bdist_wininst)
31 c("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
31 sh("python setup.py bdist_wininst --install-script=ipython_win_post_install.py")
32
32
33 # Change name so retarded Vista runs the installer correctly
33 # Change name so retarded Vista runs the installer correctly
34 c("rename 's/linux-i686/win32-setup/' dist/*.exe")
34 sh("rename 's/linux-i686/win32-setup/' dist/*.exe")
35 c("rename 's/linux-x86_64/win32-setup/' dist/*.exe")
35 sh("rename 's/linux-x86_64/win32-setup/' dist/*.exe")
@@ -1,25 +1,25 b''
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 """Simple script to create a tarball with proper git info.
2 """Simple script to create a tarball with proper git info.
3 """
3 """
4
4
5 import commands
5 import commands
6 import os
6 import os
7 import sys
7 import sys
8 import shutil
8 import shutil
9
9
10 from toollib import *
10 from toollib import *
11
11
12 tag = commands.getoutput('git describe')
12 tag = commands.getoutput('git describe')
13 base_name = 'ipython-%s' % tag
13 base_name = 'ipython-%s' % tag
14 tar_name = '%s.tgz' % base_name
14 tar_name = '%s.tgz' % base_name
15
15
16 # git archive is weird: Even if I give it a specific path, it still won't
16 # git archive is weird: Even if I give it a specific path, it still won't
17 # archive the whole tree. It seems the only way to get the whole tree is to cd
17 # archive the whole tree. It seems the only way to get the whole tree is to cd
18 # to the top of the tree. There are long threads (since 2007) on the git list
18 # to the top of the tree. There are long threads (since 2007) on the git list
19 # about this and it still doesn't work in a sensible way...
19 # about this and it still doesn't work in a sensible way...
20
20
21 start_dir = os.getcwd()
21 start_dir = os.getcwd()
22 cd('..')
22 cd('..')
23 git_tpl = 'git archive --format=tar --prefix={0}/ HEAD | gzip > {1}'
23 git_tpl = 'git archive --format=tar --prefix={0}/ HEAD | gzip > {1}'
24 c(git_tpl.format(base_name, tar_name))
24 sh(git_tpl.format(base_name, tar_name))
25 c('mv {0} tools/'.format(tar_name))
25 sh('mv {0} tools/'.format(tar_name))
@@ -1,55 +1,48 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 sh(cmd):
15 """Run system command, raise SystemExit if it returns an error."""
15 """Run system command in shell, 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 # Backwards compatibility
23 c = sh
22
24
23 def get_ipdir():
25 def get_ipdir():
24 """Get IPython directory from command line, or assume it's the one above."""
26 """Get IPython directory from command line, or assume it's the one above."""
25
27
26 # Initialize arguments and check location
28 # Initialize arguments and check location
27 try:
29 try:
28 ipdir = sys.argv[1]
30 ipdir = sys.argv[1]
29 except IndexError:
31 except IndexError:
30 ipdir = '..'
32 ipdir = '..'
31
33
32 ipdir = os.path.abspath(ipdir)
34 ipdir = os.path.abspath(ipdir)
33
35
34 cd(ipdir)
36 cd(ipdir)
35 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
37 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
36 raise SystemExit('Invalid ipython directory: %s' % ipdir)
38 raise SystemExit('Invalid ipython directory: %s' % ipdir)
37 return ipdir
39 return ipdir
38
40
39
41
40 def compile_tree():
42 def compile_tree():
41 """Compile all Python files below current directory."""
43 """Compile all Python files below current directory."""
42 vstr = '.'.join(map(str,sys.version_info[:2]))
44 stat = os.system('python -m compileall .')
43 stat = os.system('python %s/lib/python%s/compileall.py .' %
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
50
51 def version_info():
52 """Return bzr version info as a dict."""
53 out = os.popen('bzr version-info')
54 pairs = (l.split(':',1) for l in out)
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