##// END OF EJS Templates
Remove pycompile check for building packages
Thomas Kluyver -
Show More
@@ -1,32 +1,29 b''
1 1 #!/usr/bin/env python
2 2 """IPython release build script.
3 3 """
4 4 import os
5 5 from shutil import rmtree
6 6
7 from toollib import sh, pjoin, get_ipdir, cd, compile_tree, execfile, sdists, buildwheels
7 from toollib import sh, pjoin, get_ipdir, cd, execfile, sdists, buildwheels
8 8
9 9 def build_release():
10 10
11 11 # Get main ipython dir, this will raise if it doesn't pass some checks
12 12 ipdir = get_ipdir()
13 13 cd(ipdir)
14 14
15 15 # Load release info
16 16 execfile(pjoin('IPython', 'core', 'release.py'), globals())
17 17
18 # Check that everything compiles
19 compile_tree('*')
20
21 18 # Cleanup
22 19 for d in ['build', 'dist', pjoin('docs', 'build'), pjoin('docs', 'dist'),
23 20 pjoin('docs', 'source', 'api', 'generated')]:
24 21 if os.path.isdir(d):
25 22 rmtree(d)
26 23
27 24 # Build source and binary distros
28 25 sh(sdists)
29 26 buildwheels()
30 27
31 28 if __name__ == '__main__':
32 29 build_release()
@@ -1,66 +1,57 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
8 8 # Useful shorthands
9 9 pjoin = os.path.join
10 10 cd = os.chdir
11 11
12 12 # Constants
13 13
14 14 # SSH root address of the archive site
15 15 archive_user = 'ipython@archive.ipython.org'
16 16 archive_dir = 'archive.ipython.org'
17 17 archive = '%s:%s' % (archive_user, archive_dir)
18 18
19 19 # Build commands
20 20 # Source dists
21 21 sdists = './setup.py sdist --formats=gztar,zip'
22 22 # Binary dists
23 23 def buildwheels():
24 24 for py in ('2', '3'):
25 25 sh('python%s setupegg.py bdist_wheel' % py)
26 26
27 27 # Utility functions
28 28 def sh(cmd):
29 29 """Run system command in shell, raise SystemExit if it returns an error."""
30 30 print("$", cmd)
31 31 stat = os.system(cmd)
32 32 #stat = 0 # Uncomment this and comment previous to run in debug mode
33 33 if stat:
34 34 raise SystemExit("Command %s failed with code: %s" % (cmd, stat))
35 35
36 36 # Backwards compatibility
37 37 c = sh
38 38
39 39 def get_ipdir():
40 40 """Get IPython directory from command line, or assume it's the one above."""
41 41
42 42 # Initialize arguments and check location
43 43 ipdir = pjoin(os.path.dirname(__file__), os.pardir)
44 44
45 45 ipdir = os.path.abspath(ipdir)
46 46
47 47 cd(ipdir)
48 48 if not os.path.isdir('IPython') and os.path.isfile('setup.py'):
49 49 raise SystemExit('Invalid ipython directory: %s' % ipdir)
50 50 return ipdir
51 51
52
53 def compile_tree(folder='.'):
54 """Compile all Python files below current directory."""
55 stat = os.system('python -m compileall {}'.format(folder))
56 if stat:
57 msg = '*** ERROR: Some Python files in tree do NOT compile! ***\n'
58 msg += 'See messages above for the actual file that produced it.\n'
59 raise SystemExit(msg)
60
61 52 try:
62 53 execfile = execfile
63 54 except NameError:
64 55 def execfile(fname, globs, locs=None):
65 56 locs = locs or globs
66 57 exec(compile(open(fname).read(), fname, "exec"), globs, locs)
General Comments 0
You need to be logged in to leave comments. Login now