##// END OF EJS Templates
Merge pull request #3675 from minrk/deps...
Min RK -
r11566:109ec3c9 merge
parent child Browse files
Show More
@@ -1,406 +1,425 b''
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 Please let us know if you have problems installing IPython or any of its
10 Please let us know if you have problems installing IPython or any of its
11 dependencies. Officially, IPython requires Python 2.6, 2.7, 3.1, or 3.2.
11 dependencies. Officially, IPython requires Python 2.6, 2.7, 3.1, or 3.2.
12
12
13 .. warning::
13 .. warning::
14
14
15 Since version 0.11, IPython has a hard syntax dependency on 2.6, and will no
15 Since version 0.11, IPython has a hard syntax dependency on 2.6, and will no
16 longer work on Python <= 2.5. You can find older versions of IPython which
16 longer work on Python <= 2.5. You can find older versions of IPython which
17 supported Python <= 2.5 `here <http://archive.ipython.org/release/>`_
17 supported Python <= 2.5 `here <http://archive.ipython.org/release/>`_
18
18
19 Some of the installation approaches use the :mod:`distribute` package and its
19 Some of the installation approaches use the :mod:`distribute` package and its
20 :command:`easy_install` command line program. In many scenarios, this provides
20 :command:`easy_install` command line program. In many scenarios, this provides
21 the most simple method of installing IPython and its dependencies. More
21 the most simple method of installing IPython and its dependencies. More
22 information about :mod:`distribute` can be found on `its PyPI page
22 information about :mod:`distribute` can be found on `its PyPI page
23 <http://pypi.python.org/pypi/distribute>`__.
23 <http://pypi.python.org/pypi/distribute>`__.
24
24
25 .. note::
25 .. note::
26
26
27 On Windows, IPython has a hard dependency on :mod:`distribute`. We hope to
27 On Windows, IPython has a hard dependency on :mod:`distribute`. We hope to
28 change this in the future, but for now on Windows, you *must* install
28 change this in the future, but for now on Windows, you *must* install
29 :mod:`distribute`.
29 :mod:`distribute`.
30
30
31 More general information about installing Python packages can be found in
31 More general information about installing Python packages can be found in
32 `Python's documentation <http://docs.python.org>`_.
32 `Python's documentation <http://docs.python.org>`_.
33
33
34
34
35 Quickstart
35 Quickstart
36 ==========
36 ==========
37
37
38 If you have :mod:`distribute` installed and you are on OS X or Linux (not
38 If you have :mod:`distribute` installed and you are on OS X or Linux (not
39 Windows), the following will download and install IPython *and* the main
39 Windows), the following will download and install IPython *and* the main
40 optional dependencies:
40 optional dependencies:
41
41
42 .. code-block:: bash
42 .. code-block:: bash
43
43
44 $ easy_install ipython[zmq,qtconsole,notebook,test]
44 $ easy_install ipython[all]
45
45
46 This will get:
46 This will get:
47
47
48 - jinja2, needed for the notebook
48 - jinja2, needed for the notebook
49 - sphinx, needed for nbconvert
49 - pyzmq, needed for IPython's parallel computing features, qt console and
50 - pyzmq, needed for IPython's parallel computing features, qt console and
50 notebook.
51 notebook.
51 - pygments, used by the Qt console for syntax highlighting.
52 - pygments, used by nbconvert and the Qt console for syntax highlighting.
52 - tornado, needed by the web-based notebook
53 - tornado, needed by the web-based notebook
53 - nose, used by the test suite.
54 - nose, used by the test suite.
54
55
55 To run IPython's test suite, use the :command:`iptest` command:
56 To run IPython's test suite, use the :command:`iptest` command:
56
57
57 .. code-block:: bash
58 .. code-block:: bash
58
59
59 $ iptest
60 $ iptest
60
61
61
62
62 Installing IPython itself
63 Installing IPython itself
63 =========================
64 =========================
64
65
65 Given a properly built Python, the basic interactive IPython shell will work
66 Given a properly built Python, the basic interactive IPython shell will work
66 with no external dependencies. However, some Python distributions
67 with no external dependencies. However, some Python distributions
67 (particularly on Windows and OS X), don't come with a working :mod:`readline`
68 (particularly on Windows and OS X), don't come with a working :mod:`readline`
68 module. The IPython shell will work without :mod:`readline`, but will lack
69 module. The IPython shell will work without :mod:`readline`, but will lack
69 many features that users depend on, such as tab completion and command line
70 many features that users depend on, such as tab completion and command line
70 editing. If you install IPython with :mod:`distribute`, (e.g. with
71 editing. If you install IPython with :mod:`distribute`, (e.g. with
71 `easy_install`), then the appropriate :mod:`readline` for your platform will be
72 `easy_install`), then the appropriate :mod:`readline` for your platform will be
72 installed. See below for details of how to make sure you have a working
73 installed. See below for details of how to make sure you have a working
73 :mod:`readline`.
74 :mod:`readline`.
74
75
75 Installation using easy_install
76 Installation using easy_install
76 -------------------------------
77 -------------------------------
77
78
78 If you have :mod:`distribute` installed, the easiest way of getting IPython is
79 If you have :mod:`distribute` installed, the easiest way of getting IPython is
79 to simply use :command:`easy_install`:
80 to simply use :command:`easy_install`:
80
81
81 .. code-block:: bash
82 .. code-block:: bash
82
83
83 $ easy_install ipython
84 $ easy_install ipython
84
85
85 That's it.
86 That's it.
86
87
87 Installation from source
88 Installation from source
88 ------------------------
89 ------------------------
89
90
90 If you don't want to use :command:`easy_install`, or don't have it installed,
91 If you don't want to use :command:`easy_install`, or don't have it installed,
91 just grab the latest stable build of IPython from `here
92 just grab the latest stable build of IPython from `here
92 <http://ipython.org/download.html>`_. Then do the following:
93 <http://ipython.org/download.html>`_. Then do the following:
93
94
94 .. code-block:: bash
95 .. code-block:: bash
95
96
96 $ tar -xzf ipython.tar.gz
97 $ tar -xzf ipython.tar.gz
97 $ cd ipython
98 $ cd ipython
98 $ python setup.py install
99 $ python setup.py install
99
100
100 If you are installing to a location (like ``/usr/local``) that requires higher
101 If you are installing to a location (like ``/usr/local``) that requires higher
101 permissions, you may need to run the last command with :command:`sudo`.
102 permissions, you may need to run the last command with :command:`sudo`.
102
103
103 Windows
104 Windows
104 -------
105 -------
105
106
106 As mentioned above, on Windows, IPython requires :mod:`distribute`, and it also
107 As mentioned above, on Windows, IPython requires :mod:`distribute`, and it also
107 requires the PyReadline library to properly support coloring and keyboard
108 requires the PyReadline library to properly support coloring and keyboard
108 management (features that the default windows console doesn't have). So on
109 management (features that the default windows console doesn't have). So on
109 Windows, the installation procedure is:
110 Windows, the installation procedure is:
110
111
111 1. Install `distribute <http://pypi.python.org/pypi/distribute>`_.
112 1. Install `distribute <http://pypi.python.org/pypi/distribute>`_.
112
113
113 2. Install `pyreadline <http://pypi.python.org/pypi/pyreadline>`_. You can use
114 2. Install `pyreadline <http://pypi.python.org/pypi/pyreadline>`_. You can use
114 the command ``easy_install pyreadline`` from a terminal, or the binary
115 the command ``easy_install pyreadline`` from a terminal, or the binary
115 installer appropriate for your platform from the PyPI page.
116 installer appropriate for your platform from the PyPI page.
116
117
117 3. Install IPython itself, which you can download from `PyPI
118 3. Install IPython itself, which you can download from `PyPI
118 <http://pypi.python.org/pypi/ipython>`_ or from `our site
119 <http://pypi.python.org/pypi/ipython>`_ or from `our site
119 <http://ipython.org/download.html>`_. Note that on Windows 7, you *must*
120 <http://ipython.org/download.html>`_. Note that on Windows 7, you *must*
120 right-click and 'Run as administrator' for the Start menu shortcuts to be
121 right-click and 'Run as administrator' for the Start menu shortcuts to be
121 created.
122 created.
122
123
123 IPython by default runs in a terminal window, but the normal terminal
124 IPython by default runs in a terminal window, but the normal terminal
124 application supplied by Microsoft Windows is very primitive. You may want to
125 application supplied by Microsoft Windows is very primitive. You may want to
125 download the excellent and free Console_ application instead, which is a far
126 download the excellent and free Console_ application instead, which is a far
126 superior tool. You can even configure Console to give you by default an
127 superior tool. You can even configure Console to give you by default an
127 IPython tab, which is very convenient to create new IPython sessions directly
128 IPython tab, which is very convenient to create new IPython sessions directly
128 from the working terminal.
129 from the working terminal.
129
130
130 .. _Console: http://sourceforge.net/projects/console
131 .. _Console: http://sourceforge.net/projects/console
131
132
132
133
133 Installing the development version
134 Installing the development version
134 ----------------------------------
135 ----------------------------------
135
136
136 It is also possible to install the development version of IPython from our
137 It is also possible to install the development version of IPython from our
137 `Git <http://git-scm.com/>`_ source code repository. To do this you will
138 `Git <http://git-scm.com/>`_ source code repository. To do this you will
138 need to have Git installed on your system. Then just do:
139 need to have Git installed on your system. Then just do:
139
140
140 .. code-block:: bash
141 .. code-block:: bash
141
142
142 $ git clone https://github.com/ipython/ipython.git
143 $ git clone https://github.com/ipython/ipython.git
143 $ cd ipython
144 $ cd ipython
144 $ python setup.py install
145 $ python setup.py install
145
146
146 Some users want to be able to follow the development branch as it changes. If
147 Some users want to be able to follow the development branch as it changes. If
147 you have :mod:`distribute` installed, this is easy. Simply replace the last
148 you have :mod:`distribute` installed, this is easy. Simply replace the last
148 step by:
149 step by:
149
150
150 .. code-block:: bash
151 .. code-block:: bash
151
152
152 $ python setupegg.py develop
153 $ python setupegg.py develop
153
154
154 This creates links in the right places and installs the command line script to
155 This creates links in the right places and installs the command line script to
155 the appropriate places. Then, if you want to update your IPython at any time,
156 the appropriate places. Then, if you want to update your IPython at any time,
156 just do:
157 just do:
157
158
158 .. code-block:: bash
159 .. code-block:: bash
159
160
160 $ git pull
161 $ git pull
161
162
162
163
163 Basic optional dependencies
164 Basic optional dependencies
164 ===========================
165 ===========================
165
166
166 There are a number of basic optional dependencies that most users will want to
167 There are a number of basic optional dependencies that most users will want to
167 get. These are:
168 get. These are:
168
169
169 * readline (for command line editing, tab completion, etc.)
170 * readline (for command line editing, tab completion, etc.)
170 * nose (to run the IPython test suite)
171 * nose (to run the IPython test suite)
171 * pexpect (to use things like irunner)
172 * pexpect (to use things like irunner)
172
173
173 If you are comfortable installing these things yourself, have at it, otherwise
174 If you are comfortable installing these things yourself, have at it, otherwise
174 read on for more details.
175 read on for more details.
175
176
176 readline
177 readline
177 --------
178 --------
178
179
179 As indicated above, on Windows, PyReadline is a *mandatory* dependency.
180 As indicated above, on Windows, PyReadline is a *mandatory* dependency.
180 PyReadline is a separate, Windows only implementation of readline that uses
181 PyReadline is a separate, Windows only implementation of readline that uses
181 native Windows calls through :mod:`ctypes`. The easiest way of installing
182 native Windows calls through :mod:`ctypes`. The easiest way of installing
182 PyReadline is you use the binary installer available `here
183 PyReadline is you use the binary installer available `here
183 <http://pypi.python.org/pypi/pyreadline>`_.
184 <http://pypi.python.org/pypi/pyreadline>`_.
184
185
185 On OSX, if you are using the built-in Python shipped by Apple, you will be
186 On OSX, if you are using the built-in Python shipped by Apple, you will be
186 missing a full readline implementation as Apple ships instead a library called
187 missing a full readline implementation as Apple ships instead a library called
187 ``libedit`` that provides only some of readline's functionality. While you may
188 ``libedit`` that provides only some of readline's functionality. While you may
188 find libedit sufficient, we have occasional reports of bugs with it and several
189 find libedit sufficient, we have occasional reports of bugs with it and several
189 developers who use OS X as their main environment consider libedit unacceptable
190 developers who use OS X as their main environment consider libedit unacceptable
190 for productive, regular use with IPython.
191 for productive, regular use with IPython.
191
192
192 Therefore, we *strongly* recommend that on OS X you get the full
193 Therefore, we *strongly* recommend that on OS X you get the full
193 :mod:`readline` module. We will *not* consider completion/history problems to
194 :mod:`readline` module. We will *not* consider completion/history problems to
194 be bugs for IPython if you are using libedit.
195 be bugs for IPython if you are using libedit.
195
196
196 To get a working :mod:`readline` module, just do (with :mod:`distribute`
197 To get a working :mod:`readline` module, just do (with :mod:`distribute`
197 installed):
198 installed):
198
199
199 .. code-block:: bash
200 .. code-block:: bash
200
201
201 $ easy_install readline
202 $ easy_install readline
202
203
203 .. note::
204 .. note::
204
205
205 Other Python distributions on OS X (such as fink, MacPorts and the official
206 Other Python distributions on OS X (such as fink, MacPorts and the official
206 python.org binaries) already have readline installed so you likely don't
207 python.org binaries) already have readline installed so you likely don't
207 have to do this step.
208 have to do this step.
208
209
209 When IPython is installed with :mod:`distribute`, (e.g. using the
210 When IPython is installed with :mod:`distribute`, (e.g. using the
210 ``easy_install`` command), readline is added as a dependency on OS X, and
211 ``easy_install`` command), readline is added as a dependency on OS X, and
211 PyReadline on Windows, and will be installed on your system. However, if you
212 PyReadline on Windows, and will be installed on your system. However, if you
212 do not use distribute, you may have to install one of these packages yourself.
213 do not use distribute, you may have to install one of these packages yourself.
213
214
214
215
215 nose
216 nose
216 ----
217 ----
217
218
218 To run the IPython test suite you will need the :mod:`nose` package. Nose
219 To run the IPython test suite you will need the :mod:`nose` package. Nose
219 provides a great way of sniffing out and running all of the IPython tests. The
220 provides a great way of sniffing out and running all of the IPython tests. The
220 simplest way of getting nose, is to use :command:`easy_install`:
221 simplest way of getting nose, is to use :command:`easy_install`:
221
222
222 .. code-block:: bash
223 .. code-block:: bash
223
224
224 $ easy_install nose
225 $ easy_install nose
225
226
226 Another way of getting this is to do:
227 Another way of getting this is to do:
227
228
228 .. code-block:: bash
229 .. code-block:: bash
229
230
230 $ easy_install ipython[test]
231 $ easy_install ipython[test]
231
232
232 For more installation options, see the `nose website
233 For more installation options, see the `nose website
233 <http://somethingaboutorange.com/mrl/projects/nose/>`_.
234 <http://somethingaboutorange.com/mrl/projects/nose/>`_.
234
235
235 Once you have nose installed, you can run IPython's test suite using the
236 Once you have nose installed, you can run IPython's test suite using the
236 iptest command:
237 iptest command:
237
238
238 .. code-block:: bash
239 .. code-block:: bash
239
240
240 $ iptest
241 $ iptest
241
242
242 pexpect
243 pexpect
243 -------
244 -------
244
245
245 The pexpect_ package is used in IPython's :command:`irunner` script, as well as
246 The pexpect_ package is used in IPython's :command:`irunner` script, as well as
246 for managing subprocesses. IPython now includes a version of pexpect in
247 for managing subprocesses. IPython now includes a version of pexpect in
247 :mod:`IPython.external`, but if you have installed pexpect, IPython will use
248 :mod:`IPython.external`, but if you have installed pexpect, IPython will use
248 that instead. On Unix platforms (including OS X), just do:
249 that instead. On Unix platforms (including OS X), just do:
249
250
250 .. code-block:: bash
251 .. code-block:: bash
251
252
252 $ easy_install pexpect
253 $ easy_install pexpect
253
254
254 Windows users are out of luck as pexpect does not run there.
255 Windows users are out of luck as pexpect does not run there.
255
256
256 Dependencies for IPython.parallel (parallel computing)
257 Dependencies for IPython.parallel (parallel computing)
257 ======================================================
258 ======================================================
258
259
259 :mod:`IPython.kernel` has been replaced by :mod:`IPython.parallel`,
260 :mod:`IPython.kernel` has been replaced by :mod:`IPython.parallel`,
260 which uses ZeroMQ for all communication.
261 which uses ZeroMQ for all communication.
261
262
262 IPython.parallel provides a nice architecture for parallel computing, with a
263 IPython.parallel provides a nice architecture for parallel computing, with a
263 focus on fluid interactive workflows. These features require just one package:
264 focus on fluid interactive workflows. These features require just one package:
264 PyZMQ. See the next section for PyZMQ details.
265 PyZMQ. See the next section for PyZMQ details.
265
266
266 On a Unix style platform (including OS X), if you want to use
267 On a Unix style platform (including OS X), if you want to use
267 :mod:`distribute`, you can just do:
268 :mod:`distribute`, you can just do:
268
269
269 .. code-block:: bash
270 .. code-block:: bash
270
271
271 $ easy_install ipython[zmq] # will include pyzmq
272 $ easy_install ipython[zmq] # will include pyzmq
272
273
273 Security in IPython.parallel is provided by SSH tunnels. By default, Linux
274 Security in IPython.parallel is provided by SSH tunnels. By default, Linux
274 and OSX clients will use the shell ssh command, but on Windows, we also
275 and OSX clients will use the shell ssh command, but on Windows, we also
275 support tunneling with paramiko_.
276 support tunneling with paramiko_.
276
277
277 Dependencies for IPython.kernel.zmq
278 Dependencies for IPython.kernel.zmq
278 ============================
279 ===================================
279
280
280 pyzmq
281 pyzmq
281 -----
282 -----
282
283
283 IPython 0.11 introduced some new functionality, including a two-process
284 IPython 0.11 introduced some new functionality, including a two-process
284 execution model using ZeroMQ_ for communication. The Python bindings to ZeroMQ
285 execution model using ZeroMQ_ for communication. The Python bindings to ZeroMQ
285 are found in the PyZMQ_ project, which is easy_install-able once you have
286 are found in the PyZMQ_ project, which is easy_install-able once you have
286 ZeroMQ installed. If you are on Python 2.6 or 2.7 on OSX, or 2.7 on Windows,
287 ZeroMQ installed. If you are on Python 2.6 or 2.7 on OSX, or 2.7 on Windows,
287 pyzmq has eggs that include ZeroMQ itself.
288 pyzmq has eggs that include ZeroMQ itself.
288
289
289 IPython.kernel.zmq depends on pyzmq >= 2.1.4.
290 IPython.kernel.zmq depends on pyzmq >= 2.1.4.
290
291
291 Dependencies for the IPython QT console
292 Dependencies for the IPython QT console
292 =======================================
293 =======================================
293
294
294 pyzmq
295 pyzmq
295 -----
296 -----
296
297
297 Like the :mod:`IPython.parallel` package, the QT Console requires ZeroMQ and
298 Like the :mod:`IPython.parallel` package, the QT Console requires ZeroMQ and
298 PyZMQ.
299 PyZMQ.
299
300
300 Qt
301 Qt
301 --
302 --
302
303
303 Also with 0.11, a new GUI was added using the work in :mod:`IPython.kernel.zmq`, which
304 Also with 0.11, a new GUI was added using the work in :mod:`IPython.kernel.zmq`, which
304 can be launched with ``ipython qtconsole``. The GUI is built on Qt, and works
305 can be launched with ``ipython qtconsole``. The GUI is built on Qt, and works
305 with either PyQt, which can be installed from the `PyQt website
306 with either PyQt, which can be installed from the `PyQt website
306 <http://www.riverbankcomputing.co.uk/>`_, or `PySide
307 <http://www.riverbankcomputing.co.uk/>`_, or `PySide
307 <http://www.pyside.org/>`_, from Nokia.
308 <http://www.pyside.org/>`_, from Nokia.
308
309
309 pygments
310 pygments
310 --------
311 --------
311
312
312 The syntax-highlighting in ``ipython qtconsole`` is done with the pygments_
313 The syntax-highlighting in ``ipython qtconsole`` is done with the pygments_
313 project, which is easy_install-able.
314 project, which is easy_install-able.
314
315
315 .. _installnotebook:
316 .. _installnotebook:
316
317
317 Dependencies for the IPython HTML notebook
318 Dependencies for the IPython HTML notebook
318 ==========================================
319 ==========================================
319
320
320 The IPython notebook is a notebook-style web interface to IPython and can be
321 The IPython notebook is a notebook-style web interface to IPython and can be
321 started withe command ``ipython notebook``.
322 started withe command ``ipython notebook``.
322
323
323 pyzmq
324 pyzmq
324 -----
325 -----
325
326
326 Like the :mod:`IPython.parallel` and :mod:`IPython.frontend.qt.console`
327 Like the :mod:`IPython.parallel` and :mod:`IPython.frontend.qt.console`
327 packages, the HTML notebook requires ZeroMQ and PyZMQ.
328 packages, the HTML notebook requires ZeroMQ and PyZMQ.
328
329
329 Tornado
330 Tornado
330 -------
331 -------
331
332
332 The IPython notebook uses the Tornado_ project for its HTTP server. Tornado 2.1
333 The IPython notebook uses the Tornado_ project for its HTTP server. Tornado 2.1
333 is required, in order to support current versions of browsers, due to an update
334 is required, in order to support current versions of browsers, due to an update
334 to the websocket protocol.
335 to the websocket protocol.
335
336
336 Jinja
337 Jinja
337 -----
338 -----
338
339
339 The IPython notebook uses the Jinja_ templating tool to render HTML pages.
340 The IPython notebook uses the Jinja_ templating tool to render HTML pages.
340
341
341
342
342 MathJax
343 MathJax
343 -------
344 -------
344
345
345 The IPython notebook uses the MathJax_ Javascript library for rendering LaTeX
346 The IPython notebook uses the MathJax_ Javascript library for rendering LaTeX
346 in web browsers. Because MathJax is large, we don't include it with
347 in web browsers. Because MathJax is large, we don't include it with
347 IPython. Normally IPython will load MathJax from a CDN, but if you have a slow
348 IPython. Normally IPython will load MathJax from a CDN, but if you have a slow
348 network connection, or want to use LaTeX without an internet connection at all,
349 network connection, or want to use LaTeX without an internet connection at all,
349 you can install MathJax locally.
350 you can install MathJax locally.
350
351
351 A quick and easy method is to install it from a python session::
352 A quick and easy method is to install it from a python session::
352
353
353 from IPython.external.mathjax import install_mathjax
354 from IPython.external.mathjax import install_mathjax
354 install_mathjax()
355 install_mathjax()
355
356
356 If you need tighter configuration control, you can download your own copy
357 If you need tighter configuration control, you can download your own copy
357 of MathJax from http://www.mathjax.org/download/ - use the MathJax-2.0 link.
358 of MathJax from http://www.mathjax.org/download/ - use the MathJax-2.0 link.
358 When you have the file stored locally, install it with::
359 When you have the file stored locally, install it with::
359
360
360 python -m IPython.external.mathjax /path/to/source/mathjax-MathJax-v2.0-20-g07669ac.zip
361 python -m IPython.external.mathjax /path/to/source/mathjax-MathJax-v2.0-20-g07669ac.zip
361
362
362 For unusual needs, IPython can tell you what directory it wants to find MathJax in::
363 For unusual needs, IPython can tell you what directory it wants to find MathJax in::
363
364
364 python -m IPython.external.mathjax -d /some/other/mathjax
365 python -m IPython.external.mathjax -d /some/other/mathjax
365
366
366 By default Mathjax will be installed in your ipython profile directory, but you
367 By default Mathjax will be installed in your ipython profile directory, but you
367 can make system wide install, please refer to the documentation and helper function
368 can make system wide install, please refer to the documentation and helper function
368 of :mod:`IPython.external.mathjax`
369 of :mod:`IPython.external.mathjax`
369
370
370 Browser Compatibility
371 Browser Compatibility
371 ---------------------
372 ---------------------
372
373
373 The IPython notebook is officially supported on the following browers:
374 The IPython notebook is officially supported on the following browers:
374
375
375 * Chrome β‰₯ 13
376 * Chrome β‰₯ 13
376 * Safari β‰₯ 5
377 * Safari β‰₯ 5
377 * Firefox β‰₯ 6
378 * Firefox β‰₯ 6
378
379
379 The is mainly due to the notebook's usage of WebSockets and the flexible box model.
380 The is mainly due to the notebook's usage of WebSockets and the flexible box model.
380
381
381 The following browsers are unsupported:
382 The following browsers are unsupported:
382
383
383 * Safari < 5
384 * Safari < 5
384 * Firefox < 6
385 * Firefox < 6
385 * Chrome < 13
386 * Chrome < 13
386 * Opera (any): CSS issues, but execution might work
387 * Opera (any): CSS issues, but execution might work
387 * Internet Explorer < 10
388 * Internet Explorer < 10
388
389
389 The following specific combinations are known **NOT** to work:
390 The following specific combinations are known **NOT** to work:
390
391
391 * Safari, IPython 0.12, tornado β‰₯ 2.2.0
392 * Safari, IPython 0.12, tornado β‰₯ 2.2.0
392 * Safari with HTTPS connection to notebook and an untrusted certificate (websockets will fail)
393 * Safari with HTTPS connection to notebook and an untrusted certificate (websockets will fail)
393 * The [diigo Chrome extension](http://help.diigo.com/tools/chrome-extension) seems to interfere with scrolling
394 * The [diigo Chrome extension](http://help.diigo.com/tools/chrome-extension) seems to interfere with scrolling
394
395
395 There are some early reports that the Notebook works on Internet Explorer 10, but we
396 There are some early reports that the Notebook works on Internet Explorer 10, but we
396 expect there will be some CSS issues related to the flexible box model.
397 expect there will be some CSS issues related to the flexible box model.
397
398
398
399
400 Dependencies for nbconvert (converting notebooks to various formats)
401 ====================================================================
402
403 pandoc
404 ------
405
406 The most important dependency of nbconvert is Pandoc_, a document format translation program.
407 This is not a Python package, so it cannot be expressed as a regular IPython dependency with setuptools.
408
409 To install pandoc on Linux, you can generally use your package manager::
410
411 sudo apt-get install pandoc
412
413 On other platforms, you can get pandoc from `their website <http://johnmacfarlane.net/pandoc/installing.html>`_.
414
415
399 .. _ZeroMQ: http://www.zeromq.org
416 .. _ZeroMQ: http://www.zeromq.org
400 .. _PyZMQ: https://github.com/zeromq/pyzmq
417 .. _PyZMQ: https://github.com/zeromq/pyzmq
401 .. _paramiko: https://github.com/robey/paramiko
418 .. _paramiko: https://github.com/robey/paramiko
402 .. _pygments: http://pygments.org
419 .. _pygments: http://pygments.org
403 .. _pexpect: http://www.noah.org/wiki/Pexpect
420 .. _pexpect: http://www.noah.org/wiki/Pexpect
404 .. _Jinja: http://jinja.pocoo.org
421 .. _Jinja: http://jinja.pocoo.org
422 .. _Sphinx: http://sphinx-doc.org
423 .. _pandoc: http://johnmacfarlane.net/pandoc
405 .. _Tornado: http://www.tornadoweb.org
424 .. _Tornado: http://www.tornadoweb.org
406 .. _MathJax: http://www.mathjax.org
425 .. _MathJax: http://www.mathjax.org
@@ -1,348 +1,356 b''
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-2011, IPython Development Team.
10 # Copyright (c) 2008-2011, 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 from __future__ import print_function
23 from __future__ import print_function
24
24
25 import sys
25 import sys
26
26
27 # This check is also made in IPython/__init__, don't forget to update both when
27 # This check is also made in IPython/__init__, don't forget to update both when
28 # changing Python version requirements.
28 # changing Python version requirements.
29 #~ if sys.version[0:3] < '2.6':
29 #~ if sys.version[0:3] < '2.6':
30 #~ error = """\
30 #~ error = """\
31 #~ ERROR: 'IPython requires Python Version 2.6 or above.'
31 #~ ERROR: 'IPython requires Python Version 2.6 or above.'
32 #~ Exiting."""
32 #~ Exiting."""
33 #~ print >> sys.stderr, error
33 #~ print >> sys.stderr, error
34 #~ sys.exit(1)
34 #~ sys.exit(1)
35
35
36 PY3 = (sys.version_info[0] >= 3)
36 PY3 = (sys.version_info[0] >= 3)
37
37
38 # At least we're on the python version we need, move on.
38 # At least we're on the python version we need, move on.
39
39
40 #-------------------------------------------------------------------------------
40 #-------------------------------------------------------------------------------
41 # Imports
41 # Imports
42 #-------------------------------------------------------------------------------
42 #-------------------------------------------------------------------------------
43
43
44 # Stdlib imports
44 # Stdlib imports
45 import os
45 import os
46 import shutil
46 import shutil
47
47
48 from glob import glob
48 from glob import glob
49
49
50 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
50 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
51 # update it when the contents of directories change.
51 # update it when the contents of directories change.
52 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
52 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
53
53
54 from distutils.core import setup
54 from distutils.core import setup
55
55
56 # On Python 3, we need distribute (new setuptools) to do the 2to3 conversion
56 # On Python 3, we need distribute (new setuptools) to do the 2to3 conversion
57 if PY3:
57 if PY3:
58 import setuptools
58 import setuptools
59
59
60 # Our own imports
60 # Our own imports
61 from setupbase import target_update
61 from setupbase import target_update
62
62
63 from setupbase import (
63 from setupbase import (
64 setup_args,
64 setup_args,
65 find_packages,
65 find_packages,
66 find_package_data,
66 find_package_data,
67 find_scripts,
67 find_scripts,
68 find_data_files,
68 find_data_files,
69 check_for_dependencies,
69 check_for_dependencies,
70 git_prebuild,
70 git_prebuild,
71 check_submodule_status,
71 check_submodule_status,
72 update_submodules,
72 update_submodules,
73 require_submodules,
73 require_submodules,
74 UpdateSubmodules,
74 UpdateSubmodules,
75 )
75 )
76 from setupext import setupext
76 from setupext import setupext
77
77
78 isfile = os.path.isfile
78 isfile = os.path.isfile
79 pjoin = os.path.join
79 pjoin = os.path.join
80
80
81 #-----------------------------------------------------------------------------
81 #-----------------------------------------------------------------------------
82 # Function definitions
82 # Function definitions
83 #-----------------------------------------------------------------------------
83 #-----------------------------------------------------------------------------
84
84
85 def cleanup():
85 def cleanup():
86 """Clean up the junk left around by the build process"""
86 """Clean up the junk left around by the build process"""
87 if "develop" not in sys.argv and "egg_info" not in sys.argv:
87 if "develop" not in sys.argv and "egg_info" not in sys.argv:
88 try:
88 try:
89 shutil.rmtree('ipython.egg-info')
89 shutil.rmtree('ipython.egg-info')
90 except:
90 except:
91 try:
91 try:
92 os.unlink('ipython.egg-info')
92 os.unlink('ipython.egg-info')
93 except:
93 except:
94 pass
94 pass
95
95
96 #-------------------------------------------------------------------------------
96 #-------------------------------------------------------------------------------
97 # Handle OS specific things
97 # Handle OS specific things
98 #-------------------------------------------------------------------------------
98 #-------------------------------------------------------------------------------
99
99
100 if os.name in ('nt','dos'):
100 if os.name in ('nt','dos'):
101 os_name = 'windows'
101 os_name = 'windows'
102 else:
102 else:
103 os_name = os.name
103 os_name = os.name
104
104
105 # Under Windows, 'sdist' has not been supported. Now that the docs build with
105 # Under Windows, 'sdist' has not been supported. Now that the docs build with
106 # Sphinx it might work, but let's not turn it on until someone confirms that it
106 # Sphinx it might work, but let's not turn it on until someone confirms that it
107 # actually works.
107 # actually works.
108 if os_name == 'windows' and 'sdist' in sys.argv:
108 if os_name == 'windows' and 'sdist' in sys.argv:
109 print('The sdist command is not available under Windows. Exiting.')
109 print('The sdist command is not available under Windows. Exiting.')
110 sys.exit(1)
110 sys.exit(1)
111
111
112 #-------------------------------------------------------------------------------
112 #-------------------------------------------------------------------------------
113 # Make sure we aren't trying to run without submodules
113 # Make sure we aren't trying to run without submodules
114 #-------------------------------------------------------------------------------
114 #-------------------------------------------------------------------------------
115 here = os.path.abspath(os.path.dirname(__file__))
115 here = os.path.abspath(os.path.dirname(__file__))
116
116
117 def require_clean_submodules():
117 def require_clean_submodules():
118 """Check on git submodules before distutils can do anything
118 """Check on git submodules before distutils can do anything
119
119
120 Since distutils cannot be trusted to update the tree
120 Since distutils cannot be trusted to update the tree
121 after everything has been set in motion,
121 after everything has been set in motion,
122 this is not a distutils command.
122 this is not a distutils command.
123 """
123 """
124 # PACKAGERS: Add a return here to skip checks for git submodules
124 # PACKAGERS: Add a return here to skip checks for git submodules
125
125
126 # don't do anything if nothing is actually supposed to happen
126 # don't do anything if nothing is actually supposed to happen
127 for do_nothing in ('-h', '--help', '--help-commands', 'clean', 'submodule'):
127 for do_nothing in ('-h', '--help', '--help-commands', 'clean', 'submodule'):
128 if do_nothing in sys.argv:
128 if do_nothing in sys.argv:
129 return
129 return
130
130
131 status = check_submodule_status(here)
131 status = check_submodule_status(here)
132
132
133 if status == "missing":
133 if status == "missing":
134 print("checking out submodules for the first time")
134 print("checking out submodules for the first time")
135 update_submodules(here)
135 update_submodules(here)
136 elif status == "unclean":
136 elif status == "unclean":
137 print('\n'.join([
137 print('\n'.join([
138 "Cannot build / install IPython with unclean submodules",
138 "Cannot build / install IPython with unclean submodules",
139 "Please update submodules with",
139 "Please update submodules with",
140 " python setup.py submodule",
140 " python setup.py submodule",
141 "or",
141 "or",
142 " git submodule update",
142 " git submodule update",
143 "or commit any submodule changes you have made."
143 "or commit any submodule changes you have made."
144 ]))
144 ]))
145 sys.exit(1)
145 sys.exit(1)
146
146
147 require_clean_submodules()
147 require_clean_submodules()
148
148
149 #-------------------------------------------------------------------------------
149 #-------------------------------------------------------------------------------
150 # Things related to the IPython documentation
150 # Things related to the IPython documentation
151 #-------------------------------------------------------------------------------
151 #-------------------------------------------------------------------------------
152
152
153 # update the manuals when building a source dist
153 # update the manuals when building a source dist
154 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
154 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
155 import textwrap
155 import textwrap
156
156
157 # List of things to be updated. Each entry is a triplet of args for
157 # List of things to be updated. Each entry is a triplet of args for
158 # target_update()
158 # target_update()
159 to_update = [
159 to_update = [
160 # FIXME - Disabled for now: we need to redo an automatic way
160 # FIXME - Disabled for now: we need to redo an automatic way
161 # of generating the magic info inside the rst.
161 # of generating the magic info inside the rst.
162 #('docs/magic.tex',
162 #('docs/magic.tex',
163 #['IPython/Magic.py'],
163 #['IPython/Magic.py'],
164 #"cd doc && ./update_magic.sh" ),
164 #"cd doc && ./update_magic.sh" ),
165
165
166 ('docs/man/ipcluster.1.gz',
166 ('docs/man/ipcluster.1.gz',
167 ['docs/man/ipcluster.1'],
167 ['docs/man/ipcluster.1'],
168 'cd docs/man && gzip -9c ipcluster.1 > ipcluster.1.gz'),
168 'cd docs/man && gzip -9c ipcluster.1 > ipcluster.1.gz'),
169
169
170 ('docs/man/ipcontroller.1.gz',
170 ('docs/man/ipcontroller.1.gz',
171 ['docs/man/ipcontroller.1'],
171 ['docs/man/ipcontroller.1'],
172 'cd docs/man && gzip -9c ipcontroller.1 > ipcontroller.1.gz'),
172 'cd docs/man && gzip -9c ipcontroller.1 > ipcontroller.1.gz'),
173
173
174 ('docs/man/ipengine.1.gz',
174 ('docs/man/ipengine.1.gz',
175 ['docs/man/ipengine.1'],
175 ['docs/man/ipengine.1'],
176 'cd docs/man && gzip -9c ipengine.1 > ipengine.1.gz'),
176 'cd docs/man && gzip -9c ipengine.1 > ipengine.1.gz'),
177
177
178 ('docs/man/iplogger.1.gz',
178 ('docs/man/iplogger.1.gz',
179 ['docs/man/iplogger.1'],
179 ['docs/man/iplogger.1'],
180 'cd docs/man && gzip -9c iplogger.1 > iplogger.1.gz'),
180 'cd docs/man && gzip -9c iplogger.1 > iplogger.1.gz'),
181
181
182 ('docs/man/ipython.1.gz',
182 ('docs/man/ipython.1.gz',
183 ['docs/man/ipython.1'],
183 ['docs/man/ipython.1'],
184 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
184 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
185
185
186 ('docs/man/irunner.1.gz',
186 ('docs/man/irunner.1.gz',
187 ['docs/man/irunner.1'],
187 ['docs/man/irunner.1'],
188 'cd docs/man && gzip -9c irunner.1 > irunner.1.gz'),
188 'cd docs/man && gzip -9c irunner.1 > irunner.1.gz'),
189
189
190 ('docs/man/pycolor.1.gz',
190 ('docs/man/pycolor.1.gz',
191 ['docs/man/pycolor.1'],
191 ['docs/man/pycolor.1'],
192 'cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz'),
192 'cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz'),
193 ]
193 ]
194
194
195
195
196 [ target_update(*t) for t in to_update ]
196 [ target_update(*t) for t in to_update ]
197
197
198 #---------------------------------------------------------------------------
198 #---------------------------------------------------------------------------
199 # Find all the packages, package data, and data_files
199 # Find all the packages, package data, and data_files
200 #---------------------------------------------------------------------------
200 #---------------------------------------------------------------------------
201
201
202 packages = find_packages()
202 packages = find_packages()
203 package_data = find_package_data()
203 package_data = find_package_data()
204 data_files = find_data_files()
204 data_files = find_data_files()
205
205
206 setup_args['packages'] = packages
206 setup_args['packages'] = packages
207 setup_args['package_data'] = package_data
207 setup_args['package_data'] = package_data
208 setup_args['data_files'] = data_files
208 setup_args['data_files'] = data_files
209
209
210 #---------------------------------------------------------------------------
210 #---------------------------------------------------------------------------
211 # custom distutils commands
211 # custom distutils commands
212 #---------------------------------------------------------------------------
212 #---------------------------------------------------------------------------
213 # imports here, so they are after setuptools import if there was one
213 # imports here, so they are after setuptools import if there was one
214 from distutils.command.sdist import sdist
214 from distutils.command.sdist import sdist
215 from distutils.command.upload import upload
215 from distutils.command.upload import upload
216
216
217 class UploadWindowsInstallers(upload):
217 class UploadWindowsInstallers(upload):
218
218
219 description = "Upload Windows installers to PyPI (only used from tools/release_windows.py)"
219 description = "Upload Windows installers to PyPI (only used from tools/release_windows.py)"
220 user_options = upload.user_options + [
220 user_options = upload.user_options + [
221 ('files=', 'f', 'exe file (or glob) to upload')
221 ('files=', 'f', 'exe file (or glob) to upload')
222 ]
222 ]
223 def initialize_options(self):
223 def initialize_options(self):
224 upload.initialize_options(self)
224 upload.initialize_options(self)
225 meta = self.distribution.metadata
225 meta = self.distribution.metadata
226 base = '{name}-{version}'.format(
226 base = '{name}-{version}'.format(
227 name=meta.get_name(),
227 name=meta.get_name(),
228 version=meta.get_version()
228 version=meta.get_version()
229 )
229 )
230 self.files = os.path.join('dist', '%s.*.exe' % base)
230 self.files = os.path.join('dist', '%s.*.exe' % base)
231
231
232 def run(self):
232 def run(self):
233 for dist_file in glob(self.files):
233 for dist_file in glob(self.files):
234 self.upload_file('bdist_wininst', 'any', dist_file)
234 self.upload_file('bdist_wininst', 'any', dist_file)
235
235
236 setup_args['cmdclass'] = {
236 setup_args['cmdclass'] = {
237 'build_py': git_prebuild('IPython'),
237 'build_py': git_prebuild('IPython'),
238 'sdist' : git_prebuild('IPython', sdist),
238 'sdist' : git_prebuild('IPython', sdist),
239 'upload_wininst' : UploadWindowsInstallers,
239 'upload_wininst' : UploadWindowsInstallers,
240 'submodule' : UpdateSubmodules,
240 'submodule' : UpdateSubmodules,
241 }
241 }
242
242
243 #---------------------------------------------------------------------------
243 #---------------------------------------------------------------------------
244 # Handle scripts, dependencies, and setuptools specific things
244 # Handle scripts, dependencies, and setuptools specific things
245 #---------------------------------------------------------------------------
245 #---------------------------------------------------------------------------
246
246
247 # For some commands, use setuptools. Note that we do NOT list install here!
247 # For some commands, use setuptools. Note that we do NOT list install here!
248 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
248 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
249 needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
249 needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
250 'bdist', 'bdist_dumb', 'bdist_wininst', 'install_egg_info',
250 'bdist', 'bdist_dumb', 'bdist_wininst', 'install_egg_info',
251 'egg_info', 'easy_install', 'upload',
251 'egg_info', 'easy_install', 'upload',
252 ))
252 ))
253 if sys.platform == 'win32':
253 if sys.platform == 'win32':
254 # Depend on setuptools for install on *Windows only*
254 # Depend on setuptools for install on *Windows only*
255 # If we get script-installation working without setuptools,
255 # If we get script-installation working without setuptools,
256 # then we can back off, but until then use it.
256 # then we can back off, but until then use it.
257 # See Issue #369 on GitHub for more
257 # See Issue #369 on GitHub for more
258 needs_setuptools.add('install')
258 needs_setuptools.add('install')
259
259
260 if len(needs_setuptools.intersection(sys.argv)) > 0:
260 if len(needs_setuptools.intersection(sys.argv)) > 0:
261 import setuptools
261 import setuptools
262
262
263 # This dict is used for passing extra arguments that are setuptools
263 # This dict is used for passing extra arguments that are setuptools
264 # specific to setup
264 # specific to setup
265 setuptools_extra_args = {}
265 setuptools_extra_args = {}
266
266
267 if 'setuptools' in sys.modules:
267 if 'setuptools' in sys.modules:
268 # setup.py develop should check for submodules
268 # setup.py develop should check for submodules
269 from setuptools.command.develop import develop
269 from setuptools.command.develop import develop
270 setup_args['cmdclass']['develop'] = require_submodules(develop)
270 setup_args['cmdclass']['develop'] = require_submodules(develop)
271
271
272 setuptools_extra_args['zip_safe'] = False
272 setuptools_extra_args['zip_safe'] = False
273 setuptools_extra_args['entry_points'] = find_scripts(True)
273 setuptools_extra_args['entry_points'] = find_scripts(True)
274 setup_args['extras_require'] = dict(
274 setup_args['extras_require'] = dict(
275 parallel = 'pyzmq>=2.1.11',
275 parallel = 'pyzmq>=2.1.11',
276 qtconsole = ['pyzmq>=2.1.11', 'pygments'],
276 qtconsole = ['pyzmq>=2.1.11', 'pygments'],
277 zmq = 'pyzmq>=2.1.11',
277 zmq = 'pyzmq>=2.1.11',
278 doc = 'Sphinx>=0.3',
278 doc = 'Sphinx>=0.3',
279 test = 'nose>=0.10.1',
279 test = 'nose>=0.10.1',
280 notebook = ['tornado>=2.0', 'pyzmq>=2.1.11', 'jinja2'],
280 notebook = ['tornado>=2.0', 'pyzmq>=2.1.11', 'jinja2'],
281 nbconvert = ['pygments', 'jinja2', 'Sphinx>=0.3']
281 nbconvert = ['pygments', 'jinja2', 'Sphinx>=0.3']
282 )
282 )
283 everything = set()
284 for deps in setup_args['extras_require'].values():
285 if not isinstance(deps, list):
286 deps = [deps]
287 for dep in deps:
288 everything.add(dep)
289 setup_args['extras_require']['all'] = everything
290
283 requires = setup_args.setdefault('install_requires', [])
291 requires = setup_args.setdefault('install_requires', [])
284 setupext.display_status = False
292 setupext.display_status = False
285 if not setupext.check_for_readline():
293 if not setupext.check_for_readline():
286 if sys.platform == 'darwin':
294 if sys.platform == 'darwin':
287 requires.append('readline')
295 requires.append('readline')
288 elif sys.platform.startswith('win'):
296 elif sys.platform.startswith('win'):
289 # Pyreadline 64 bit windows issue solved in versions >=1.7.1
297 # Pyreadline 64 bit windows issue solved in versions >=1.7.1
290 # Also solves issues with some older versions of pyreadline that
298 # Also solves issues with some older versions of pyreadline that
291 # satisfy the unconstrained depdendency.
299 # satisfy the unconstrained depdendency.
292 requires.append('pyreadline>=1.7.1')
300 requires.append('pyreadline>=1.7.1')
293 else:
301 else:
294 pass
302 pass
295 # do we want to install readline here?
303 # do we want to install readline here?
296
304
297 # Script to be run by the windows binary installer after the default setup
305 # Script to be run by the windows binary installer after the default setup
298 # routine, to add shortcuts and similar windows-only things. Windows
306 # routine, to add shortcuts and similar windows-only things. Windows
299 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
307 # post-install scripts MUST reside in the scripts/ dir, otherwise distutils
300 # doesn't find them.
308 # doesn't find them.
301 if 'bdist_wininst' in sys.argv:
309 if 'bdist_wininst' in sys.argv:
302 if len(sys.argv) > 2 and \
310 if len(sys.argv) > 2 and \
303 ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
311 ('sdist' in sys.argv or 'bdist_rpm' in sys.argv):
304 print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
312 print >> sys.stderr, "ERROR: bdist_wininst must be run alone. Exiting."
305 sys.exit(1)
313 sys.exit(1)
306 setup_args['data_files'].append(
314 setup_args['data_files'].append(
307 ['Scripts', ('scripts/ipython.ico', 'scripts/ipython_nb.ico')])
315 ['Scripts', ('scripts/ipython.ico', 'scripts/ipython_nb.ico')])
308 setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
316 setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
309 setup_args['options'] = {"bdist_wininst":
317 setup_args['options'] = {"bdist_wininst":
310 {"install_script":
318 {"install_script":
311 "ipython_win_post_install.py"}}
319 "ipython_win_post_install.py"}}
312
320
313 if PY3:
321 if PY3:
314 setuptools_extra_args['use_2to3'] = True
322 setuptools_extra_args['use_2to3'] = True
315 # we try to make a 2.6, 2.7, and 3.1 to 3.3 python compatible code
323 # we try to make a 2.6, 2.7, and 3.1 to 3.3 python compatible code
316 # so we explicitly disable some 2to3 fixes to be sure we aren't forgetting
324 # so we explicitly disable some 2to3 fixes to be sure we aren't forgetting
317 # anything.
325 # anything.
318 setuptools_extra_args['use_2to3_exclude_fixers'] = [
326 setuptools_extra_args['use_2to3_exclude_fixers'] = [
319 'lib2to3.fixes.fix_apply',
327 'lib2to3.fixes.fix_apply',
320 'lib2to3.fixes.fix_except',
328 'lib2to3.fixes.fix_except',
321 'lib2to3.fixes.fix_has_key',
329 'lib2to3.fixes.fix_has_key',
322 'lib2to3.fixes.fix_next',
330 'lib2to3.fixes.fix_next',
323 'lib2to3.fixes.fix_repr',
331 'lib2to3.fixes.fix_repr',
324 'lib2to3.fixes.fix_tuple_params',
332 'lib2to3.fixes.fix_tuple_params',
325 ]
333 ]
326 from setuptools.command.build_py import build_py
334 from setuptools.command.build_py import build_py
327 setup_args['cmdclass'] = {'build_py': git_prebuild('IPython', build_cmd=build_py)}
335 setup_args['cmdclass'] = {'build_py': git_prebuild('IPython', build_cmd=build_py)}
328 setuptools_extra_args['entry_points'] = find_scripts(True, suffix='3')
336 setuptools_extra_args['entry_points'] = find_scripts(True, suffix='3')
329 setuptools._dont_write_bytecode = True
337 setuptools._dont_write_bytecode = True
330 else:
338 else:
331 # If we are running without setuptools, call this function which will
339 # If we are running without setuptools, call this function which will
332 # check for dependencies an inform the user what is needed. This is
340 # check for dependencies an inform the user what is needed. This is
333 # just to make life easy for users.
341 # just to make life easy for users.
334 check_for_dependencies()
342 check_for_dependencies()
335 setup_args['scripts'] = find_scripts(False)
343 setup_args['scripts'] = find_scripts(False)
336
344
337 #---------------------------------------------------------------------------
345 #---------------------------------------------------------------------------
338 # Do the actual setup now
346 # Do the actual setup now
339 #---------------------------------------------------------------------------
347 #---------------------------------------------------------------------------
340
348
341 setup_args.update(setuptools_extra_args)
349 setup_args.update(setuptools_extra_args)
342
350
343 def main():
351 def main():
344 setup(**setup_args)
352 setup(**setup_args)
345 cleanup()
353 cleanup()
346
354
347 if __name__ == '__main__':
355 if __name__ == '__main__':
348 main()
356 main()
General Comments 0
You need to be logged in to leave comments. Login now