##// END OF EJS Templates
Rename entry point for Qt console to ipython-qtconsole....
Fernando Perez -
Show More
1 NO CONTENT: file renamed from IPython/frontend/qt/console/scripts/ipythonqt to IPython/scripts/ipython-qtconsole
NO CONTENT: file renamed from IPython/frontend/qt/console/scripts/ipythonqt to IPython/scripts/ipython-qtconsole
@@ -1,316 +1,314 b''
1 # encoding: utf-8
1 # encoding: utf-8
2
2
3 """
3 """
4 This module defines the things that are used in setup.py for building IPython
4 This module defines the things that are used in setup.py for building IPython
5
5
6 This includes:
6 This includes:
7
7
8 * The basic arguments to setup
8 * The basic arguments to setup
9 * Functions for finding things like packages, package data, etc.
9 * Functions for finding things like packages, package data, etc.
10 * A function for checking dependencies.
10 * A function for checking dependencies.
11 """
11 """
12
12
13 __docformat__ = "restructuredtext en"
13 __docformat__ = "restructuredtext en"
14
14
15 #-------------------------------------------------------------------------------
15 #-------------------------------------------------------------------------------
16 # Copyright (C) 2008 The IPython Development Team
16 # Copyright (C) 2008 The IPython Development Team
17 #
17 #
18 # Distributed under the terms of the BSD License. The full license is in
18 # Distributed under the terms of the BSD License. The full license is in
19 # the file COPYING, distributed as part of this software.
19 # the file COPYING, distributed as part of this software.
20 #-------------------------------------------------------------------------------
20 #-------------------------------------------------------------------------------
21
21
22 #-------------------------------------------------------------------------------
22 #-------------------------------------------------------------------------------
23 # Imports
23 # Imports
24 #-------------------------------------------------------------------------------
24 #-------------------------------------------------------------------------------
25
25
26 import os, sys
26 import os, sys
27
27
28 from glob import glob
28 from glob import glob
29
29
30 from setupext import install_data_ext
30 from setupext import install_data_ext
31
31
32 #-------------------------------------------------------------------------------
32 #-------------------------------------------------------------------------------
33 # Useful globals and utility functions
33 # Useful globals and utility functions
34 #-------------------------------------------------------------------------------
34 #-------------------------------------------------------------------------------
35
35
36 # A few handy globals
36 # A few handy globals
37 isfile = os.path.isfile
37 isfile = os.path.isfile
38 pjoin = os.path.join
38 pjoin = os.path.join
39
39
40 def oscmd(s):
40 def oscmd(s):
41 print ">", s
41 print ">", s
42 os.system(s)
42 os.system(s)
43
43
44 # A little utility we'll need below, since glob() does NOT allow you to do
44 # A little utility we'll need below, since glob() does NOT allow you to do
45 # exclusion on multiple endings!
45 # exclusion on multiple endings!
46 def file_doesnt_endwith(test,endings):
46 def file_doesnt_endwith(test,endings):
47 """Return true if test is a file and its name does NOT end with any
47 """Return true if test is a file and its name does NOT end with any
48 of the strings listed in endings."""
48 of the strings listed in endings."""
49 if not isfile(test):
49 if not isfile(test):
50 return False
50 return False
51 for e in endings:
51 for e in endings:
52 if test.endswith(e):
52 if test.endswith(e):
53 return False
53 return False
54 return True
54 return True
55
55
56 #---------------------------------------------------------------------------
56 #---------------------------------------------------------------------------
57 # Basic project information
57 # Basic project information
58 #---------------------------------------------------------------------------
58 #---------------------------------------------------------------------------
59
59
60 # release.py contains version, authors, license, url, keywords, etc.
60 # release.py contains version, authors, license, url, keywords, etc.
61 execfile(pjoin('IPython','core','release.py'))
61 execfile(pjoin('IPython','core','release.py'))
62
62
63 # Create a dict with the basic information
63 # Create a dict with the basic information
64 # This dict is eventually passed to setup after additional keys are added.
64 # This dict is eventually passed to setup after additional keys are added.
65 setup_args = dict(
65 setup_args = dict(
66 name = name,
66 name = name,
67 version = version,
67 version = version,
68 description = description,
68 description = description,
69 long_description = long_description,
69 long_description = long_description,
70 author = author,
70 author = author,
71 author_email = author_email,
71 author_email = author_email,
72 url = url,
72 url = url,
73 download_url = download_url,
73 download_url = download_url,
74 license = license,
74 license = license,
75 platforms = platforms,
75 platforms = platforms,
76 keywords = keywords,
76 keywords = keywords,
77 cmdclass = {'install_data': install_data_ext},
77 cmdclass = {'install_data': install_data_ext},
78 )
78 )
79
79
80
80
81 #---------------------------------------------------------------------------
81 #---------------------------------------------------------------------------
82 # Find packages
82 # Find packages
83 #---------------------------------------------------------------------------
83 #---------------------------------------------------------------------------
84
84
85 def add_package(packages,pname,config=False,tests=False,scripts=False,
85 def add_package(packages,pname,config=False,tests=False,scripts=False,
86 others=None):
86 others=None):
87 """
87 """
88 Add a package to the list of packages, including certain subpackages.
88 Add a package to the list of packages, including certain subpackages.
89 """
89 """
90 packages.append('.'.join(['IPython',pname]))
90 packages.append('.'.join(['IPython',pname]))
91 if config:
91 if config:
92 packages.append('.'.join(['IPython',pname,'config']))
92 packages.append('.'.join(['IPython',pname,'config']))
93 if tests:
93 if tests:
94 packages.append('.'.join(['IPython',pname,'tests']))
94 packages.append('.'.join(['IPython',pname,'tests']))
95 if scripts:
95 if scripts:
96 packages.append('.'.join(['IPython',pname,'scripts']))
96 packages.append('.'.join(['IPython',pname,'scripts']))
97 if others is not None:
97 if others is not None:
98 for o in others:
98 for o in others:
99 packages.append('.'.join(['IPython',pname,o]))
99 packages.append('.'.join(['IPython',pname,o]))
100
100
101 def find_packages():
101 def find_packages():
102 """
102 """
103 Find all of IPython's packages.
103 Find all of IPython's packages.
104 """
104 """
105 packages = ['IPython']
105 packages = ['IPython']
106 add_package(packages, 'config', tests=True, others=['default','profile'])
106 add_package(packages, 'config', tests=True, others=['default','profile'])
107 add_package(packages, 'core', tests=True)
107 add_package(packages, 'core', tests=True)
108 add_package(packages, 'deathrow', tests=True)
108 add_package(packages, 'deathrow', tests=True)
109 add_package(packages, 'extensions')
109 add_package(packages, 'extensions')
110 add_package(packages, 'external')
110 add_package(packages, 'external')
111 add_package(packages, 'frontend')
111 add_package(packages, 'frontend')
112 add_package(packages, 'frontend.qt')
112 add_package(packages, 'frontend.qt')
113 add_package(packages, 'frontend.qt.console', tests=True, scripts=True)
113 add_package(packages, 'frontend.qt.console', tests=True)
114 add_package(packages, 'frontend.terminal', tests=True, scripts=True)
114 add_package(packages, 'frontend.terminal', tests=True)
115 add_package(packages, 'kernel', config=False, tests=True, scripts=True)
115 add_package(packages, 'kernel', config=False, tests=True, scripts=True)
116 add_package(packages, 'kernel.core', config=False, tests=True)
116 add_package(packages, 'kernel.core', config=False, tests=True)
117 add_package(packages, 'lib', tests=True)
117 add_package(packages, 'lib', tests=True)
118 add_package(packages, 'quarantine', tests=True)
118 add_package(packages, 'quarantine', tests=True)
119 add_package(packages, 'scripts')
119 add_package(packages, 'scripts')
120 add_package(packages, 'testing', tests=True)
120 add_package(packages, 'testing', tests=True)
121 add_package(packages, 'testing.plugin', tests=False)
121 add_package(packages, 'testing.plugin', tests=False)
122 add_package(packages, 'utils', tests=True)
122 add_package(packages, 'utils', tests=True)
123 add_package(packages, 'zmq')
123 add_package(packages, 'zmq')
124 add_package(packages, 'zmq.pylab')
124 add_package(packages, 'zmq.pylab')
125 return packages
125 return packages
126
126
127 #---------------------------------------------------------------------------
127 #---------------------------------------------------------------------------
128 # Find package data
128 # Find package data
129 #---------------------------------------------------------------------------
129 #---------------------------------------------------------------------------
130
130
131 def find_package_data():
131 def find_package_data():
132 """
132 """
133 Find IPython's package_data.
133 Find IPython's package_data.
134 """
134 """
135 # This is not enough for these things to appear in an sdist.
135 # This is not enough for these things to appear in an sdist.
136 # We need to muck with the MANIFEST to get this to work
136 # We need to muck with the MANIFEST to get this to work
137 package_data = {
137 package_data = {
138 'IPython.config.userconfig' : ['*'],
138 'IPython.config.userconfig' : ['*'],
139 'IPython.testing' : ['*.txt']
139 'IPython.testing' : ['*.txt']
140 }
140 }
141 return package_data
141 return package_data
142
142
143
143
144 #---------------------------------------------------------------------------
144 #---------------------------------------------------------------------------
145 # Find data files
145 # Find data files
146 #---------------------------------------------------------------------------
146 #---------------------------------------------------------------------------
147
147
148 def make_dir_struct(tag,base,out_base):
148 def make_dir_struct(tag,base,out_base):
149 """Make the directory structure of all files below a starting dir.
149 """Make the directory structure of all files below a starting dir.
150
150
151 This is just a convenience routine to help build a nested directory
151 This is just a convenience routine to help build a nested directory
152 hierarchy because distutils is too stupid to do this by itself.
152 hierarchy because distutils is too stupid to do this by itself.
153
153
154 XXX - this needs a proper docstring!
154 XXX - this needs a proper docstring!
155 """
155 """
156
156
157 # we'll use these a lot below
157 # we'll use these a lot below
158 lbase = len(base)
158 lbase = len(base)
159 pathsep = os.path.sep
159 pathsep = os.path.sep
160 lpathsep = len(pathsep)
160 lpathsep = len(pathsep)
161
161
162 out = []
162 out = []
163 for (dirpath,dirnames,filenames) in os.walk(base):
163 for (dirpath,dirnames,filenames) in os.walk(base):
164 # we need to strip out the dirpath from the base to map it to the
164 # we need to strip out the dirpath from the base to map it to the
165 # output (installation) path. This requires possibly stripping the
165 # output (installation) path. This requires possibly stripping the
166 # path separator, because otherwise pjoin will not work correctly
166 # path separator, because otherwise pjoin will not work correctly
167 # (pjoin('foo/','/bar') returns '/bar').
167 # (pjoin('foo/','/bar') returns '/bar').
168
168
169 dp_eff = dirpath[lbase:]
169 dp_eff = dirpath[lbase:]
170 if dp_eff.startswith(pathsep):
170 if dp_eff.startswith(pathsep):
171 dp_eff = dp_eff[lpathsep:]
171 dp_eff = dp_eff[lpathsep:]
172 # The output path must be anchored at the out_base marker
172 # The output path must be anchored at the out_base marker
173 out_path = pjoin(out_base,dp_eff)
173 out_path = pjoin(out_base,dp_eff)
174 # Now we can generate the final filenames. Since os.walk only produces
174 # Now we can generate the final filenames. Since os.walk only produces
175 # filenames, we must join back with the dirpath to get full valid file
175 # filenames, we must join back with the dirpath to get full valid file
176 # paths:
176 # paths:
177 pfiles = [pjoin(dirpath,f) for f in filenames]
177 pfiles = [pjoin(dirpath,f) for f in filenames]
178 # Finally, generate the entry we need, which is a triple of (tag,output
178 # Finally, generate the entry we need, which is a triple of (tag,output
179 # path, files) for use as a data_files parameter in install_data.
179 # path, files) for use as a data_files parameter in install_data.
180 out.append((tag,out_path,pfiles))
180 out.append((tag,out_path,pfiles))
181
181
182 return out
182 return out
183
183
184
184
185 def find_data_files():
185 def find_data_files():
186 """
186 """
187 Find IPython's data_files.
187 Find IPython's data_files.
188
188
189 Most of these are docs.
189 Most of these are docs.
190 """
190 """
191
191
192 docdirbase = pjoin('share', 'doc', 'ipython')
192 docdirbase = pjoin('share', 'doc', 'ipython')
193 manpagebase = pjoin('share', 'man', 'man1')
193 manpagebase = pjoin('share', 'man', 'man1')
194
194
195 # Simple file lists can be made by hand
195 # Simple file lists can be made by hand
196 manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz')))
196 manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz')))
197 igridhelpfiles = filter(isfile, glob(pjoin('IPython','extensions','igrid_help.*')))
197 igridhelpfiles = filter(isfile, glob(pjoin('IPython','extensions','igrid_help.*')))
198
198
199 # For nested structures, use the utility above
199 # For nested structures, use the utility above
200 example_files = make_dir_struct(
200 example_files = make_dir_struct(
201 'data',
201 'data',
202 pjoin('docs','examples'),
202 pjoin('docs','examples'),
203 pjoin(docdirbase,'examples')
203 pjoin(docdirbase,'examples')
204 )
204 )
205 manual_files = make_dir_struct(
205 manual_files = make_dir_struct(
206 'data',
206 'data',
207 pjoin('docs','dist'),
207 pjoin('docs','dist'),
208 pjoin(docdirbase,'manual')
208 pjoin(docdirbase,'manual')
209 )
209 )
210
210
211 # And assemble the entire output list
211 # And assemble the entire output list
212 data_files = [ ('data',manpagebase, manpages),
212 data_files = [ ('data',manpagebase, manpages),
213 ('data',pjoin(docdirbase,'extensions'),igridhelpfiles),
213 ('data',pjoin(docdirbase,'extensions'),igridhelpfiles),
214 ] + manual_files + example_files
214 ] + manual_files + example_files
215
215
216 ## import pprint # dbg
216 ## import pprint # dbg
217 ## print '*'*80
217 ## print '*'*80
218 ## print 'data files'
218 ## print 'data files'
219 ## pprint.pprint(data_files)
219 ## pprint.pprint(data_files)
220 ## print '*'*80
220 ## print '*'*80
221
221
222 return data_files
222 return data_files
223
223
224
224
225 def make_man_update_target(manpage):
225 def make_man_update_target(manpage):
226 """Return a target_update-compliant tuple for the given manpage.
226 """Return a target_update-compliant tuple for the given manpage.
227
227
228 Parameters
228 Parameters
229 ----------
229 ----------
230 manpage : string
230 manpage : string
231 Name of the manpage, must include the section number (trailing number).
231 Name of the manpage, must include the section number (trailing number).
232
232
233 Example
233 Example
234 -------
234 -------
235
235
236 >>> make_man_update_target('ipython.1') #doctest: +NORMALIZE_WHITESPACE
236 >>> make_man_update_target('ipython.1') #doctest: +NORMALIZE_WHITESPACE
237 ('docs/man/ipython.1.gz',
237 ('docs/man/ipython.1.gz',
238 ['docs/man/ipython.1'],
238 ['docs/man/ipython.1'],
239 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz')
239 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz')
240 """
240 """
241 man_dir = pjoin('docs', 'man')
241 man_dir = pjoin('docs', 'man')
242 manpage_gz = manpage + '.gz'
242 manpage_gz = manpage + '.gz'
243 manpath = pjoin(man_dir, manpage)
243 manpath = pjoin(man_dir, manpage)
244 manpath_gz = pjoin(man_dir, manpage_gz)
244 manpath_gz = pjoin(man_dir, manpage_gz)
245 gz_cmd = ( "cd %(man_dir)s && gzip -9c %(manpage)s > %(manpage_gz)s" %
245 gz_cmd = ( "cd %(man_dir)s && gzip -9c %(manpage)s > %(manpage_gz)s" %
246 locals() )
246 locals() )
247 return (manpath_gz, [manpath], gz_cmd)
247 return (manpath_gz, [manpath], gz_cmd)
248
248
249 #---------------------------------------------------------------------------
249 #---------------------------------------------------------------------------
250 # Find scripts
250 # Find scripts
251 #---------------------------------------------------------------------------
251 #---------------------------------------------------------------------------
252
252
253 def find_scripts():
253 def find_scripts():
254 """
254 """
255 Find IPython's scripts.
255 Find IPython's scripts.
256 """
256 """
257 kernel_scripts = pjoin('IPython','kernel','scripts')
257 kernel_scripts = pjoin('IPython','kernel','scripts')
258 main_scripts = pjoin('IPython','scripts')
258 main_scripts = pjoin('IPython','scripts')
259 frontend_terminal_scripts = pjoin('IPython','frontend','terminal','scripts')
260 frontend_qt_scripts = pjoin('IPython','frontend','qt','console','scripts')
261 scripts = [pjoin(kernel_scripts, 'ipengine'),
259 scripts = [pjoin(kernel_scripts, 'ipengine'),
262 pjoin(kernel_scripts, 'ipcontroller'),
260 pjoin(kernel_scripts, 'ipcontroller'),
263 pjoin(kernel_scripts, 'ipcluster'),
261 pjoin(kernel_scripts, 'ipcluster'),
264 pjoin(frontend_terminal_scripts, 'ipython'),
262 pjoin(main_scripts, 'ipython'),
265 pjoin(frontend_qt_scripts, 'ipythonqt'),
263 pjoin(main_scripts, 'ipython-qtconsole'),
266 pjoin(main_scripts, 'pycolor'),
264 pjoin(main_scripts, 'pycolor'),
267 pjoin(main_scripts, 'irunner'),
265 pjoin(main_scripts, 'irunner'),
268 pjoin(main_scripts, 'iptest')
266 pjoin(main_scripts, 'iptest')
269 ]
267 ]
270
268
271 # Script to be run by the windows binary installer after the default setup
269 # Script to be run by the windows binary installer after the default setup
272 # routine, to add shortcuts and similar windows-only things. Windows
270 # routine, to add shortcuts and similar windows-only things. Windows
273 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
271 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
274 # doesn't find them.
272 # doesn't find them.
275 if 'bdist_wininst' in sys.argv:
273 if 'bdist_wininst' in sys.argv:
276 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
274 if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
277 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
275 print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting."
278 sys.exit(1)
276 sys.exit(1)
279 scripts.append(pjoin('scripts','ipython_win_post_install.py'))
277 scripts.append(pjoin('scripts','ipython_win_post_install.py'))
280
278
281 return scripts
279 return scripts
282
280
283 #---------------------------------------------------------------------------
281 #---------------------------------------------------------------------------
284 # Verify all dependencies
282 # Verify all dependencies
285 #---------------------------------------------------------------------------
283 #---------------------------------------------------------------------------
286
284
287 def check_for_dependencies():
285 def check_for_dependencies():
288 """Check for IPython's dependencies.
286 """Check for IPython's dependencies.
289
287
290 This function should NOT be called if running under setuptools!
288 This function should NOT be called if running under setuptools!
291 """
289 """
292 from setupext.setupext import (
290 from setupext.setupext import (
293 print_line, print_raw, print_status, print_message,
291 print_line, print_raw, print_status, print_message,
294 check_for_zopeinterface, check_for_twisted,
292 check_for_zopeinterface, check_for_twisted,
295 check_for_foolscap, check_for_pyopenssl,
293 check_for_foolscap, check_for_pyopenssl,
296 check_for_sphinx, check_for_pygments,
294 check_for_sphinx, check_for_pygments,
297 check_for_nose, check_for_pexpect
295 check_for_nose, check_for_pexpect
298 )
296 )
299 print_line()
297 print_line()
300 print_raw("BUILDING IPYTHON")
298 print_raw("BUILDING IPYTHON")
301 print_status('python', sys.version)
299 print_status('python', sys.version)
302 print_status('platform', sys.platform)
300 print_status('platform', sys.platform)
303 if sys.platform == 'win32':
301 if sys.platform == 'win32':
304 print_status('Windows version', sys.getwindowsversion())
302 print_status('Windows version', sys.getwindowsversion())
305
303
306 print_raw("")
304 print_raw("")
307 print_raw("OPTIONAL DEPENDENCIES")
305 print_raw("OPTIONAL DEPENDENCIES")
308
306
309 check_for_zopeinterface()
307 check_for_zopeinterface()
310 check_for_twisted()
308 check_for_twisted()
311 check_for_foolscap()
309 check_for_foolscap()
312 check_for_pyopenssl()
310 check_for_pyopenssl()
313 check_for_sphinx()
311 check_for_sphinx()
314 check_for_pygments()
312 check_for_pygments()
315 check_for_nose()
313 check_for_nose()
316 check_for_pexpect()
314 check_for_pexpect()
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