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