##// END OF EJS Templates
Temporary fix to get setup.py to not crash. Full fix on the way.
Brian E Granger -
Show More
@@ -1,226 +1,228 b''
1 1 # encoding: utf-8
2 2
3 3 """
4 4 This module defines the things that are used in setup.py for building IPython
5 5
6 6 This includes:
7 7
8 8 * The basic arguments to setup
9 9 * Functions for finding things like packages, package data, etc.
10 10 * A function for checking dependencies.
11 11 """
12 12
13 13 __docformat__ = "restructuredtext en"
14 14
15 15 #-------------------------------------------------------------------------------
16 16 # Copyright (C) 2008 The IPython Development Team
17 17 #
18 18 # Distributed under the terms of the BSD License. The full license is in
19 19 # the file COPYING, distributed as part of this software.
20 20 #-------------------------------------------------------------------------------
21 21
22 22 #-------------------------------------------------------------------------------
23 23 # Imports
24 24 #-------------------------------------------------------------------------------
25 25
26 26 import os, sys
27 27
28 28 from glob import glob
29 29
30 30 from setupext import install_data_ext
31 31
32 32 #-------------------------------------------------------------------------------
33 33 # Useful globals and utility functions
34 34 #-------------------------------------------------------------------------------
35 35
36 36 # A few handy globals
37 37 isfile = os.path.isfile
38 38 pjoin = os.path.join
39 39
40 40 def oscmd(s):
41 41 print ">", s
42 42 os.system(s)
43 43
44 44 # A little utility we'll need below, since glob() does NOT allow you to do
45 45 # exclusion on multiple endings!
46 46 def file_doesnt_endwith(test,endings):
47 47 """Return true if test is a file and its name does NOT end with any
48 48 of the strings listed in endings."""
49 49 if not isfile(test):
50 50 return False
51 51 for e in endings:
52 52 if test.endswith(e):
53 53 return False
54 54 return True
55 55
56 56 #---------------------------------------------------------------------------
57 57 # Basic project information
58 58 #---------------------------------------------------------------------------
59 59
60 60 # Release.py contains version, authors, license, url, keywords, etc.
61 61 execfile(pjoin('IPython','Release.py'))
62 62
63 63 # Create a dict with the basic information
64 64 # This dict is eventually passed to setup after additional keys are added.
65 65 setup_args = dict(
66 66 name = name,
67 67 version = version,
68 68 description = description,
69 69 long_description = long_description,
70 70 author = author,
71 71 author_email = author_email,
72 72 url = url,
73 73 download_url = download_url,
74 74 license = license,
75 75 platforms = platforms,
76 76 keywords = keywords,
77 77 cmdclass = {'install_data': install_data_ext},
78 78 )
79 79
80 80
81 81 #---------------------------------------------------------------------------
82 82 # Find packages
83 83 #---------------------------------------------------------------------------
84 84
85 85 def add_package(packages, pname, config=False, tests=False, scripts=False, others=None):
86 86 """
87 87 Add a package to the list of packages, including certain subpackages.
88 88 """
89 89 packages.append('.'.join(['IPython',pname]))
90 90 if config:
91 91 packages.append('.'.join(['IPython',pname,'config']))
92 92 if tests:
93 93 packages.append('.'.join(['IPython',pname,'tests']))
94 94 if scripts:
95 95 packages.append('.'.join(['IPython',pname,'scripts']))
96 96 if others is not None:
97 97 for o in others:
98 98 packages.append('.'.join(['IPython',pname,o]))
99 99
100 100 def find_packages():
101 101 """
102 102 Find all of IPython's packages.
103 103 """
104 104 packages = ['IPython']
105 105 add_package(packages, 'config', tests=True)
106 106 add_package(packages , 'Extensions')
107 107 add_package(packages, 'external')
108 108 add_package(packages, 'gui')
109 109 add_package(packages, 'gui.wx')
110 110 add_package(packages, 'kernel', config=True, tests=True, scripts=True)
111 111 add_package(packages, 'kernel.core', config=True, tests=True)
112 112 add_package(packages, 'testing', tests=True)
113 113 add_package(packages, 'tools', tests=True)
114 114 add_package(packages, 'UserConfig')
115 115 return packages
116 116
117 117 #---------------------------------------------------------------------------
118 118 # Find package data
119 119 #---------------------------------------------------------------------------
120 120
121 121 def find_package_data():
122 122 """
123 123 Find IPython's package_data.
124 124 """
125 125 # This is not enough for these things to appear in an sdist.
126 126 # We need to muck with the MANIFEST to get this to work
127 127 package_data = {'IPython.UserConfig' : ['*'] }
128 128 return package_data
129 129
130 130
131 131 #---------------------------------------------------------------------------
132 132 # Find data files
133 133 #---------------------------------------------------------------------------
134 134
135 135 def find_data_files():
136 136 """
137 137 Find IPython's data_files.
138 138 """
139 139
140 140 # I can't find how to make distutils create a nested dir. structure, so
141 141 # in the meantime do it manually. Butt ugly.
142 142 # Note that http://www.redbrick.dcu.ie/~noel/distutils.html, ex. 2/3, contain
143 143 # information on how to do this more cleanly once python 2.4 can be assumed.
144 144 # Thanks to Noel for the tip.
145 145 docdirbase = 'share/doc/ipython'
146 146 manpagebase = 'share/man/man1'
147 147
148 148 # We only need to exclude from this things NOT already excluded in the
149 149 # MANIFEST.in file.
150 150 exclude = ('.sh','.1.gz')
151 151 # We need to figure out how we want to package all of our rst docs?
152 152 # docfiles = filter(lambda f:file_doesnt_endwith(f,exclude),glob('docs/*'))
153 153 examfiles = filter(isfile, glob('docs/examples/core/*.py'))
154 154 examfiles.append(filter(isfile, glob('docs/examples/kernel/*.py')))
155 155 manpages = filter(isfile, glob('docs/man/*.1.gz'))
156 156 igridhelpfiles = filter(isfile, glob('IPython/Extensions/igrid_help.*'))
157 157
158 158 data_files = [#('data', docdirbase, docfiles),
159 159 ('data', pjoin(docdirbase, 'examples'),examfiles),
160 160 ('data', manpagebase, manpages),
161 161 ('data',pjoin(docdirbase, 'extensions'),igridhelpfiles),
162 162 ]
163 return data_files
163 # import pprint
164 # pprint.pprint(data_files)
165 return []
164 166
165 167 #---------------------------------------------------------------------------
166 168 # Find scripts
167 169 #---------------------------------------------------------------------------
168 170
169 171 def find_scripts():
170 172 """
171 173 Find IPython's scripts.
172 174 """
173 175 scripts = []
174 176 scripts.append('IPython/kernel/scripts/ipengine')
175 177 scripts.append('IPython/kernel/scripts/ipcontroller')
176 178 scripts.append('IPython/kernel/scripts/ipcluster')
177 179 scripts.append('scripts/ipython')
178 180 scripts.append('scripts/pycolor')
179 181 scripts.append('scripts/irunner')
180 182
181 183 # Script to be run by the windows binary installer after the default setup
182 184 # routine, to add shortcuts and similar windows-only things. Windows
183 185 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
184 186 # doesn't find them.
185 187 if 'bdist_wininst' in sys.argv:
186 188 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
187 189 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
188 190 sys.exit(1)
189 191 scripts.append('scripts/ipython_win_post_install.py')
190 192
191 193 return scripts
192 194
193 195 #---------------------------------------------------------------------------
194 196 # Find scripts
195 197 #---------------------------------------------------------------------------
196 198
197 199 def check_for_dependencies():
198 200 """Check for IPython's dependencies.
199 201
200 202 This function should NOT be called if running under setuptools!
201 203 """
202 204 from setupext.setupext import (
203 205 print_line, print_raw, print_status, print_message,
204 206 check_for_zopeinterface, check_for_twisted,
205 207 check_for_foolscap, check_for_pyopenssl,
206 208 check_for_sphinx, check_for_pygments,
207 209 check_for_nose, check_for_pexpect
208 210 )
209 211 print_line()
210 212 print_raw("BUILDING IPYTHON")
211 213 print_status('python', sys.version)
212 214 print_status('platform', sys.platform)
213 215 if sys.platform == 'win32':
214 216 print_status('Windows version', sys.getwindowsversion())
215 217
216 218 print_raw("")
217 219 print_raw("OPTIONAL DEPENDENCIES")
218 220
219 221 check_for_zopeinterface()
220 222 check_for_twisted()
221 223 check_for_foolscap()
222 224 check_for_pyopenssl()
223 225 check_for_sphinx()
224 226 check_for_pygments()
225 227 check_for_nose()
226 228 check_for_pexpect() No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now