##// END OF EJS Templates
Clean up version info tools and remove bzr references.
Fernando Perez -
Show More
@@ -1,35 +1,35 b''
1 1 #!/usr/bin/env python
2 2 """IPython release build script.
3 3 """
4 4 from toollib import *
5 5
6 6 # Get main ipython dir, this will raise if it doesn't pass some checks
7 7 ipdir = get_ipdir()
8 8 cd(ipdir)
9 9
10 10 # Load release info
11 11 execfile(pjoin('IPython','core','release.py'))
12 12
13 13 # Check that everything compiles
14 14 compile_tree()
15 15
16 16 # Cleanup
17 17 for d in ['build','dist',pjoin('docs','build'),pjoin('docs','dist'),
18 18 pjoin('docs','source','api','generated')]:
19 19 if os.path.isdir(d):
20 20 remove_tree(d)
21 21
22 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 25 # Build eggs
26 c('python2.6 ./setupegg.py bdist_egg')
26 sh('python2.6 ./setupegg.py bdist_egg')
27 27
28 28 # Call the windows build separately, so that the extra Windows scripts don't
29 29 # get pulled into Unix builds (setup.py has code which checks for
30 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 33 # Change name so retarded Vista runs the installer correctly
34 c("rename 's/linux-i686/win32-setup/' dist/*.exe")
35 c("rename 's/linux-x86_64/win32-setup/' dist/*.exe")
34 sh("rename 's/linux-i686/win32-setup/' dist/*.exe")
35 sh("rename 's/linux-x86_64/win32-setup/' dist/*.exe")
@@ -1,25 +1,25 b''
1 1 #!/usr/bin/env python
2 2 """Simple script to create a tarball with proper git info.
3 3 """
4 4
5 5 import commands
6 6 import os
7 7 import sys
8 8 import shutil
9 9
10 10 from toollib import *
11 11
12 12 tag = commands.getoutput('git describe')
13 13 base_name = 'ipython-%s' % tag
14 14 tar_name = '%s.tgz' % base_name
15 15
16 16 # git archive is weird: Even if I give it a specific path, it still won't
17 17 # archive the whole tree. It seems the only way to get the whole tree is to cd
18 18 # to the top of the tree. There are long threads (since 2007) on the git list
19 19 # about this and it still doesn't work in a sensible way...
20 20
21 21 start_dir = os.getcwd()
22 22 cd('..')
23 23 git_tpl = 'git archive --format=tar --prefix={0}/ HEAD | gzip > {1}'
24 c(git_tpl.format(base_name, tar_name))
25 c('mv {0} tools/'.format(tar_name))
24 sh(git_tpl.format(base_name, tar_name))
25 sh('mv {0} tools/'.format(tar_name))
@@ -1,55 +1,48 b''
1 1 """Various utilities common to IPython release and maintenance tools.
2 2 """
3 3 # Library imports
4 4 import os
5 5 import sys
6 6
7 7 from distutils.dir_util import remove_tree
8 8
9 9 # Useful shorthands
10 10 pjoin = os.path.join
11 11 cd = os.chdir
12 12
13 13 # Utility functions
14 def c(cmd):
15 """Run system command, raise SystemExit if it returns an error."""
14 def sh(cmd):
15 """Run system command in shell, raise SystemExit if it returns an error."""
16 16 print "$",cmd
17 17 stat = os.system(cmd)
18 18 #stat = 0 # Uncomment this and comment previous to run in debug mode
19 19 if stat:
20 20 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
21 21
22 # Backwards compatibility
23 c = sh
22 24
23 25 def get_ipdir():
24 26 """Get IPython directory from command line, or assume it's the one above."""
25 27
26 28 # Initialize arguments and check location
27 29 try:
28 30 ipdir = sys.argv[1]
29 31 except IndexError:
30 32 ipdir = '..'
31 33
32 34 ipdir = os.path.abspath(ipdir)
33 35
34 36 cd(ipdir)
35 37 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
36 38 raise SystemExit('Invalid ipython directory: %s' % ipdir)
37 39 return ipdir
38 40
39 41
40 42 def compile_tree():
41 43 """Compile all Python files below current directory."""
42 vstr = '.'.join(map(str,sys.version_info[:2]))
43 stat = os.system('python %s/lib/python%s/compileall.py .' %
44 (sys.prefix,vstr))
44 stat = os.system('python -m compileall .')
45 45 if stat:
46 46 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
47 47 msg += 'See messages above for the actual file that produced it.\n'
48 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
1 NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now