Show More
@@ -6,7 +6,7 b' Credits' | |||||
6 |
|
6 | |||
7 | IPython is led by Fernando Pérez. |
|
7 | IPython is led by Fernando Pérez. | |
8 |
|
8 | |||
9 |
As of |
|
9 | As of this writing, the following developers have joined the core team: | |
10 |
|
10 | |||
11 | * [Robert Kern] <rkern-AT-enthought.com>: co-mentored the 2005 |
|
11 | * [Robert Kern] <rkern-AT-enthought.com>: co-mentored the 2005 | |
12 | Google Summer of Code project to develop python interactive |
|
12 | Google Summer of Code project to develop python interactive | |
@@ -24,6 +24,20 b' As of early 2006, the following developers have joined the core team:' | |||||
24 | to the core of IPython and was the maintainer of the main IPython |
|
24 | to the core of IPython and was the maintainer of the main IPython | |
25 | trunk from version 0.7.1 to 0.8.4. |
|
25 | trunk from version 0.7.1 to 0.8.4. | |
26 |
|
26 | |||
|
27 | * [Gael Varoquaux] <gael.varoquaux-AT-normalesup.org>: work on the merged | |||
|
28 | architecture for the interpreter as of version 0.9, implementing a new WX GUI | |||
|
29 | based on this system. | |||
|
30 | ||||
|
31 | * [Barry Wark] <barrywark-AT-gmail.com>: implementing a new Cocoa GUI, as well | |||
|
32 | as work on the new interpreter architecture and Twisted support. | |||
|
33 | ||||
|
34 | * [Laurent Dufrechou] <laurent.dufrechou-AT-gmail.com>: development of the WX | |||
|
35 | GUI support. | |||
|
36 | ||||
|
37 | * [Jörgen Stenarson] <jorgen.stenarson-AT-bostream.nu>: maintainer of the | |||
|
38 | PyReadline project, necessary for IPython under windows. | |||
|
39 | ||||
|
40 | ||||
27 | The IPython project is also very grateful to: |
|
41 | The IPython project is also very grateful to: | |
28 |
|
42 | |||
29 | Bill Bumgarner <bbum-AT-friday.com>: for providing the DPyGetOpt module |
|
43 | Bill Bumgarner <bbum-AT-friday.com>: for providing the DPyGetOpt module | |
@@ -51,9 +65,9 b" an O'Reilly Python editor. His Oct/11/2001 article about IPP and" | |||||
51 | LazyPython, was what got this project started. You can read it at: |
|
65 | LazyPython, was what got this project started. You can read it at: | |
52 | http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html. |
|
66 | http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html. | |
53 |
|
67 | |||
54 | And last but not least, all the kind IPython users who have emailed new |
|
68 | And last but not least, all the kind IPython users who have emailed new code, | |
55 |
|
|
69 | bug reports, fixes, comments and ideas. A brief list follows, please let us | |
56 |
|
|
70 | know if we have ommitted your name by accident: | |
57 |
|
71 | |||
58 | * Dan Milstein <danmil-AT-comcast.net>. A bold refactoring of the |
|
72 | * Dan Milstein <danmil-AT-comcast.net>. A bold refactoring of the | |
59 | core prefilter stuff in the IPython interpreter. |
|
73 | core prefilter stuff in the IPython interpreter. | |
@@ -185,4 +199,9 b' please let me know if I have ommitted your name by accident:' | |||||
185 | * [Alexander Belchenko] <bialix-AT-ukr.net> Improvements for win32 |
|
199 | * [Alexander Belchenko] <bialix-AT-ukr.net> Improvements for win32 | |
186 | paging system. |
|
200 | paging system. | |
187 |
|
201 | |||
188 | * [Will Maier] <willmaier-AT-ml1.net> Official OpenBSD port. No newline at end of file |
|
202 | * [Will Maier] <willmaier-AT-ml1.net> Official OpenBSD port. | |
|
203 | ||||
|
204 | * [Ondrej Certik] <ondrej@certik.cz>: set up the IPython docs to use the new | |||
|
205 | Sphinx system used by Python, Matplotlib and many more projects. | |||
|
206 | ||||
|
207 | * [Stefan van der Walt] <stefan@sun.ac.za>: support for the new config system. |
@@ -24,11 +24,11 b' There are two, no three, main goals of the IPython effort:' | |||||
24 | to be used from within a variety of GUI applications. |
|
24 | to be used from within a variety of GUI applications. | |
25 | 3. Implement a system for interactive parallel computing. |
|
25 | 3. Implement a system for interactive parallel computing. | |
26 |
|
26 | |||
27 |
While the third goal may seem a bit unrelated to the main focus of IPython, it |
|
27 | While the third goal may seem a bit unrelated to the main focus of IPython, it | |
28 |
out that the technologies required for this goal are nearly identical |
|
28 | turns out that the technologies required for this goal are nearly identical | |
29 |
required for goal two. This is the main reason the interactive |
|
29 | with those required for goal two. This is the main reason the interactive | |
30 |
capabilities are being put into IPython proper. Currently |
|
30 | parallel computing capabilities are being put into IPython proper. Currently | |
31 | furthest along. |
|
31 | the third of these goals is furthest along. | |
32 |
|
32 | |||
33 | This document describes IPython from the perspective of developers. |
|
33 | This document describes IPython from the perspective of developers. | |
34 |
|
34 | |||
@@ -39,51 +39,59 b' Project organization' | |||||
39 | Subpackages |
|
39 | Subpackages | |
40 | ----------- |
|
40 | ----------- | |
41 |
|
41 | |||
42 |
IPython is organized into semi self-contained subpackages. Each of the |
|
42 | IPython is organized into semi self-contained subpackages. Each of the | |
|
43 | subpackages will have its own: | |||
43 |
|
44 | |||
44 | - **Dependencies**. One of the most important things to keep in mind in |
|
45 | - **Dependencies**. One of the most important things to keep in mind in | |
45 | partitioning code amongst subpackages, is that they should be used to cleanly |
|
46 | partitioning code amongst subpackages, is that they should be used to cleanly | |
46 |
encapsulate dependencies. |
|
47 | encapsulate dependencies. | |
|
48 | ||||
47 | - **Tests**. Each subpackage shoud have its own ``tests`` subdirectory that |
|
49 | - **Tests**. Each subpackage shoud have its own ``tests`` subdirectory that | |
48 |
contains all of the tests for that package. For information about writing |
|
50 | contains all of the tests for that package. For information about writing | |
49 | for IPython, see the `Testing System`_ section of this document. |
|
51 | tests for IPython, see the `Testing System`_ section of this document. | |
50 | - **Configuration**. Each subpackage should have its own ``config`` subdirectory |
|
52 | ||
51 | that contains the configuration information for the components of the |
|
53 | - **Configuration**. Each subpackage should have its own ``config`` | |
52 | subpackage. For information about how the IPython configuration system |
|
54 | subdirectory that contains the configuration information for the components | |
53 | works, see the `Configuration System`_ section of this document. |
|
55 | of the subpackage. For information about how the IPython configuration | |
54 | - **Scripts**. Each subpackage should have its own ``scripts`` subdirectory that |
|
56 | system works, see the `Configuration System`_ section of this document. | |
55 | contains all of the command line scripts associated with the subpackage. |
|
57 | ||
|
58 | - **Scripts**. Each subpackage should have its own ``scripts`` subdirectory | |||
|
59 | that contains all of the command line scripts associated with the subpackage. | |||
56 |
|
60 | |||
57 | Installation and dependencies |
|
61 | Installation and dependencies | |
58 | ----------------------------- |
|
62 | ----------------------------- | |
59 |
|
63 | |||
60 |
IPython will not use `setuptools`_ for installation. Instead, we will use |
|
64 | IPython will not use `setuptools`_ for installation. Instead, we will use | |
61 |
``setup.py`` scripts that use `distutils`_. While there are a number a |
|
65 | standard ``setup.py`` scripts that use `distutils`_. While there are a number a | |
62 |
features that `setuptools`_ has (like namespace packages), the |
|
66 | extremely nice features that `setuptools`_ has (like namespace packages), the | |
63 |
of `setuptools`_ has performance problems, particularly |
|
67 | current implementation of `setuptools`_ has performance problems, particularly | |
64 |
particular, when Python packages are installed on |
|
68 | on shared file systems. In particular, when Python packages are installed on | |
65 |
become much too long (up towards 10 seconds). |
|
69 | NSF file systems, import times become much too long (up towards 10 seconds). | |
66 |
|
70 | |||
67 | Because IPython is being used extensively in the context of high performance |
|
71 | Because IPython is being used extensively in the context of high performance | |
68 |
computing, where performance is critical but shared file systems are common, we |
|
72 | computing, where performance is critical but shared file systems are common, we | |
69 |
these performance hits are not acceptable. Thus, until the performance |
|
73 | feel these performance hits are not acceptable. Thus, until the performance | |
70 |
associated with `setuptools`_ are addressed, we will stick with plain |
|
74 | problems associated with `setuptools`_ are addressed, we will stick with plain | |
71 |
are hopeful that these problems will be addressed and that we |
|
75 | `distutils`_. We are hopeful that these problems will be addressed and that we | |
72 |
using `setuptools`_. Because of this, we are trying to |
|
76 | will eventually begin using `setuptools`_. Because of this, we are trying to | |
73 | will make the eventual transition to `setuptools`_ as painless as possible. |
|
77 | organize IPython in a way that will make the eventual transition to | |
74 |
|
78 | `setuptools`_ as painless as possible. | ||
75 | Because we will be using `distutils`_, there will be no method for automatically installing dependencies. Instead, we are following the approach of `Matplotlib`_ which can be summarized as follows: |
|
79 | ||
|
80 | Because we will be using `distutils`_, there will be no method for | |||
|
81 | automatically installing dependencies. Instead, we are following the approach | |||
|
82 | of `Matplotlib`_ which can be summarized as follows: | |||
76 |
|
83 | |||
77 | - Distinguish between required and optional dependencies. However, the required |
|
84 | - Distinguish between required and optional dependencies. However, the required | |
78 | dependencies for IPython should be only the Python standard library. |
|
85 | dependencies for IPython should be only the Python standard library. | |
79 | - Upon installation check to see which optional dependencies are present and tell |
|
86 | ||
80 | the user which parts of IPython need which optional dependencies. |
|
87 | - Upon installation check to see which optional dependencies are present and | |
|
88 | tell the user which parts of IPython need which optional dependencies. | |||
81 |
|
89 | |||
82 |
It is absolutely critical that each subpackage of IPython has a clearly |
|
90 | It is absolutely critical that each subpackage of IPython has a clearly | |
83 |
of dependencies and that dependencies are not carelessly |
|
91 | specified set of dependencies and that dependencies are not carelessly | |
84 |
subpackages. Furthermore, tests that have certain |
|
92 | inherited from other IPython subpackages. Furthermore, tests that have certain | |
85 | those dependencies are not present. Instead they should be skipped and print a |
|
93 | dependencies should not fail if those dependencies are not present. Instead | |
86 | message. |
|
94 | they should be skipped and print a message. | |
87 |
|
95 | |||
88 | .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools |
|
96 | .. _setuptools: http://peak.telecommunity.com/DevCenter/setuptools | |
89 | .. _distutils: http://docs.python.org/lib/module-distutils.html |
|
97 | .. _distutils: http://docs.python.org/lib/module-distutils.html | |
@@ -106,9 +114,10 b' Specific subpackages' | |||||
106 |
|
114 | |||
107 | ``frontends`` |
|
115 | ``frontends`` | |
108 | The various frontends for IPython. A frontend is the end-user application |
|
116 | The various frontends for IPython. A frontend is the end-user application | |
109 |
that exposes the capabilities of IPython to the user. The most basic |
|
117 | that exposes the capabilities of IPython to the user. The most basic | |
110 |
will simply be a terminal based application that looks just like |
|
118 | frontend will simply be a terminal based application that looks just like | |
111 |
IPython. Other frontends will likely be more powerful and based |
|
119 | today 's IPython. Other frontends will likely be more powerful and based | |
|
120 | on GUI toolkits. | |||
112 |
|
121 | |||
113 | ``notebook`` |
|
122 | ``notebook`` | |
114 | An application that allows users to work with IPython notebooks. |
|
123 | An application that allows users to work with IPython notebooks. | |
@@ -120,10 +129,12 b' Specific subpackages' | |||||
120 | Version control |
|
129 | Version control | |
121 | =============== |
|
130 | =============== | |
122 |
|
131 | |||
123 |
In the past, IPython development has been done using `Subversion`__. Recently, |
|
132 | In the past, IPython development has been done using `Subversion`__. Recently, | |
124 | to contribute code to IPython. Here is a sketch of how to use Bazaar for IPython |
|
133 | we made the transition to using `Bazaar`__ and `Launchpad`__. This makes it | |
125 | development. First, you should install Bazaar. After you have done that, make |
|
134 | much easier for people to contribute code to IPython. Here is a sketch of how | |
126 | sure that it is working by getting the latest main branch of IPython:: |
|
135 | to use Bazaar for IPython development. First, you should install Bazaar. | |
|
136 | After you have done that, make sure that it is working by getting the latest | |||
|
137 | main branch of IPython:: | |||
127 |
|
138 | |||
128 | $ bzr branch lp:ipython |
|
139 | $ bzr branch lp:ipython | |
129 |
|
140 | |||
@@ -131,17 +142,17 b' Now you can create a new branch for you to do your work in::' | |||||
131 |
|
142 | |||
132 | $ bzr branch ipython ipython-mybranch |
|
143 | $ bzr branch ipython ipython-mybranch | |
133 |
|
144 | |||
134 |
The typical work cycle in this branch will be to make changes in |
|
145 | The typical work cycle in this branch will be to make changes in | |
135 | and then commit those changes using the commit command:: |
|
146 | ``ipython-mybranch`` and then commit those changes using the commit command:: | |
136 |
|
147 | |||
137 | $ ...do work in ipython-mybranch... |
|
148 | $ ...do work in ipython-mybranch... | |
138 | $ bzr ci -m "the commit message goes here" |
|
149 | $ bzr ci -m "the commit message goes here" | |
139 |
|
150 | |||
140 | Please note that since we now don't use an old-style linear ChangeLog |
|
151 | Please note that since we now don't use an old-style linear ChangeLog (that | |
141 |
|
|
152 | tends to cause problems with distributed version control systems), you should | |
142 |
|
|
153 | ensure that your log messages are reasonably detailed. Use a docstring-like | |
143 | detailed. Use a docstring-like approach in the commit messages |
|
154 | approach in the commit messages (including the second line being left | |
144 | (including the second line being left *blank*):: |
|
155 | *blank*):: | |
145 |
|
156 | |||
146 | Single line summary of changes being committed. |
|
157 | Single line summary of changes being committed. | |
147 |
|
158 | |||
@@ -149,27 +160,27 b' detailed. Use a docstring-like approach in the commit messages' | |||||
149 | - including crediting outside contributors if they sent the |
|
160 | - including crediting outside contributors if they sent the | |
150 | code/bug/idea! |
|
161 | code/bug/idea! | |
151 |
|
162 | |||
152 | If we couple this with a policy of making single commits for each |
|
163 | If we couple this with a policy of making single commits for each reasonably | |
153 |
|
|
164 | atomic change, the bzr log should give an excellent view of the project, and | |
154 |
|
|
165 | the `--short` log option becomes a nice summary. | |
155 |
|
166 | |||
156 |
While working with this branch, it is a good idea to merge in changes that have |
|
167 | While working with this branch, it is a good idea to merge in changes that have | |
157 | made upstream in the parent branch. This can be done by doing:: |
|
168 | been made upstream in the parent branch. This can be done by doing:: | |
158 |
|
169 | |||
159 | $ bzr pull |
|
170 | $ bzr pull | |
160 |
|
171 | |||
161 |
If this command shows that the branches have diverged, then you should do a |
|
172 | If this command shows that the branches have diverged, then you should do a | |
162 | instead:: |
|
173 | merge instead:: | |
163 |
|
174 | |||
164 | $ bzr merge lp:ipython |
|
175 | $ bzr merge lp:ipython | |
165 |
|
176 | |||
166 |
If you want others to be able to see your branch, you can create an account |
|
177 | If you want others to be able to see your branch, you can create an account | |
167 | launchpad and push the branch to your own workspace:: |
|
178 | with launchpad and push the branch to your own workspace:: | |
168 |
|
179 | |||
169 | $ bzr push bzr+ssh://<me>@bazaar.launchpad.net/~<me>/+junk/ipython-mybranch |
|
180 | $ bzr push bzr+ssh://<me>@bazaar.launchpad.net/~<me>/+junk/ipython-mybranch | |
170 |
|
181 | |||
171 |
Finally, once the work in your branch is done, you can merge your changes back |
|
182 | Finally, once the work in your branch is done, you can merge your changes back | |
172 | the `ipython` branch by using merge:: |
|
183 | into the `ipython` branch by using merge:: | |
173 |
|
184 | |||
174 | $ cd ipython |
|
185 | $ cd ipython | |
175 | $ merge ../ipython-mybranch |
|
186 | $ merge ../ipython-mybranch | |
@@ -177,8 +188,9 b' the `ipython` branch by using merge::' | |||||
177 | $ bzr ci -m "Fixing that bug" |
|
188 | $ bzr ci -m "Fixing that bug" | |
178 | $ bzr push |
|
189 | $ bzr push | |
179 |
|
190 | |||
180 |
But this will require you to have write permissions to the `ipython` branch. |
|
191 | But this will require you to have write permissions to the `ipython` branch. | |
181 |
you can tell one of the IPython devs about your branch and they |
|
192 | It you don't you can tell one of the IPython devs about your branch and they | |
|
193 | can do the merge for you. | |||
182 |
|
194 | |||
183 | More information about Bazaar workflows can be found `here`__. |
|
195 | More information about Bazaar workflows can be found `here`__. | |
184 |
|
196 | |||
@@ -193,27 +205,29 b' Documentation' | |||||
193 | Standalone documentation |
|
205 | Standalone documentation | |
194 | ------------------------ |
|
206 | ------------------------ | |
195 |
|
207 | |||
196 |
All standalone documentation should be written in plain text (``.txt``) files |
|
208 | All standalone documentation should be written in plain text (``.txt``) files | |
197 |
`reStructuredText`_ for markup and formatting. All such documentation |
|
209 | using `reStructuredText`_ for markup and formatting. All such documentation | |
198 |
in the top level directory ``docs`` of the IPython source |
|
210 | should be placed in the top level directory ``docs`` of the IPython source | |
199 |
a suitably named subdirectory should be used. The |
|
211 | tree. Or, when appropriate, a suitably named subdirectory should be used. The | |
200 | serve as the main source for IPython documentation and all existing documentation |
|
212 | documentation in this location will serve as the main source for IPython | |
201 | should be converted to this format. |
|
213 | documentation and all existing documentation should be converted to this | |
|
214 | format. | |||
202 |
|
215 | |||
203 |
In the future, the text files in the ``docs`` directory will be used to |
|
216 | In the future, the text files in the ``docs`` directory will be used to | |
204 |
forms of documentation for IPython. This include documentation on |
|
217 | generate all forms of documentation for IPython. This include documentation on | |
205 | as well as *pdf* documentation. |
|
218 | the IPython website as well as *pdf* documentation. | |
206 |
|
219 | |||
207 | .. _reStructuredText: http://docutils.sourceforge.net/rst.html |
|
220 | .. _reStructuredText: http://docutils.sourceforge.net/rst.html | |
208 |
|
221 | |||
209 | Docstring format |
|
222 | Docstring format | |
210 | ---------------- |
|
223 | ---------------- | |
211 |
|
224 | |||
212 |
Good docstrings are very important. All new code will use `Epydoc`_ for |
|
225 | Good docstrings are very important. All new code will use `Epydoc`_ for | |
213 |
docs, so we will follow the `Epydoc`_ conventions. More |
|
226 | generating API docs, so we will follow the `Epydoc`_ conventions. More | |
214 |
`reStructuredText`_ for markup and formatting, since |
|
227 | specifically, we will use `reStructuredText`_ for markup and formatting, since | |
215 |
variety of tools. This means that if in the future |
|
228 | it is understood by a wide variety of tools. This means that if in the future | |
216 |
`Epydoc`_ to something else, we'll have fewer |
|
229 | we have any reason to change from `Epydoc`_ to something else, we'll have fewer | |
|
230 | transition pains. | |||
217 |
|
231 | |||
218 | Details about using `reStructuredText`_ for docstrings can be found `here |
|
232 | Details about using `reStructuredText`_ for docstrings can be found `here | |
219 | <http://epydoc.sourceforge.net/manual-othermarkup.html>`_. |
|
233 | <http://epydoc.sourceforge.net/manual-othermarkup.html>`_. | |
@@ -233,7 +247,8 b' Coding conventions' | |||||
233 | General |
|
247 | General | |
234 | ------- |
|
248 | ------- | |
235 |
|
249 | |||
236 |
In general, we'll try to follow the standard Python style conventions as |
|
250 | In general, we'll try to follow the standard Python style conventions as | |
|
251 | described here: | |||
237 |
|
252 | |||
238 | - `Style Guide for Python Code <http://www.python.org/peps/pep-0008.html>`_ |
|
253 | - `Style Guide for Python Code <http://www.python.org/peps/pep-0008.html>`_ | |
239 |
|
254 | |||
@@ -250,8 +265,8 b' Other comments:' | |||||
250 | Naming conventions |
|
265 | Naming conventions | |
251 | ------------------ |
|
266 | ------------------ | |
252 |
|
267 | |||
253 |
In terms of naming conventions, we'll follow the guidelines from the `Style |
|
268 | In terms of naming conventions, we'll follow the guidelines from the `Style | |
254 | Python Code`_. |
|
269 | Guide for Python Code`_. | |
255 |
|
270 | |||
256 | For all new IPython code (and much existing code is being refactored), we'll use: |
|
271 | For all new IPython code (and much existing code is being refactored), we'll use: | |
257 |
|
272 | |||
@@ -259,67 +274,81 b" For all new IPython code (and much existing code is being refactored), we'll use" | |||||
259 |
|
274 | |||
260 | - ``CamelCase`` for class names. |
|
275 | - ``CamelCase`` for class names. | |
261 |
|
276 | |||
262 |
- ``lowercase_with_underscores`` for methods, functions, variables and |
|
277 | - ``lowercase_with_underscores`` for methods, functions, variables and | |
|
278 | attributes. | |||
263 |
|
279 | |||
264 | This may be confusing as most of the existing IPython codebase uses a different convention (``lowerCamelCase`` for methods and attributes). Slowly, we will move IPython over to the new |
|
280 | This may be confusing as most of the existing IPython codebase uses a different | |
265 | convention, providing shadow names for backward compatibility in public interfaces. |
|
281 | convention (``lowerCamelCase`` for methods and attributes). Slowly, we will | |
|
282 | move IPython over to the new convention, providing shadow names for backward | |||
|
283 | compatibility in public interfaces. | |||
266 |
|
284 | |||
267 |
There are, however, some important exceptions to these rules. In some cases, |
|
285 | There are, however, some important exceptions to these rules. In some cases, | |
268 | code will interface with packages (Twisted, Wx, Qt) that use other conventions. At some level this makes it impossible to adhere to our own standards at all times. In particular, when subclassing classes that use other naming conventions, you must follow their naming conventions. To deal with cases like this, we propose the following policy: |
|
286 | IPython code will interface with packages (Twisted, Wx, Qt) that use other | |
|
287 | conventions. At some level this makes it impossible to adhere to our own | |||
|
288 | standards at all times. In particular, when subclassing classes that use other | |||
|
289 | naming conventions, you must follow their naming conventions. To deal with | |||
|
290 | cases like this, we propose the following policy: | |||
269 |
|
291 | |||
270 | - If you are subclassing a class that uses different conventions, use its |
|
292 | - If you are subclassing a class that uses different conventions, use its | |
271 |
naming conventions throughout your subclass. Thus, if you are creating a |
|
293 | naming conventions throughout your subclass. Thus, if you are creating a | |
272 |
Twisted Protocol class, used Twisted's |
|
294 | Twisted Protocol class, used Twisted's | |
273 |
|
295 | ``namingSchemeForMethodsAndAttributes.`` | ||
274 | - All IPython's official interfaces should use our conventions. In some cases |
|
296 | ||
275 | this will mean that you need to provide shadow names (first implement ``fooBar`` |
|
297 | - All IPython's official interfaces should use our conventions. In some cases | |
276 | and then ``foo_bar = fooBar``). We want to avoid this at all costs, but it |
|
298 | this will mean that you need to provide shadow names (first implement | |
277 | will probably be necessary at times. But, please use this sparingly! |
|
299 | ``fooBar`` and then ``foo_bar = fooBar``). We want to avoid this at all | |
278 |
|
300 | costs, but it will probably be necessary at times. But, please use this | ||
279 | Implementation-specific *private* methods will use ``_single_underscore_prefix``. |
|
301 | sparingly! | |
280 | Names with a leading double underscore will *only* be used in special cases, as they |
|
302 | ||
281 | makes subclassing difficult (such names are not easily seen by child classes). |
|
303 | Implementation-specific *private* methods will use | |
282 |
|
304 | ``_single_underscore_prefix``. Names with a leading double underscore will | ||
283 | Occasionally some run-in lowercase names are used, but mostly for very short names or |
|
305 | *only* be used in special cases, as they makes subclassing difficult (such | |
284 | where we are implementing methods very similar to existing ones in a base class (like |
|
306 | names are not easily seen by child classes). | |
285 | ``runlines()`` where ``runsource()`` and ``runcode()`` had established precedent). |
|
307 | ||
|
308 | Occasionally some run-in lowercase names are used, but mostly for very short | |||
|
309 | names or where we are implementing methods very similar to existing ones in a | |||
|
310 | base class (like ``runlines()`` where ``runsource()`` and ``runcode()`` had | |||
|
311 | established precedent). | |||
286 |
|
312 | |||
287 | The old IPython codebase has a big mix of classes and modules prefixed with an |
|
313 | The old IPython codebase has a big mix of classes and modules prefixed with an | |
288 |
explicit ``IP``. In Python this is mostly unnecessary, redundant and frowned |
|
314 | explicit ``IP``. In Python this is mostly unnecessary, redundant and frowned | |
289 |
namespaces offer cleaner prefixing. The only case where this approach |
|
315 | upon, as namespaces offer cleaner prefixing. The only case where this approach | |
290 |
for classes which are expected to be imported into external |
|
316 | is justified is for classes which are expected to be imported into external | |
291 |
generic name (like Shell) is too likely to clash with |
|
317 | namespaces and a very generic name (like Shell) is too likely to clash with | |
292 | revisit this issue as we clean up and refactor the code, but in general we should |
|
318 | something else. We'll need to revisit this issue as we clean up and refactor | |
293 | remove as many unnecessary ``IP``/``ip`` prefixes as possible. However, if a prefix |
|
319 | the code, but in general we should remove as many unnecessary ``IP``/``ip`` | |
294 | seems absolutely necessary the more specific ``IPY`` or ``ipy`` are preferred. |
|
320 | prefixes as possible. However, if a prefix seems absolutely necessary the more | |
|
321 | specific ``IPY`` or ``ipy`` are preferred. | |||
295 |
|
322 | |||
296 | .. _devel_testing: |
|
323 | .. _devel_testing: | |
297 |
|
324 | |||
298 | Testing system |
|
325 | Testing system | |
299 | ============== |
|
326 | ============== | |
300 |
|
327 | |||
301 |
It is extremely important that all code contributed to IPython has tests. Tests |
|
328 | It is extremely important that all code contributed to IPython has tests. Tests | |
302 |
be written as unittests, doctests or as entities that the `Nose`_ |
|
329 | should be written as unittests, doctests or as entities that the `Nose`_ | |
303 |
find. Regardless of how the tests are written, we will use |
|
330 | testing package will find. Regardless of how the tests are written, we will use | |
304 |
running the tests. `Nose`_ will be required to run |
|
331 | `Nose`_ for discovering and running the tests. `Nose`_ will be required to run | |
305 | not be required to simply use IPython. |
|
332 | the IPython test suite, but will not be required to simply use IPython. | |
306 |
|
333 | |||
307 | .. _Nose: http://code.google.com/p/python-nose/ |
|
334 | .. _Nose: http://code.google.com/p/python-nose/ | |
308 |
|
335 | |||
309 |
Tests of `Twisted`__ using code should be written by subclassing the |
|
336 | Tests of `Twisted`__ using code should be written by subclassing the | |
310 |
that comes with ``twisted.trial.unittest``. When this is |
|
337 | ``TestCase`` class that comes with ``twisted.trial.unittest``. When this is | |
311 |
run the tests and the twisted reactor will be |
|
338 | done, `Nose`_ will be able to run the tests and the twisted reactor will be | |
|
339 | handled correctly. | |||
312 |
|
340 | |||
313 | .. __: http://www.twistedmatrix.com |
|
341 | .. __: http://www.twistedmatrix.com | |
314 |
|
342 | |||
315 |
Each subpackage in IPython should have its own ``tests`` directory that |
|
343 | Each subpackage in IPython should have its own ``tests`` directory that | |
316 |
of the tests for that subpackage. This allows each subpackage to |
|
344 | contains all of the tests for that subpackage. This allows each subpackage to | |
317 |
a subpackage has any dependencies beyond the Python |
|
345 | be self-contained. If a subpackage has any dependencies beyond the Python | |
318 | that subpackage should be skipped if the dependencies are not found. This is very |
|
346 | standard library, the tests for that subpackage should be skipped if the | |
319 | important so users don't get tests failing simply because they don't have dependencies. |
|
347 | dependencies are not found. This is very important so users don't get tests | |
|
348 | failing simply because they don't have dependencies. | |||
320 |
|
349 | |||
321 |
We also need to look into use Noses ability to tag tests to allow a more |
|
350 | We also need to look into use Noses ability to tag tests to allow a more | |
322 | approach of running tests. |
|
351 | modular approach of running tests. | |
323 |
|
352 | |||
324 | .. _devel_config: |
|
353 | .. _devel_config: | |
325 |
|
354 | |||
@@ -327,23 +356,25 b' Configuration system' | |||||
327 | ==================== |
|
356 | ==================== | |
328 |
|
357 | |||
329 | IPython uses `.ini`_ files for configuration purposes. This represents a huge |
|
358 | IPython uses `.ini`_ files for configuration purposes. This represents a huge | |
330 |
improvement over the configuration system used in IPython. IPython works with |
|
359 | improvement over the configuration system used in IPython. IPython works with | |
331 | files using the `ConfigObj`_ package, which IPython includes as |
|
360 | these files using the `ConfigObj`_ package, which IPython includes as | |
332 | ``ipython1/external/configobj.py``. |
|
361 | ``ipython1/external/configobj.py``. | |
333 |
|
362 | |||
334 |
Currently, we are using raw `ConfigObj`_ objects themselves. Each subpackage of |
|
363 | Currently, we are using raw `ConfigObj`_ objects themselves. Each subpackage of | |
335 |
should contain a ``config`` subdirectory that contains all of the |
|
364 | IPython should contain a ``config`` subdirectory that contains all of the | |
336 |
information for the subpackage. To see how configuration |
|
365 | configuration information for the subpackage. To see how configuration | |
337 | with defaults) see at the examples in ``ipython1/kernel/config`` and |
|
366 | information is defined (along with defaults) see at the examples in | |
338 | ``ipython1/core/config``. Likewise, to see how the configuration information is used, |
|
367 | ``ipython1/kernel/config`` and ``ipython1/core/config``. Likewise, to see how | |
339 | see examples in ``ipython1/kernel/scripts/ipengine.py``. |
|
368 | the configuration information is used, see examples in | |
340 |
|
369 | ``ipython1/kernel/scripts/ipengine.py``. | ||
341 | Eventually, we will add a new layer on top of the raw `ConfigObj`_ objects. We are |
|
370 | ||
342 | calling this new layer, ``tconfig``, as it will use a `Traits`_-like validation model. |
|
371 | Eventually, we will add a new layer on top of the raw `ConfigObj`_ objects. We | |
343 | We won't actually use `Traits`_, but will implement something similar in pure Python. |
|
372 | are calling this new layer, ``tconfig``, as it will use a `Traits`_-like | |
344 | But, even in this new system, we will still use `ConfigObj`_ and `.ini`_ files |
|
373 | validation model. We won't actually use `Traits`_, but will implement | |
345 | underneath the hood. Talk to Fernando if you are interested in working on this part of |
|
374 | something similar in pure Python. But, even in this new system, we will still | |
346 | IPython. The current prototype of ``tconfig`` is located in the IPython sandbox. |
|
375 | use `ConfigObj`_ and `.ini`_ files underneath the hood. Talk to Fernando if you | |
|
376 | are interested in working on this part of IPython. The current prototype of | |||
|
377 | ``tconfig`` is located in the IPython sandbox. | |||
347 |
|
378 | |||
348 | .. _.ini: http://docs.python.org/lib/module-ConfigParser.html |
|
379 | .. _.ini: http://docs.python.org/lib/module-ConfigParser.html | |
349 | .. _ConfigObj: http://www.voidspace.org.uk/python/configobj.html |
|
380 | .. _ConfigObj: http://www.voidspace.org.uk/python/configobj.html | |
@@ -352,7 +383,9 b' IPython. The current prototype of ``tconfig`` is located in the IPython sandbox.' | |||||
352 | Installation and testing scenarios |
|
383 | Installation and testing scenarios | |
353 | ================================== |
|
384 | ================================== | |
354 |
|
385 | |||
355 | This section outlines the various scenarios that we need to test before we release an IPython version. These scenarios represent different ways of installing IPython and its dependencies. |
|
386 | This section outlines the various scenarios that we need to test before we | |
|
387 | release an IPython version. These scenarios represent different ways of | |||
|
388 | installing IPython and its dependencies. | |||
356 |
|
389 | |||
357 | Installation scenarios under Linux and OS X |
|
390 | Installation scenarios under Linux and OS X | |
358 | ------------------------------------------- |
|
391 | ------------------------------------------- | |
@@ -391,12 +424,3 b' Tests to run for these scenarios' | |||||
391 | installed. |
|
424 | installed. | |
392 | 5. Beat on the IPython terminal a bunch. |
|
425 | 5. Beat on the IPython terminal a bunch. | |
393 | 6. Make sure that furl files are being put in proper locations. |
|
426 | 6. Make sure that furl files are being put in proper locations. | |
394 |
|
||||
395 |
|
||||
396 |
|
||||
397 |
|
||||
398 |
|
||||
399 |
|
||||
400 |
|
||||
401 |
|
||||
402 |
|
General Comments 0
You need to be logged in to leave comments.
Login now