##// END OF EJS Templates
Put windows build cmds in a reusable location so we can upload .exes to PyPI.
Fernando Perez -
Show More
@@ -1,49 +1,39 b''
1 1 #!/usr/bin/env python
2 2 """IPython release build script.
3 3 """
4 4
5 5 import os
6 6
7 7 from toollib import *
8 8
9 9 # Get main ipython dir, this will raise if it doesn't pass some checks
10 10 ipdir = get_ipdir()
11 11 cd(ipdir)
12 12
13 13 # Load release info
14 14 execfile(pjoin('IPython', 'core', 'release.py'))
15 15
16 16 # Check that everything compiles
17 17 compile_tree()
18 18
19 19 # Cleanup
20 20 for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'),
21 21 pjoin('docs', 'source', 'api', 'generated')]:
22 22 if os.path.isdir(d):
23 23 remove_tree(d)
24 24
25 25 # Build source and binary distros
26 26 sh('./setup.py sdist --formats=gztar,zip')
27 27
28 28 # Build eggs
29 29 sh('python ./setupegg.py bdist_egg')
30 30
31 # Call the windows build separately, so that the extra Windows scripts don't
32 # get pulled into Unix builds (setup.py has code which checks for
33 # bdist_wininst). Note that the install scripts args are added to the main
34 # distutils call in setup.py, so they don't need to be passed here.
35 sh("python setup.py bdist_wininst")
36
37 # The Windows 64-bit installer can't be built by a Linux/Mac Python because ofa
38 # bug in distutils: http://bugs.python.org/issue6792.
39 # So we have to build it with a wine-installed native Windows Python...
40 sh("%s/.wine/dosdevices/c\:/Python27/python.exe setup.py build "
41 "--plat-name=win-amd64 bdist_wininst "
42 "--install-script=ipython_win_post_install.py" % os.environ['HOME'])
31 # Run windows builds
32 map(sh, win_builds)
43 33
44 34 # Change name so retarded Vista runs the installer correctly
45 35 sh("rename 's/linux-i686/win32/' dist/*.exe")
46 36 sh("rename 's/linux-x86_64/win32/' dist/*.exe")
47 37 sh("rename 's/amd64/amd64-setup/' dist/*.exe")
48 38 # exe files aren't really executable under *nix.
49 39 sh("chmod -x dist/*.exe")
@@ -1,64 +1,66 b''
1 1 #!/usr/bin/env python
2 2 """IPython release script.
3 3
4 4 This should ONLY be run at real release time.
5 5 """
6 6 from __future__ import print_function
7 7
8 8 from toollib import *
9 9
10 10 # Get main ipython dir, this will raise if it doesn't pass some checks
11 11 ipdir = get_ipdir()
12 12 tooldir = pjoin(ipdir, 'tools')
13 13 distdir = pjoin(ipdir, 'dist')
14 14
15 15 # Where I keep static backups of each release
16 16 ipbackupdir = os.path.expanduser('~/ipython/backup')
17 17
18 18 # Start in main IPython dir
19 19 cd(ipdir)
20 20
21 21 # Load release info
22 22 execfile(pjoin('IPython','core','release.py'))
23 23
24 24 # Build site addresses for file uploads
25 25 release_site = '%s/release/%s' % (archive, version)
26 26 backup_site = '%s/backup/' % archive
27 27
28 28 # Start actual release process
29 29 print()
30 30 print('Releasing IPython')
31 31 print('=================')
32 32 print()
33 33 print('Version:', version)
34 34 print()
35 35 print('Source IPython directory:', ipdir)
36 36 print()
37 37
38 38 # Perform local backup, go to tools dir to run it.
39 39 cd(tooldir)
40 40 sh('./make_tarball.py')
41 41 sh('mv ipython-*.tgz %s' % ipbackupdir)
42 42
43 43 # Build release files
44 44 sh('./build_release %s' % ipdir)
45 45
46 46 # Register with the Python Package Index (PyPI)
47 47 print( 'Registering with PyPI...')
48 48 cd(ipdir)
49 49 sh('./setup.py register')
50 50
51 51 # Upload all files
52 52 sh('./setup.py sdist --formats=gztar,zip upload')
53 for wb in win_builds:
54 sh(wb + ' upload')
53 55 cd(distdir)
54 56 print( 'Uploading distribution files...')
55 57
56 58 # Make target dir if it doesn't exist
57 59 sh('ssh %s "mkdir -p %s/release/%s" ' % (archive_user, archive_dir, version))
58 60 sh('scp * %s' % release_site)
59 61
60 62 print( 'Uploading backup files...')
61 63 cd(ipbackupdir)
62 64 sh('scp `ls -1tr *tgz | tail -1` %s' % backup_site)
63 65
64 66 print('Done!')
@@ -1,57 +1,72 b''
1 1 """Various utilities common to IPython release and maintenance tools.
2 2 """
3 3 from __future__ import print_function
4 4
5 5 # Library imports
6 6 import os
7 7 import sys
8 8
9 9 from distutils.dir_util import remove_tree
10 10
11 11 # Useful shorthands
12 12 pjoin = os.path.join
13 13 cd = os.chdir
14 14
15 15 # Constants
16 16
17 17 # SSH root address of the archive site
18 18 archive_user = 'ipython@archive.ipython.org'
19 19 archive_dir = 'archive.ipython.org'
20 20 archive = '%s:%s' % (archive_user, archive_dir)
21 21
22 # Commands for Windows builds.
23 # We do them separately, so that the extra Windows scripts don't get pulled
24 # into Unix builds (setup.py has code which checks for bdist_wininst). Note
25 # that the install scripts args are added to the main distutils call in
26 # setup.py, so they don't need to be passed here.
27 #
28 # The Windows 64-bit installer can't be built by a Linux/Mac Python because ofa
29 # bug in distutils: http://bugs.python.org/issue6792.
30 # So we have to build it with a wine-installed native Windows Python...
31 win_builds = ["python setup.py bdist_wininst",
32 r"%s/.wine/dosdevices/c\:/Python27/python.exe setup.py build "
33 "--plat-name=win-amd64 bdist_wininst "
34 "--install-script=ipython_win_post_install.py" %
35 os.environ['HOME'] ]
36
22 37 # Utility functions
23 38 def sh(cmd):
24 39 """Run system command in shell, raise SystemExit if it returns an error."""
25 40 print("$", cmd)
26 41 stat = os.system(cmd)
27 42 #stat = 0 # Uncomment this and comment previous to run in debug mode
28 43 if stat:
29 44 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
30 45
31 46 # Backwards compatibility
32 47 c = sh
33 48
34 49 def get_ipdir():
35 50 """Get IPython directory from command line, or assume it's the one above."""
36 51
37 52 # Initialize arguments and check location
38 53 try:
39 54 ipdir = sys.argv[1]
40 55 except IndexError:
41 56 ipdir = '..'
42 57
43 58 ipdir = os.path.abspath(ipdir)
44 59
45 60 cd(ipdir)
46 61 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
47 62 raise SystemExit('Invalid ipython directory: %s' % ipdir)
48 63 return ipdir
49 64
50 65
51 66 def compile_tree():
52 67 """Compile all Python files below current directory."""
53 68 stat = os.system('python -m compileall .')
54 69 if stat:
55 70 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
56 71 msg += 'See messages above for the actual file that produced it.\n'
57 72 raise SystemExit(msg)
General Comments 0
You need to be logged in to leave comments. Login now