##// END OF EJS Templates
update zmq dependency to 2.1.4
MinRK -
Show More
@@ -1,25 +1,25
1 #-----------------------------------------------------------------------------
1 #-----------------------------------------------------------------------------
2 # Copyright (C) 2010 The IPython Development Team
2 # Copyright (C) 2010 The IPython Development Team
3 #
3 #
4 # Distributed under the terms of the BSD License. The full license is in
4 # Distributed under the terms of the BSD License. The full license is in
5 # the file COPYING.txt, distributed as part of this software.
5 # the file COPYING.txt, distributed as part of this software.
6 #-----------------------------------------------------------------------------
6 #-----------------------------------------------------------------------------
7
7
8 #-----------------------------------------------------------------------------
8 #-----------------------------------------------------------------------------
9 # Verify zmq version dependency >= 2.0.10-1
9 # Verify zmq version dependency >= 2.1.4
10 #-----------------------------------------------------------------------------
10 #-----------------------------------------------------------------------------
11
11
12 minimum_pyzmq_version = "2.0.10-1"
12 minimum_pyzmq_version = "2.1.4"
13
13
14 try:
14 try:
15 import zmq
15 import zmq
16 except ImportError:
16 except ImportError:
17 raise ImportError("IPython.zmq requires pyzmq >= %s"%minimum_pyzmq_version)
17 raise ImportError("IPython.zmq requires pyzmq >= %s"%minimum_pyzmq_version)
18
18
19 pyzmq_version = zmq.__version__
19 pyzmq_version = zmq.__version__
20
20
21 if pyzmq_version < minimum_pyzmq_version:
21 if pyzmq_version < minimum_pyzmq_version:
22 raise ImportError("IPython.zmq requires pyzmq >= %s, but you have %s"%(
22 raise ImportError("IPython.zmq requires pyzmq >= %s, but you have %s"%(
23 minimum_pyzmq_version, pyzmq_version))
23 minimum_pyzmq_version, pyzmq_version))
24
24
25 del pyzmq_version
25 del pyzmq_version
@@ -1,332 +1,331
1 Overview
1 Overview
2 ========
2 ========
3
3
4 This document describes the steps required to install IPython. IPython is
4 This document describes the steps required to install IPython. IPython is
5 organized into a number of subpackages, each of which has its own dependencies.
5 organized into a number of subpackages, each of which has its own dependencies.
6 All of the subpackages come with IPython, so you don't need to download and
6 All of the subpackages come with IPython, so you don't need to download and
7 install them separately. However, to use a given subpackage, you will need to
7 install them separately. However, to use a given subpackage, you will need to
8 install all of its dependencies.
8 install all of its dependencies.
9
9
10
10
11 Please let us know if you have problems installing IPython or any of its
11 Please let us know if you have problems installing IPython or any of its
12 dependencies. Officially, IPython requires Python version 2.6 or 2.7. There
12 dependencies. Officially, IPython requires Python version 2.6 or 2.7. There
13 is an experimental port of IPython for Python3 `on GitHub
13 is an experimental port of IPython for Python3 `on GitHub
14 <https://github.com/ipython/ipython-py3k>`_
14 <https://github.com/ipython/ipython-py3k>`_
15
15
16 .. warning::
16 .. warning::
17
17
18 Officially, IPython supports Python versions 2.6 and 2.7.
18 Officially, IPython supports Python versions 2.6 and 2.7.
19
19
20 IPython 0.11 has a hard syntax dependency on 2.6, and will no longer work
20 IPython 0.11 has a hard syntax dependency on 2.6, and will no longer work
21 on Python <= 2.5.
21 on Python <= 2.5.
22
22
23 Some of the installation approaches use the :mod:`setuptools` package and its
23 Some of the installation approaches use the :mod:`setuptools` package and its
24 :command:`easy_install` command line program. In many scenarios, this provides
24 :command:`easy_install` command line program. In many scenarios, this provides
25 the most simple method of installing IPython and its dependencies. It is not
25 the most simple method of installing IPython and its dependencies. It is not
26 required though. More information about :mod:`setuptools` can be found on its
26 required though. More information about :mod:`setuptools` can be found on its
27 website.
27 website.
28
28
29 More general information about installing Python packages can be found in
29 More general information about installing Python packages can be found in
30 Python's documentation at http://www.python.org/doc/.
30 Python's documentation at http://www.python.org/doc/.
31
31
32 Quickstart
32 Quickstart
33 ==========
33 ==========
34
34
35 If you have :mod:`setuptools` installed and you are on OS X or Linux (not
35 If you have :mod:`setuptools` installed and you are on OS X or Linux (not
36 Windows), the following will download and install IPython *and* the main
36 Windows), the following will download and install IPython *and* the main
37 optional dependencies:
37 optional dependencies:
38
38
39 .. code-block:: bash
39 .. code-block:: bash
40
40
41 $ easy_install ipython[zmq,test]
41 $ easy_install ipython[zmq,test]
42
42
43 This will get pyzmq, which is needed for
43 This will get pyzmq, which is needed for
44 IPython's parallel computing features as well as the nose package, which will
44 IPython's parallel computing features as well as the nose package, which will
45 enable you to run IPython's test suite.
45 enable you to run IPython's test suite.
46
46
47 .. warning::
47 .. warning::
48
48
49 IPython's test system is being refactored and currently the
49 IPython's test system is being refactored and currently the
50 :command:`iptest` shown below does not work. More details about the
50 :command:`iptest` shown below does not work. More details about the
51 testing situation can be found :ref:`here <testing>`
51 testing situation can be found :ref:`here <testing>`
52
52
53 To run IPython's test suite, use the :command:`iptest` command:
53 To run IPython's test suite, use the :command:`iptest` command:
54
54
55 .. code-block:: bash
55 .. code-block:: bash
56
56
57 $ iptest
57 $ iptest
58
58
59 Read on for more specific details and instructions for Windows.
59 Read on for more specific details and instructions for Windows.
60
60
61 Installing IPython itself
61 Installing IPython itself
62 =========================
62 =========================
63
63
64 Given a properly built Python, the basic interactive IPython shell will work
64 Given a properly built Python, the basic interactive IPython shell will work
65 with no external dependencies. However, some Python distributions
65 with no external dependencies. However, some Python distributions
66 (particularly on Windows and OS X), don't come with a working :mod:`readline`
66 (particularly on Windows and OS X), don't come with a working :mod:`readline`
67 module. The IPython shell will work without :mod:`readline`, but will lack
67 module. The IPython shell will work without :mod:`readline`, but will lack
68 many features that users depend on, such as tab completion and command line
68 many features that users depend on, such as tab completion and command line
69 editing. If you install IPython with :mod:`setuptools`, (e.g. with `easy_install`),
69 editing. If you install IPython with :mod:`setuptools`, (e.g. with `easy_install`),
70 then the appropriate :mod:`readline` for your platform will be installed.
70 then the appropriate :mod:`readline` for your platform will be installed.
71 See below for details of how to make sure you have a working :mod:`readline`.
71 See below for details of how to make sure you have a working :mod:`readline`.
72
72
73 Installation using easy_install
73 Installation using easy_install
74 -------------------------------
74 -------------------------------
75
75
76 If you have :mod:`setuptools` installed, the easiest way of getting IPython is
76 If you have :mod:`setuptools` installed, the easiest way of getting IPython is
77 to simple use :command:`easy_install`:
77 to simple use :command:`easy_install`:
78
78
79 .. code-block:: bash
79 .. code-block:: bash
80
80
81 $ easy_install ipython
81 $ easy_install ipython
82
82
83 That's it.
83 That's it.
84
84
85 Installation from source
85 Installation from source
86 ------------------------
86 ------------------------
87
87
88 If you don't want to use :command:`easy_install`, or don't have it installed,
88 If you don't want to use :command:`easy_install`, or don't have it installed,
89 just grab the latest stable build of IPython from `here
89 just grab the latest stable build of IPython from `here
90 <https://github.com/ipython/ipython/downloads>`_. Then do the following:
90 <https://github.com/ipython/ipython/downloads>`_. Then do the following:
91
91
92 .. code-block:: bash
92 .. code-block:: bash
93
93
94 $ tar -xzf ipython.tar.gz
94 $ tar -xzf ipython.tar.gz
95 $ cd ipython
95 $ cd ipython
96 $ python setup.py install
96 $ python setup.py install
97
97
98 If you are installing to a location (like ``/usr/local``) that requires higher
98 If you are installing to a location (like ``/usr/local``) that requires higher
99 permissions, you may need to run the last command with :command:`sudo`.
99 permissions, you may need to run the last command with :command:`sudo`.
100
100
101 Windows
101 Windows
102 -------
102 -------
103
103
104 There are a few caveats for Windows users. The main issue is that a basic
104 There are a few caveats for Windows users. The main issue is that a basic
105 ``python setup.py install`` approach won't create ``.bat`` file or Start Menu
105 ``python setup.py install`` approach won't create ``.bat`` file or Start Menu
106 shortcuts, which most users want. To get an installation with these, you can
106 shortcuts, which most users want. To get an installation with these, you can
107 use any of the following alternatives:
107 use any of the following alternatives:
108
108
109 1. Install using :command:`easy_install`.
109 1. Install using :command:`easy_install`.
110
110
111 2. Install using our binary ``.exe`` Windows installer, which can be found
111 2. Install using our binary ``.exe`` Windows installer, which can be found
112 `here <http://ipython.scipy.org/dist/>`_
112 `here <http://ipython.scipy.org/dist/>`_
113
113
114 3. Install from source, but using :mod:`setuptools` (``python setupegg.py
114 3. Install from source, but using :mod:`setuptools` (``python setupegg.py
115 install``).
115 install``).
116
116
117 IPython by default runs in a terminal window, but the normal terminal
117 IPython by default runs in a terminal window, but the normal terminal
118 application supplied by Microsoft Windows is very primitive. You may want to
118 application supplied by Microsoft Windows is very primitive. You may want to
119 download the excellent and free Console_ application instead, which is a far
119 download the excellent and free Console_ application instead, which is a far
120 superior tool. You can even configure Console to give you by default an
120 superior tool. You can even configure Console to give you by default an
121 IPython tab, which is very convenient to create new IPython sessions directly
121 IPython tab, which is very convenient to create new IPython sessions directly
122 from the working terminal.
122 from the working terminal.
123
123
124 .. _Console: http://sourceforge.net/projects/console
124 .. _Console: http://sourceforge.net/projects/console
125
125
126 Note for Windows 64 bit users: you may have difficulties with the stock
126 Note for Windows 64 bit users: you may have difficulties with the stock
127 installer on 64 bit systems; in this case (since we currently do not have 64
127 installer on 64 bit systems; in this case (since we currently do not have 64
128 bit builds of the Windows installer) your best bet is to install from source
128 bit builds of the Windows installer) your best bet is to install from source
129 with the setuptools method indicated in #3 above. See `this bug report`_ for
129 with the setuptools method indicated in #3 above. See `this bug report`_ for
130 further details.
130 further details.
131
131
132 .. _this bug report: https://bugs.launchpad.net/ipython/+bug/382214
132 .. _this bug report: https://bugs.launchpad.net/ipython/+bug/382214
133
133
134
134
135 Installing the development version
135 Installing the development version
136 ----------------------------------
136 ----------------------------------
137
137
138 It is also possible to install the development version of IPython from our
138 It is also possible to install the development version of IPython from our
139 `Git <http://git-scm.com/>`_ source code repository. To do this you will
139 `Git <http://git-scm.com/>`_ source code repository. To do this you will
140 need to have Git installed on your system. Then just do:
140 need to have Git installed on your system. Then just do:
141
141
142 .. code-block:: bash
142 .. code-block:: bash
143
143
144 $ git clone https://github.com/ipython/ipython.git
144 $ git clone https://github.com/ipython/ipython.git
145 $ cd ipython
145 $ cd ipython
146 $ python setup.py install
146 $ python setup.py install
147
147
148 Again, this last step on Windows won't create ``.bat`` files or Start Menu
148 Again, this last step on Windows won't create ``.bat`` files or Start Menu
149 shortcuts, so you will have to use one of the other approaches listed above.
149 shortcuts, so you will have to use one of the other approaches listed above.
150
150
151 Some users want to be able to follow the development branch as it changes. If
151 Some users want to be able to follow the development branch as it changes. If
152 you have :mod:`setuptools` installed, this is easy. Simply replace the last
152 you have :mod:`setuptools` installed, this is easy. Simply replace the last
153 step by:
153 step by:
154
154
155 .. code-block:: bash
155 .. code-block:: bash
156
156
157 $ python setupegg.py develop
157 $ python setupegg.py develop
158
158
159 This creates links in the right places and installs the command line script to
159 This creates links in the right places and installs the command line script to
160 the appropriate places. Then, if you want to update your IPython at any time,
160 the appropriate places. Then, if you want to update your IPython at any time,
161 just do:
161 just do:
162
162
163 .. code-block:: bash
163 .. code-block:: bash
164
164
165 $ git pull
165 $ git pull
166
166
167 Basic optional dependencies
167 Basic optional dependencies
168 ===========================
168 ===========================
169
169
170 There are a number of basic optional dependencies that most users will want to
170 There are a number of basic optional dependencies that most users will want to
171 get. These are:
171 get. These are:
172
172
173 * readline (for command line editing, tab completion, etc.)
173 * readline (for command line editing, tab completion, etc.)
174 * nose (to run the IPython test suite)
174 * nose (to run the IPython test suite)
175 * pexpect (to use things like irunner)
175 * pexpect (to use things like irunner)
176
176
177 If you are comfortable installing these things yourself, have at it, otherwise
177 If you are comfortable installing these things yourself, have at it, otherwise
178 read on for more details.
178 read on for more details.
179
179
180 readline
180 readline
181 --------
181 --------
182
182
183 In principle, all Python distributions should come with a working
183 In principle, all Python distributions should come with a working
184 :mod:`readline` module. But, reality is not quite that simple. There are two
184 :mod:`readline` module. But, reality is not quite that simple. There are two
185 common situations where you won't have a working :mod:`readline` module:
185 common situations where you won't have a working :mod:`readline` module:
186
186
187 * If you are using the built-in Python on Mac OS X.
187 * If you are using the built-in Python on Mac OS X.
188
188
189 * If you are running Windows, which doesn't have a :mod:`readline` module.
189 * If you are running Windows, which doesn't have a :mod:`readline` module.
190
190
191 When IPython is installed with :mod:`setuptools`, (e.g. with `easy_install`),
191 When IPython is installed with :mod:`setuptools`, (e.g. with `easy_install`),
192 readline is added as a dependency on OS X, and PyReadline on Windows, and will
192 readline is added as a dependency on OS X, and PyReadline on Windows, and will
193 be installed on your system. However, if you do not use setuptools, you may
193 be installed on your system. However, if you do not use setuptools, you may
194 have to install one of these packages yourself.
194 have to install one of these packages yourself.
195
195
196 On OS X, the built-in Python doesn't not have :mod:`readline` because of
196 On OS X, the built-in Python doesn't not have :mod:`readline` because of
197 license issues. Starting with OS X 10.5 (Leopard), Apple's built-in Python has
197 license issues. Starting with OS X 10.5 (Leopard), Apple's built-in Python has
198 a BSD-licensed not-quite-compatible readline replacement. As of IPython 0.9,
198 a BSD-licensed not-quite-compatible readline replacement. As of IPython 0.9,
199 many of the issues related to the differences between readline and libedit seem
199 many of the issues related to the differences between readline and libedit seem
200 to have been resolved. While you may find libedit sufficient, we have
200 to have been resolved. While you may find libedit sufficient, we have
201 occasional reports of bugs with it and several developers who use OS X as their
201 occasional reports of bugs with it and several developers who use OS X as their
202 main environment consider libedit unacceptable for productive, regular use with
202 main environment consider libedit unacceptable for productive, regular use with
203 IPython.
203 IPython.
204
204
205 Therefore, we *strongly* recommend that on OS X you get the full
205 Therefore, we *strongly* recommend that on OS X you get the full
206 :mod:`readline` module. We will *not* consider completion/history problems to
206 :mod:`readline` module. We will *not* consider completion/history problems to
207 be bugs for IPython if you are using libedit.
207 be bugs for IPython if you are using libedit.
208
208
209 To get a working :mod:`readline` module, just do (with :mod:`setuptools`
209 To get a working :mod:`readline` module, just do (with :mod:`setuptools`
210 installed):
210 installed):
211
211
212 .. code-block:: bash
212 .. code-block:: bash
213
213
214 $ easy_install readline
214 $ easy_install readline
215
215
216 .. note::
216 .. note::
217
217
218 Other Python distributions on OS X (such as fink, MacPorts and the official
218 Other Python distributions on OS X (such as fink, MacPorts and the official
219 python.org binaries) already have readline installed so you likely don't
219 python.org binaries) already have readline installed so you likely don't
220 have to do this step.
220 have to do this step.
221
221
222 If needed, the readline egg can be build and installed from source (see the
222 If needed, the readline egg can be build and installed from source (see the
223 wiki page at http://ipython.scipy.org/moin/InstallationOSXLeopard).
223 wiki page at http://ipython.scipy.org/moin/InstallationOSXLeopard).
224
224
225 On Windows, you will need the PyReadline module. PyReadline is a separate,
225 On Windows, you will need the PyReadline module. PyReadline is a separate,
226 Windows only implementation of readline that uses native Windows calls through
226 Windows only implementation of readline that uses native Windows calls through
227 :mod:`ctypes`. The easiest way of installing PyReadline is you use the binary
227 :mod:`ctypes`. The easiest way of installing PyReadline is you use the binary
228 installer available `here <https://launchpad.net/pyreadline/+download>`_.
228 installer available `here <https://launchpad.net/pyreadline/+download>`_.
229
229
230 nose
230 nose
231 ----
231 ----
232
232
233 To run the IPython test suite you will need the :mod:`nose` package. Nose
233 To run the IPython test suite you will need the :mod:`nose` package. Nose
234 provides a great way of sniffing out and running all of the IPython tests. The
234 provides a great way of sniffing out and running all of the IPython tests. The
235 simplest way of getting nose, is to use :command:`easy_install`:
235 simplest way of getting nose, is to use :command:`easy_install`:
236
236
237 .. code-block:: bash
237 .. code-block:: bash
238
238
239 $ easy_install nose
239 $ easy_install nose
240
240
241 Another way of getting this is to do:
241 Another way of getting this is to do:
242
242
243 .. code-block:: bash
243 .. code-block:: bash
244
244
245 $ easy_install ipython[test]
245 $ easy_install ipython[test]
246
246
247 For more installation options, see the `nose website
247 For more installation options, see the `nose website
248 <http://somethingaboutorange.com/mrl/projects/nose/>`_.
248 <http://somethingaboutorange.com/mrl/projects/nose/>`_.
249
249
250 .. warning::
250 .. warning::
251
251
252 As described above, the :command:`iptest` command currently doesn't work.
252 As described above, the :command:`iptest` command currently doesn't work.
253
253
254 Once you have nose installed, you can run IPython's test suite using the
254 Once you have nose installed, you can run IPython's test suite using the
255 iptest command:
255 iptest command:
256
256
257 .. code-block:: bash
257 .. code-block:: bash
258
258
259 $ iptest
259 $ iptest
260
260
261 pexpect
261 pexpect
262 -------
262 -------
263
263
264 The pexpect package is used in IPython's :command:`irunner` script, as well as
264 The pexpect package is used in IPython's :command:`irunner` script, as well as
265 for managing subprocesses [pexpect]_. IPython now includes a version of pexpect
265 for managing subprocesses [pexpect]_. IPython now includes a version of pexpect
266 in :mod:`IPython.external`, but if you have installed pexpect, IPython will use
266 in :mod:`IPython.external`, but if you have installed pexpect, IPython will use
267 that instead. On Unix platforms (including OS X), just do:
267 that instead. On Unix platforms (including OS X), just do:
268
268
269 .. code-block:: bash
269 .. code-block:: bash
270
270
271 $ easy_install pexpect
271 $ easy_install pexpect
272
272
273 Windows users are out of luck as pexpect does not run there.
273 Windows users are out of luck as pexpect does not run there.
274
274
275 Dependencies for IPython.parallel (parallel computing)
275 Dependencies for IPython.parallel (parallel computing)
276 ======================================================
276 ======================================================
277
277
278 :mod:`IPython.kernel` has been replaced by :mod:`IPython.parallel`,
278 :mod:`IPython.kernel` has been replaced by :mod:`IPython.parallel`,
279 which uses ZeroMQ for all communication.
279 which uses ZeroMQ for all communication.
280
280
281 IPython.parallel provides a nice architecture for parallel computing. The
281 IPython.parallel provides a nice architecture for parallel computing. The
282 main focus of this architecture is on interactive parallel computing. These
282 main focus of this architecture is on interactive parallel computing. These
283 features require just one package: pyzmq. See the next section for pyzmq
283 features require just one package: pyzmq. See the next section for pyzmq
284 details.
284 details.
285
285
286 On a Unix style platform (including OS X), if you want to use
286 On a Unix style platform (including OS X), if you want to use
287 :mod:`setuptools`, you can just do:
287 :mod:`setuptools`, you can just do:
288
288
289 .. code-block:: bash
289 .. code-block:: bash
290
290
291 $ easy_install ipython[zmq] # will include pyzmq
291 $ easy_install ipython[zmq] # will include pyzmq
292
292
293 Security in IPython.parallel is provided by SSH tunnels. By default, Linux
293 Security in IPython.parallel is provided by SSH tunnels. By default, Linux
294 and OSX clients will use the shell ssh command, but on Windows, we also
294 and OSX clients will use the shell ssh command, but on Windows, we also
295 support tunneling with paramiko [paramiko]_.
295 support tunneling with paramiko [paramiko]_.
296
296
297 Dependencies for IPython.zmq
297 Dependencies for IPython.zmq
298 ============================
298 ============================
299
299
300 pyzmq
300 pyzmq
301 -----
301 -----
302
302
303 IPython 0.11 introduced some new functionality, including a two-process
303 IPython 0.11 introduced some new functionality, including a two-process
304 execution model using ZeroMQ for communication [ZeroMQ]_. The Python bindings
304 execution model using ZeroMQ for communication [ZeroMQ]_. The Python bindings
305 to ZeroMQ are found in the pyzmq project, which is easy_install-able once you
305 to ZeroMQ are found in the pyzmq project, which is easy_install-able once you
306 have ZeroMQ installed (or even if you don't).
306 have ZeroMQ installed. If you are on Python 2.6 or 2.7 on OSX, or 2.7 on Windows,
307 pyzmq has eggs that include ZeroMQ itself.
307
308
308 IPython.zmq depends on pyzmq >= 2.0.10.1, but IPython.parallel requires the more
309 IPython.zmq depends on pyzmq >= 2.1.4.
309 recent 2.1.4. 2.1.4 also has binary releases for OSX and Windows, that do not
310 require prior installation of libzmq.
311
310
312 Dependencies for ipython-qtconsole (new GUI)
311 Dependencies for ipython-qtconsole (new GUI)
313 ============================================
312 ============================================
314
313
315 PyQt
314 PyQt
316 ----
315 ----
317
316
318 Also with 0.11, a new GUI was added using the work in :mod:`IPython.zmq`,
317 Also with 0.11, a new GUI was added using the work in :mod:`IPython.zmq`,
319 which can be launched with ``ipython-qtconsole``. The GUI is built on PyQt ,
318 which can be launched with ``ipython-qtconsole``. The GUI is built on PyQt ,
320 which can be installed from the
319 which can be installed from the
321 `PyQt website <http://www.riverbankcomputing.co.uk/>`_.
320 `PyQt website <http://www.riverbankcomputing.co.uk/>`_.
322
321
323 pygments
322 pygments
324 --------
323 --------
325
324
326 The syntax-highlighting in ``ipython-qtconsole`` is done with the pygments project,
325 The syntax-highlighting in ``ipython-qtconsole`` is done with the pygments project,
327 which is easy_install-able [pygments]_.
326 which is easy_install-able [pygments]_.
328
327
329 .. [ZeroMQ] ZeroMQ. http://www.zeromq.org
328 .. [ZeroMQ] ZeroMQ. http://www.zeromq.org
330 .. [paramiko] paramiko. https://github.com/robey/paramiko
329 .. [paramiko] paramiko. https://github.com/robey/paramiko
331 .. [pygments] Pygments syntax highlighting. http://pygments.org
330 .. [pygments] Pygments syntax highlighting. http://pygments.org
332 .. [pexpect] Pexpect. http://www.noah.org/wiki/Pexpect
331 .. [pexpect] Pexpect. http://www.noah.org/wiki/Pexpect
@@ -1,261 +1,261
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 # -*- coding: utf-8 -*-
2 # -*- coding: utf-8 -*-
3 """Setup script for IPython.
3 """Setup script for IPython.
4
4
5 Under Posix environments it works like a typical setup.py script.
5 Under Posix environments it works like a typical setup.py script.
6 Under Windows, the command sdist is not supported, since IPython
6 Under Windows, the command sdist is not supported, since IPython
7 requires utilities which are not available under Windows."""
7 requires utilities which are not available under Windows."""
8
8
9 #-----------------------------------------------------------------------------
9 #-----------------------------------------------------------------------------
10 # Copyright (c) 2008-2010, IPython Development Team.
10 # Copyright (c) 2008-2010, IPython Development Team.
11 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
11 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
12 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
12 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
13 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
13 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
14 #
14 #
15 # Distributed under the terms of the Modified BSD License.
15 # Distributed under the terms of the Modified BSD License.
16 #
16 #
17 # The full license is in the file COPYING.txt, distributed with this software.
17 # The full license is in the file COPYING.txt, distributed with this software.
18 #-----------------------------------------------------------------------------
18 #-----------------------------------------------------------------------------
19
19
20 #-----------------------------------------------------------------------------
20 #-----------------------------------------------------------------------------
21 # Minimal Python version sanity check
21 # Minimal Python version sanity check
22 #-----------------------------------------------------------------------------
22 #-----------------------------------------------------------------------------
23
23
24 import sys
24 import sys
25
25
26 # This check is also made in IPython/__init__, don't forget to update both when
26 # This check is also made in IPython/__init__, don't forget to update both when
27 # changing Python version requirements.
27 # changing Python version requirements.
28 if sys.version[0:3] < '2.6':
28 if sys.version[0:3] < '2.6':
29 error = """\
29 error = """\
30 ERROR: 'IPython requires Python Version 2.6 or above.'
30 ERROR: 'IPython requires Python Version 2.6 or above.'
31 Exiting."""
31 Exiting."""
32 print >> sys.stderr, error
32 print >> sys.stderr, error
33 sys.exit(1)
33 sys.exit(1)
34
34
35 # At least we're on the python version we need, move on.
35 # At least we're on the python version we need, move on.
36
36
37 #-------------------------------------------------------------------------------
37 #-------------------------------------------------------------------------------
38 # Imports
38 # Imports
39 #-------------------------------------------------------------------------------
39 #-------------------------------------------------------------------------------
40
40
41 # Stdlib imports
41 # Stdlib imports
42 import os
42 import os
43 import shutil
43 import shutil
44
44
45 from glob import glob
45 from glob import glob
46
46
47 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
47 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
48 # update it when the contents of directories change.
48 # update it when the contents of directories change.
49 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
49 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
50
50
51 from distutils.core import setup
51 from distutils.core import setup
52
52
53 # Our own imports
53 # Our own imports
54 from IPython.utils.path import target_update
54 from IPython.utils.path import target_update
55
55
56 from setupbase import (
56 from setupbase import (
57 setup_args,
57 setup_args,
58 find_packages,
58 find_packages,
59 find_package_data,
59 find_package_data,
60 find_scripts,
60 find_scripts,
61 find_data_files,
61 find_data_files,
62 check_for_dependencies,
62 check_for_dependencies,
63 record_commit_info,
63 record_commit_info,
64 )
64 )
65 from setupext import setupext
65 from setupext import setupext
66
66
67 isfile = os.path.isfile
67 isfile = os.path.isfile
68 pjoin = os.path.join
68 pjoin = os.path.join
69
69
70 #-----------------------------------------------------------------------------
70 #-----------------------------------------------------------------------------
71 # Function definitions
71 # Function definitions
72 #-----------------------------------------------------------------------------
72 #-----------------------------------------------------------------------------
73
73
74 def cleanup():
74 def cleanup():
75 """Clean up the junk left around by the build process"""
75 """Clean up the junk left around by the build process"""
76 if "develop" not in sys.argv:
76 if "develop" not in sys.argv:
77 try:
77 try:
78 shutil.rmtree('ipython.egg-info')
78 shutil.rmtree('ipython.egg-info')
79 except:
79 except:
80 try:
80 try:
81 os.unlink('ipython.egg-info')
81 os.unlink('ipython.egg-info')
82 except:
82 except:
83 pass
83 pass
84
84
85 #-------------------------------------------------------------------------------
85 #-------------------------------------------------------------------------------
86 # Handle OS specific things
86 # Handle OS specific things
87 #-------------------------------------------------------------------------------
87 #-------------------------------------------------------------------------------
88
88
89 if os.name == 'posix':
89 if os.name == 'posix':
90 os_name = 'posix'
90 os_name = 'posix'
91 elif os.name in ['nt','dos']:
91 elif os.name in ['nt','dos']:
92 os_name = 'windows'
92 os_name = 'windows'
93 else:
93 else:
94 print 'Unsupported operating system:',os.name
94 print 'Unsupported operating system:',os.name
95 sys.exit(1)
95 sys.exit(1)
96
96
97 # Under Windows, 'sdist' has not been supported. Now that the docs build with
97 # Under Windows, 'sdist' has not been supported. Now that the docs build with
98 # Sphinx it might work, but let's not turn it on until someone confirms that it
98 # Sphinx it might work, but let's not turn it on until someone confirms that it
99 # actually works.
99 # actually works.
100 if os_name == 'windows' and 'sdist' in sys.argv:
100 if os_name == 'windows' and 'sdist' in sys.argv:
101 print 'The sdist command is not available under Windows. Exiting.'
101 print 'The sdist command is not available under Windows. Exiting.'
102 sys.exit(1)
102 sys.exit(1)
103
103
104 #-------------------------------------------------------------------------------
104 #-------------------------------------------------------------------------------
105 # Things related to the IPython documentation
105 # Things related to the IPython documentation
106 #-------------------------------------------------------------------------------
106 #-------------------------------------------------------------------------------
107
107
108 # update the manuals when building a source dist
108 # update the manuals when building a source dist
109 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
109 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
110 import textwrap
110 import textwrap
111
111
112 # List of things to be updated. Each entry is a triplet of args for
112 # List of things to be updated. Each entry is a triplet of args for
113 # target_update()
113 # target_update()
114 to_update = [
114 to_update = [
115 # FIXME - Disabled for now: we need to redo an automatic way
115 # FIXME - Disabled for now: we need to redo an automatic way
116 # of generating the magic info inside the rst.
116 # of generating the magic info inside the rst.
117 #('docs/magic.tex',
117 #('docs/magic.tex',
118 #['IPython/Magic.py'],
118 #['IPython/Magic.py'],
119 #"cd doc && ./update_magic.sh" ),
119 #"cd doc && ./update_magic.sh" ),
120
120
121 ('docs/man/ipcluster.1.gz',
121 ('docs/man/ipcluster.1.gz',
122 ['docs/man/ipcluster.1'],
122 ['docs/man/ipcluster.1'],
123 'cd docs/man && gzip -9c ipcluster.1 > ipcluster.1.gz'),
123 'cd docs/man && gzip -9c ipcluster.1 > ipcluster.1.gz'),
124
124
125 ('docs/man/ipcontroller.1.gz',
125 ('docs/man/ipcontroller.1.gz',
126 ['docs/man/ipcontroller.1'],
126 ['docs/man/ipcontroller.1'],
127 'cd docs/man && gzip -9c ipcontroller.1 > ipcontroller.1.gz'),
127 'cd docs/man && gzip -9c ipcontroller.1 > ipcontroller.1.gz'),
128
128
129 ('docs/man/ipengine.1.gz',
129 ('docs/man/ipengine.1.gz',
130 ['docs/man/ipengine.1'],
130 ['docs/man/ipengine.1'],
131 'cd docs/man && gzip -9c ipengine.1 > ipengine.1.gz'),
131 'cd docs/man && gzip -9c ipengine.1 > ipengine.1.gz'),
132
132
133 ('docs/man/ipython.1.gz',
133 ('docs/man/ipython.1.gz',
134 ['docs/man/ipython.1'],
134 ['docs/man/ipython.1'],
135 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
135 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
136
136
137 ('docs/man/ipython-wx.1.gz',
137 ('docs/man/ipython-wx.1.gz',
138 ['docs/man/ipython-wx.1'],
138 ['docs/man/ipython-wx.1'],
139 'cd docs/man && gzip -9c ipython-wx.1 > ipython-wx.1.gz'),
139 'cd docs/man && gzip -9c ipython-wx.1 > ipython-wx.1.gz'),
140
140
141 ('docs/man/ipythonx.1.gz',
141 ('docs/man/ipythonx.1.gz',
142 ['docs/man/ipythonx.1'],
142 ['docs/man/ipythonx.1'],
143 'cd docs/man && gzip -9c ipythonx.1 > ipythonx.1.gz'),
143 'cd docs/man && gzip -9c ipythonx.1 > ipythonx.1.gz'),
144
144
145 ('docs/man/irunner.1.gz',
145 ('docs/man/irunner.1.gz',
146 ['docs/man/irunner.1'],
146 ['docs/man/irunner.1'],
147 'cd docs/man && gzip -9c irunner.1 > irunner.1.gz'),
147 'cd docs/man && gzip -9c irunner.1 > irunner.1.gz'),
148
148
149 ('docs/man/pycolor.1.gz',
149 ('docs/man/pycolor.1.gz',
150 ['docs/man/pycolor.1'],
150 ['docs/man/pycolor.1'],
151 'cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz'),
151 'cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz'),
152 ]
152 ]
153
153
154 # Only build the docs if sphinx is present
154 # Only build the docs if sphinx is present
155 try:
155 try:
156 import sphinx
156 import sphinx
157 except ImportError:
157 except ImportError:
158 pass
158 pass
159 else:
159 else:
160 # The Makefile calls the do_sphinx scripts to build html and pdf, so
160 # The Makefile calls the do_sphinx scripts to build html and pdf, so
161 # just one target is enough to cover all manual generation
161 # just one target is enough to cover all manual generation
162
162
163 # First, compute all the dependencies that can force us to rebuild the
163 # First, compute all the dependencies that can force us to rebuild the
164 # docs. Start with the main release file that contains metadata
164 # docs. Start with the main release file that contains metadata
165 docdeps = ['IPython/core/release.py']
165 docdeps = ['IPython/core/release.py']
166 # Inculde all the reST sources
166 # Inculde all the reST sources
167 pjoin = os.path.join
167 pjoin = os.path.join
168 for dirpath,dirnames,filenames in os.walk('docs/source'):
168 for dirpath,dirnames,filenames in os.walk('docs/source'):
169 if dirpath in ['_static','_templates']:
169 if dirpath in ['_static','_templates']:
170 continue
170 continue
171 docdeps += [ pjoin(dirpath,f) for f in filenames
171 docdeps += [ pjoin(dirpath,f) for f in filenames
172 if f.endswith('.txt') ]
172 if f.endswith('.txt') ]
173 # and the examples
173 # and the examples
174 for dirpath,dirnames,filenames in os.walk('docs/example'):
174 for dirpath,dirnames,filenames in os.walk('docs/example'):
175 docdeps += [ pjoin(dirpath,f) for f in filenames
175 docdeps += [ pjoin(dirpath,f) for f in filenames
176 if not f.endswith('~') ]
176 if not f.endswith('~') ]
177 # then, make them all dependencies for the main PDF (the html will get
177 # then, make them all dependencies for the main PDF (the html will get
178 # auto-generated as well).
178 # auto-generated as well).
179 to_update.append(
179 to_update.append(
180 ('docs/dist/ipython.pdf',
180 ('docs/dist/ipython.pdf',
181 docdeps,
181 docdeps,
182 "cd docs && make dist")
182 "cd docs && make dist")
183 )
183 )
184
184
185 [ target_update(*t) for t in to_update ]
185 [ target_update(*t) for t in to_update ]
186
186
187 #---------------------------------------------------------------------------
187 #---------------------------------------------------------------------------
188 # Find all the packages, package data, and data_files
188 # Find all the packages, package data, and data_files
189 #---------------------------------------------------------------------------
189 #---------------------------------------------------------------------------
190
190
191 packages = find_packages()
191 packages = find_packages()
192 package_data = find_package_data()
192 package_data = find_package_data()
193 data_files = find_data_files()
193 data_files = find_data_files()
194
194
195 #---------------------------------------------------------------------------
195 #---------------------------------------------------------------------------
196 # Handle scripts, dependencies, and setuptools specific things
196 # Handle scripts, dependencies, and setuptools specific things
197 #---------------------------------------------------------------------------
197 #---------------------------------------------------------------------------
198
198
199 # For some commands, use setuptools. Note that we do NOT list install here!
199 # For some commands, use setuptools. Note that we do NOT list install here!
200 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
200 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
201 if len(set(('develop', 'sdist', 'release', 'bdist_egg', 'bdist_rpm',
201 if len(set(('develop', 'sdist', 'release', 'bdist_egg', 'bdist_rpm',
202 'bdist', 'bdist_dumb', 'bdist_wininst', 'install_egg_info',
202 'bdist', 'bdist_dumb', 'bdist_wininst', 'install_egg_info',
203 'build_sphinx', 'egg_info', 'easy_install', 'upload',
203 'build_sphinx', 'egg_info', 'easy_install', 'upload',
204 )).intersection(sys.argv)) > 0:
204 )).intersection(sys.argv)) > 0:
205 import setuptools
205 import setuptools
206
206
207 # This dict is used for passing extra arguments that are setuptools
207 # This dict is used for passing extra arguments that are setuptools
208 # specific to setup
208 # specific to setup
209 setuptools_extra_args = {}
209 setuptools_extra_args = {}
210
210
211 if 'setuptools' in sys.modules:
211 if 'setuptools' in sys.modules:
212 setuptools_extra_args['zip_safe'] = False
212 setuptools_extra_args['zip_safe'] = False
213 setuptools_extra_args['entry_points'] = find_scripts(True)
213 setuptools_extra_args['entry_points'] = find_scripts(True)
214 setup_args['extras_require'] = dict(
214 setup_args['extras_require'] = dict(
215 parallel = 'pyzmq>=2.1.4',
215 parallel = 'pyzmq>=2.1.4',
216 zmq = 'pyzmq>=2.0.10.1',
216 zmq = 'pyzmq>=2.1.4',
217 doc='Sphinx>=0.3',
217 doc='Sphinx>=0.3',
218 test='nose>=0.10.1',
218 test='nose>=0.10.1',
219 )
219 )
220 requires = setup_args.setdefault('install_requires', [])
220 requires = setup_args.setdefault('install_requires', [])
221 setupext.display_status = False
221 setupext.display_status = False
222 if not setupext.check_for_readline():
222 if not setupext.check_for_readline():
223 if sys.platform == 'darwin':
223 if sys.platform == 'darwin':
224 requires.append('readline')
224 requires.append('readline')
225 elif sys.platform.startswith('win'):
225 elif sys.platform.startswith('win'):
226 requires.append('pyreadline')
226 requires.append('pyreadline')
227 else:
227 else:
228 pass
228 pass
229 # do we want to install readline here?
229 # do we want to install readline here?
230
230
231 # Script to be run by the windows binary installer after the default setup
231 # Script to be run by the windows binary installer after the default setup
232 # routine, to add shortcuts and similar windows-only things. Windows
232 # routine, to add shortcuts and similar windows-only things. Windows
233 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
233 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
234 # doesn't find them.
234 # doesn't find them.
235 if 'bdist_wininst' in sys.argv:
235 if 'bdist_wininst' in sys.argv:
236 if len(sys.argv) > 2 and \
236 if len(sys.argv) > 2 and \
237 ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
237 ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
238 print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
238 print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
239 sys.exit(1)
239 sys.exit(1)
240 setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
240 setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
241 else:
241 else:
242 # If we are running without setuptools, call this function which will
242 # If we are running without setuptools, call this function which will
243 # check for dependencies an inform the user what is needed. This is
243 # check for dependencies an inform the user what is needed. This is
244 # just to make life easy for users.
244 # just to make life easy for users.
245 check_for_dependencies()
245 check_for_dependencies()
246 setup_args['scripts'] = find_scripts(False)
246 setup_args['scripts'] = find_scripts(False)
247
247
248 #---------------------------------------------------------------------------
248 #---------------------------------------------------------------------------
249 # Do the actual setup now
249 # Do the actual setup now
250 #---------------------------------------------------------------------------
250 #---------------------------------------------------------------------------
251
251
252 setup_args['cmdclass'] = {'build_py': record_commit_info('IPython')}
252 setup_args['cmdclass'] = {'build_py': record_commit_info('IPython')}
253 setup_args['packages'] = packages
253 setup_args['packages'] = packages
254 setup_args['package_data'] = package_data
254 setup_args['package_data'] = package_data
255 setup_args['data_files'] = data_files
255 setup_args['data_files'] = data_files
256 setup_args.update(setuptools_extra_args)
256 setup_args.update(setuptools_extra_args)
257
257
258
258
259 if __name__ == '__main__':
259 if __name__ == '__main__':
260 setup(**setup_args)
260 setup(**setup_args)
261 cleanup()
261 cleanup()
@@ -1,163 +1,164
1 # encoding: utf-8
1 # encoding: utf-8
2
2
3 __docformat__ = "restructuredtext en"
3 __docformat__ = "restructuredtext en"
4
4
5 #-------------------------------------------------------------------------------
5 #-------------------------------------------------------------------------------
6 # Copyright (C) 2008 The IPython Development Team
6 # Copyright (C) 2008 The IPython Development Team
7 #
7 #
8 # Distributed under the terms of the BSD License. The full license is in
8 # Distributed under the terms of the BSD License. The full license is in
9 # the file COPYING, distributed as part of this software.
9 # the file COPYING, distributed as part of this software.
10 #-------------------------------------------------------------------------------
10 #-------------------------------------------------------------------------------
11
11
12 #-------------------------------------------------------------------------------
12 #-------------------------------------------------------------------------------
13 # Imports
13 # Imports
14 #-------------------------------------------------------------------------------
14 #-------------------------------------------------------------------------------
15
15
16 import sys, os
16 import sys, os
17 from textwrap import fill
17 from textwrap import fill
18
18
19 display_status=True
19 display_status=True
20
20
21 def check_display(f):
21 def check_display(f):
22 """decorator to allow display methods to be muted by mod.display_status"""
22 """decorator to allow display methods to be muted by mod.display_status"""
23 def maybe_display(*args, **kwargs):
23 def maybe_display(*args, **kwargs):
24 if display_status:
24 if display_status:
25 return f(*args, **kwargs)
25 return f(*args, **kwargs)
26 return maybe_display
26 return maybe_display
27
27
28 @check_display
28 @check_display
29 def print_line(char='='):
29 def print_line(char='='):
30 print char * 76
30 print char * 76
31
31
32 @check_display
32 @check_display
33 def print_status(package, status):
33 def print_status(package, status):
34 initial_indent = "%22s: " % package
34 initial_indent = "%22s: " % package
35 indent = ' ' * 24
35 indent = ' ' * 24
36 print fill(str(status), width=76,
36 print fill(str(status), width=76,
37 initial_indent=initial_indent,
37 initial_indent=initial_indent,
38 subsequent_indent=indent)
38 subsequent_indent=indent)
39
39
40 @check_display
40 @check_display
41 def print_message(message):
41 def print_message(message):
42 indent = ' ' * 24 + "* "
42 indent = ' ' * 24 + "* "
43 print fill(str(message), width=76,
43 print fill(str(message), width=76,
44 initial_indent=indent,
44 initial_indent=indent,
45 subsequent_indent=indent)
45 subsequent_indent=indent)
46
46
47 @check_display
47 @check_display
48 def print_raw(section):
48 def print_raw(section):
49 print section
49 print section
50
50
51 #-------------------------------------------------------------------------------
51 #-------------------------------------------------------------------------------
52 # Tests for specific packages
52 # Tests for specific packages
53 #-------------------------------------------------------------------------------
53 #-------------------------------------------------------------------------------
54
54
55 def check_for_ipython():
55 def check_for_ipython():
56 try:
56 try:
57 import IPython
57 import IPython
58 except ImportError:
58 except ImportError:
59 print_status("IPython", "Not found")
59 print_status("IPython", "Not found")
60 return False
60 return False
61 else:
61 else:
62 print_status("IPython", IPython.__version__)
62 print_status("IPython", IPython.__version__)
63 return True
63 return True
64
64
65 def check_for_sphinx():
65 def check_for_sphinx():
66 try:
66 try:
67 import sphinx
67 import sphinx
68 except ImportError:
68 except ImportError:
69 print_status('sphinx', "Not found (required for building documentation)")
69 print_status('sphinx', "Not found (required for building documentation)")
70 return False
70 return False
71 else:
71 else:
72 print_status('sphinx', sphinx.__version__)
72 print_status('sphinx', sphinx.__version__)
73 return True
73 return True
74
74
75 def check_for_pygments():
75 def check_for_pygments():
76 try:
76 try:
77 import pygments
77 import pygments
78 except ImportError:
78 except ImportError:
79 print_status('pygments', "Not found (required for syntax highlighting documentation)")
79 print_status('pygments', "Not found (required for syntax highlighting documentation)")
80 return False
80 return False
81 else:
81 else:
82 print_status('pygments', pygments.__version__)
82 print_status('pygments', pygments.__version__)
83 return True
83 return True
84
84
85 def check_for_nose():
85 def check_for_nose():
86 try:
86 try:
87 import nose
87 import nose
88 except ImportError:
88 except ImportError:
89 print_status('nose', "Not found (required for running the test suite)")
89 print_status('nose', "Not found (required for running the test suite)")
90 return False
90 return False
91 else:
91 else:
92 print_status('nose', nose.__version__)
92 print_status('nose', nose.__version__)
93 return True
93 return True
94
94
95 def check_for_pexpect():
95 def check_for_pexpect():
96 try:
96 try:
97 import pexpect
97 import pexpect
98 except ImportError:
98 except ImportError:
99 print_status("pexpect", "no (required for running standalone doctests)")
99 print_status("pexpect", "no (required for running standalone doctests)")
100 return False
100 return False
101 else:
101 else:
102 print_status("pexpect", pexpect.__version__)
102 print_status("pexpect", pexpect.__version__)
103 return True
103 return True
104
104
105 def check_for_httplib2():
105 def check_for_httplib2():
106 try:
106 try:
107 import httplib2
107 import httplib2
108 except ImportError:
108 except ImportError:
109 print_status("httplib2", "no (required for blocking http clients)")
109 print_status("httplib2", "no (required for blocking http clients)")
110 return False
110 return False
111 else:
111 else:
112 print_status("httplib2","yes")
112 print_status("httplib2","yes")
113 return True
113 return True
114
114
115 def check_for_sqlalchemy():
115 def check_for_sqlalchemy():
116 try:
116 try:
117 import sqlalchemy
117 import sqlalchemy
118 except ImportError:
118 except ImportError:
119 print_status("sqlalchemy", "no (required for the ipython1 notebook)")
119 print_status("sqlalchemy", "no (required for the ipython1 notebook)")
120 return False
120 return False
121 else:
121 else:
122 print_status("sqlalchemy","yes")
122 print_status("sqlalchemy","yes")
123 return True
123 return True
124
124
125 def check_for_simplejson():
125 def check_for_simplejson():
126 try:
126 try:
127 import simplejson
127 import simplejson
128 except ImportError:
128 except ImportError:
129 print_status("simplejson", "no (required for the ipython1 notebook)")
129 print_status("simplejson", "no (required for the ipython1 notebook)")
130 return False
130 return False
131 else:
131 else:
132 print_status("simplejson","yes")
132 print_status("simplejson","yes")
133 return True
133 return True
134
134
135 def check_for_pyzmq():
135 def check_for_pyzmq():
136 try:
136 try:
137 import zmq
137 import zmq
138 except ImportError:
138 except ImportError:
139 print_status('pyzmq', "no (required for qtconsole and parallel computing capabilities)")
139 print_status('pyzmq', "no (required for qtconsole and parallel computing capabilities)")
140 return False
140 return False
141 else:
141 else:
142 if zmq.__version__ < '2.0.10':
142 if zmq.__version__ < '2.1.4':
143 print_status('pyzmq', "no (require >= 2.0.10 for qtconsole and parallel computing capabilities)")
143 print_status('pyzmq', "no (have %s, but require >= 2.1.4 for"
144 " qtconsole and parallel computing capabilities)"%zmq.__version__)
144
145
145 else:
146 else:
146 print_status("pyzmq", zmq.__version__)
147 print_status("pyzmq", zmq.__version__)
147 return True
148 return True
148
149
149 def check_for_readline():
150 def check_for_readline():
150 try:
151 try:
151 import readline
152 import readline
152 except ImportError:
153 except ImportError:
153 try:
154 try:
154 import pyreadline
155 import pyreadline
155 except ImportError:
156 except ImportError:
156 print_status('readline', "no (required for good interactive behavior)")
157 print_status('readline', "no (required for good interactive behavior)")
157 return False
158 return False
158 else:
159 else:
159 print_status('readline', "yes pyreadline-"+pyreadline.release.version)
160 print_status('readline', "yes pyreadline-"+pyreadline.release.version)
160 return True
161 return True
161 else:
162 else:
162 print_status('readline', "yes")
163 print_status('readline', "yes")
163 return True
164 return True
General Comments 0
You need to be logged in to leave comments. Login now