##// END OF EJS Templates
Updated docs to reflect changes in our test running.
Fernando Perez -
Show More
@@ -1,577 +1,544 b''
1 .. Developers should add in this file, during each release cycle, information
1 .. Developers should add in this file, during each release cycle, information
2 .. about important changes they've made, in a summary format that's meant for
2 .. about important changes they've made, in a summary format that's meant for
3 .. end users. For each release we normally have three sections: features, bug
3 .. end users. For each release we normally have three sections: features, bug
4 .. fixes and api breakage.
4 .. fixes and api breakage.
5 .. Please remember to credit the authors of the contributions by name,
5 .. Please remember to credit the authors of the contributions by name,
6 .. especially when they are new users or developers who do not regularly
6 .. especially when they are new users or developers who do not regularly
7 .. participate in IPython's development.
7 .. participate in IPython's development.
8
8
9 .. _changes:
9 .. _changes:
10
10
11 ==========
11 ==========
12 What's new
12 What's new
13 ==========
13 ==========
14
14
15 .. contents::
16 ..
17 1 Release dev
18 1.1 New features
19 1.2 Bug fixes
20 1.3 Backwards incompatible changes
21 2 Release 0.10
22 2.1 New features
23 2.2 Bug fixes
24 2.3 Backwards incompatible changes
25 3 Release 0.9.1
26 4 Release 0.9
27 4.1 New features
28 4.2 Bug fixes
29 4.3 Backwards incompatible changes
30 4.4 Changes merged in from IPython1
31 4.4.1 New features
32 4.4.2 Bug fixes
33 4.4.3 Backwards incompatible changes
34 5 Release 0.8.4
35 6 Release 0.8.3
36 7 Release 0.8.2
37 8 Older releases
38 ..
39
40 Release dev
41 ===========
42
43 New features
44 ------------
45
46 Bug fixes
47 ---------
48
49 Backwards incompatible changes
50 ------------------------------
51
52
53 Release 0.10
15 Release 0.10
54 ============
16 ============
55
17
56 This release brings months of slow but steady development, and will be the last
18 This release brings months of slow but steady development, and will be the last
57 before a major restructuring and cleanup of IPython's internals that is already
19 before a major restructuring and cleanup of IPython's internals that is already
58 under way. For this reason, we hope that 0.10 will be a stable and robust
20 under way. For this reason, we hope that 0.10 will be a stable and robust
59 release so that while users adapt to some of the API changes that will come
21 release so that while users adapt to some of the API changes that will come
60 with the refactoring that will become IPython 0.11, they can safely use 0.10 in
22 with the refactoring that will become IPython 0.11, they can safely use 0.10 in
61 all existing projects with minimal changes (if any).
23 all existing projects with minimal changes (if any).
62
24
63 IPython 0.10 is now a medium-sized project, with roughly (as reported by David
25 IPython 0.10 is now a medium-sized project, with roughly (as reported by David
64 Wheeler's :command:`sloccount` utility) 40750 lines of Python code, and a diff
26 Wheeler's :command:`sloccount` utility) 40750 lines of Python code, and a diff
65 between 0.9.1 and this release that contains almost 28000 lines of code and
27 between 0.9.1 and this release that contains almost 28000 lines of code and
66 documentation. Our documentation, in PDF format, is a 495-page long PDF
28 documentation. Our documentation, in PDF format, is a 495-page long PDF
67 document (also available in HTML format, both generated from the same sources).
29 document (also available in HTML format, both generated from the same sources).
68
30
69 Many users and developers contributed code, features, bug reports and ideas to
31 Many users and developers contributed code, features, bug reports and ideas to
70 this release. Please do not hesitate in contacting us if we've failed to
32 this release. Please do not hesitate in contacting us if we've failed to
71 acknowledge your contribution here. In particular, for this release we have
33 acknowledge your contribution here. In particular, for this release we have
72 contribution from the following people, a mix of new and regular names (in
34 contribution from the following people, a mix of new and regular names (in
73 alphabetical order by first name):
35 alphabetical order by first name):
74
36
75 * Alexander Clausen: fix #341726.
37 * Alexander Clausen: fix #341726.
76 * Brian Granger: lots of work everywhere (features, bug fixes, etc).
38 * Brian Granger: lots of work everywhere (features, bug fixes, etc).
77 * Daniel Ashbrook: bug report on MemoryError during compilation, now fixed.
39 * Daniel Ashbrook: bug report on MemoryError during compilation, now fixed.
78 * Darren Dale: improvements to documentation build system, feedback, design
40 * Darren Dale: improvements to documentation build system, feedback, design
79 ideas.
41 ideas.
80 * Fernando Perez: various places.
42 * Fernando Perez: various places.
81 * GaΓ«l Varoquaux: core code, ipythonx GUI, design discussions, etc. Lots...
43 * GaΓ«l Varoquaux: core code, ipythonx GUI, design discussions, etc. Lots...
82 * John Hunter: suggestions, bug fixes, feedback.
44 * John Hunter: suggestions, bug fixes, feedback.
83 * Jorgen Stenarson: work on many fronts, tests, fixes, win32 support, etc.
45 * Jorgen Stenarson: work on many fronts, tests, fixes, win32 support, etc.
84 * Laurent DufrΓ©chou: many improvements to ipython-wx standalone app.
46 * Laurent DufrΓ©chou: many improvements to ipython-wx standalone app.
85 * Lukasz Pankowski: prefilter, `%edit`, demo improvements.
47 * Lukasz Pankowski: prefilter, `%edit`, demo improvements.
86 * Matt Foster: TextMate support in `%edit`.
48 * Matt Foster: TextMate support in `%edit`.
87 * Nathaniel Smith: fix #237073.
49 * Nathaniel Smith: fix #237073.
88 * Pauli Virtanen: fixes and improvements to extensions, documentation.
50 * Pauli Virtanen: fixes and improvements to extensions, documentation.
89 * Prabhu Ramachandran: improvements to `%timeit`.
51 * Prabhu Ramachandran: improvements to `%timeit`.
90 * Robert Kern: several extensions.
52 * Robert Kern: several extensions.
91 * Sameer D'Costa: help on critical bug #269966.
53 * Sameer D'Costa: help on critical bug #269966.
92 * Stephan Peijnik: feedback on Debian compliance and many man pages.
54 * Stephan Peijnik: feedback on Debian compliance and many man pages.
55 * Steven Bethard: we are now shipping his :mod:`argparse` module.
93 * Tom Fetherston: many improvements to :mod:`IPython.demo` module.
56 * Tom Fetherston: many improvements to :mod:`IPython.demo` module.
94 * Ville Vainio: lots of work everywhere (features, bug fixes, etc).
57 * Ville Vainio: lots of work everywhere (features, bug fixes, etc).
95 * Vishal Vasta: ssh support in ipcluster.
58 * Vishal Vasta: ssh support in ipcluster.
96 * Walter Doerwald: work on the :mod:`IPython.ipipe` system.
59 * Walter Doerwald: work on the :mod:`IPython.ipipe` system.
97
60
98 Below we give an overview of new features, bug fixes and backwards-incompatible
61 Below we give an overview of new features, bug fixes and backwards-incompatible
99 changes. For a detailed account of every change made, feel free to view the
62 changes. For a detailed account of every change made, feel free to view the
100 project log with :command:`bzr log`.
63 project log with :command:`bzr log`.
101
64
102 New features
65 New features
103 ------------
66 ------------
104
67
105 * New `%paste` magic automatically extracts current contents of clipboard and
68 * New `%paste` magic automatically extracts current contents of clipboard and
106 pastes it directly, while correctly handling code that is indented or
69 pastes it directly, while correctly handling code that is indented or
107 prepended with `>>>` or `...` python prompt markers. A very useful new
70 prepended with `>>>` or `...` python prompt markers. A very useful new
108 feature contributed by Robert Kern.
71 feature contributed by Robert Kern.
109
72
110 * IPython 'demos', created with the :mod:`IPython.demo` module, can now be
73 * IPython 'demos', created with the :mod:`IPython.demo` module, can now be
111 created from files on disk or strings in memory. Other fixes and
74 created from files on disk or strings in memory. Other fixes and
112 improvements to the demo system, by Tom Fetherston.
75 improvements to the demo system, by Tom Fetherston.
113
76
114 * Added :func:`find_cmd` function to :mod:`IPython.platutils` module, to find
77 * Added :func:`find_cmd` function to :mod:`IPython.platutils` module, to find
115 commands in a cross-platform manner.
78 commands in a cross-platform manner.
116
79
117 * Many improvements and fixes to GaΓ«l Varoquaux's :command:`ipythonx`, a
80 * Many improvements and fixes to GaΓ«l Varoquaux's :command:`ipythonx`, a
118 WX-based lightweight IPython instance that can be easily embedded in other WX
81 WX-based lightweight IPython instance that can be easily embedded in other WX
119 applications. These improvements have made it possible to now have an
82 applications. These improvements have made it possible to now have an
120 embedded IPython in Mayavi and other tools.
83 embedded IPython in Mayavi and other tools.
121
84
122 * :class:`MultiengineClient` objects now have a :meth:`benchmark` method.
85 * :class:`MultiengineClient` objects now have a :meth:`benchmark` method.
123
86
124 * The manual now includes a full set of auto-generated API documents from the
87 * The manual now includes a full set of auto-generated API documents from the
125 code sources, using Sphinx and some of our own support code. We are now
88 code sources, using Sphinx and some of our own support code. We are now
126 using the `Numpy Documentation Standard`_ for all docstrings, and we have
89 using the `Numpy Documentation Standard`_ for all docstrings, and we have
127 tried to update as many existing ones as possible to this format.
90 tried to update as many existing ones as possible to this format.
128
91
129 .. _Numpy Documentation Standard: http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard
130
131 * The new :mod:`IPython.Extensions.ipy_pretty` extension by Robert Kern
92 * The new :mod:`IPython.Extensions.ipy_pretty` extension by Robert Kern
132 provides configurable pretty-printing.
93 provides configurable pretty-printing.
133
94
134 * Many improvements to the :command:`ipython-wx` standalone WX-based IPython
95 * Many improvements to the :command:`ipython-wx` standalone WX-based IPython
135 application by Laurent DufrΓ©chou. It can optionally run in a thread, and
96 application by Laurent DufrΓ©chou. It can optionally run in a thread, and
136 this can be toggled at runtime (allowing the loading of Matplotlib in a
97 this can be toggled at runtime (allowing the loading of Matplotlib in a
137 running session without ill effects).
98 running session without ill effects).
138
99
139 * IPython includes a copy of Steven Bethard's argparse_ in the
100 * IPython includes a copy of Steven Bethard's argparse_ in the
140 :mod:`IPython.external` package, so we can use it internally and it is also
101 :mod:`IPython.external` package, so we can use it internally and it is also
141 available to any IPython user. By installing it in this manner, we ensure
102 available to any IPython user. By installing it in this manner, we ensure
142 zero conflicts with any system-wide installation you may already have while
103 zero conflicts with any system-wide installation you may already have while
143 minimizing external dependencies for new users.
104 minimizing external dependencies for new users. In IPython 0.10, We ship
105 argparse version 1.0.
144
106
145 * An improved and much more robust test suite, that runs groups of tests in
107 * An improved and much more robust test suite, that runs groups of tests in
146 separate subprocesses using either Nose or Twisted's :command:`trial` runner
108 separate subprocesses using either Nose or Twisted's :command:`trial` runner
147 to ensure proper management of Twisted-using code. The test suite degrades
109 to ensure proper management of Twisted-using code. The test suite degrades
148 gracefully if optional dependencies are not available, so that the
110 gracefully if optional dependencies are not available, so that the
149 :command:`iptest` command can be run with only Nose installed and nothing
111 :command:`iptest` command can be run with only Nose installed and nothing
150 else. We also have more and cleaner test decorators to better select tests
112 else. We also have more and cleaner test decorators to better select tests
151 depending on runtime conditions, do setup/teardown, etc.
113 depending on runtime conditions, do setup/teardown, etc.
152
114
153 * The new ipcluster now has a fully working ssh mode that should work on
115 * The new ipcluster now has a fully working ssh mode that should work on
154 Linux, Unix and OS X. Thanks to Vishal Vatsa for implementing this!
116 Linux, Unix and OS X. Thanks to Vishal Vatsa for implementing this!
155
117
156 * The wonderful TextMate editor can now be used with %edit on OS X. Thanks
118 * The wonderful TextMate editor can now be used with %edit on OS X. Thanks
157 to Matt Foster for this patch.
119 to Matt Foster for this patch.
158
120
159 * The documentation regarding parallel uses of IPython, including MPI and PBS,
121 * The documentation regarding parallel uses of IPython, including MPI and PBS,
160 has been significantly updated and improved.
122 has been significantly updated and improved.
161
123
162 * The developer guidelines in the documentation have been updated to explain
124 * The developer guidelines in the documentation have been updated to explain
163 our workflow using :command:`bzr` and Launchpad.
125 our workflow using :command:`bzr` and Launchpad.
164
126
165 * Fully refactored :command:`ipcluster` command line program for starting
127 * Fully refactored :command:`ipcluster` command line program for starting
166 IPython clusters. This new version is a complete rewrite and 1) is fully
128 IPython clusters. This new version is a complete rewrite and 1) is fully
167 cross platform (we now use Twisted's process management), 2) has much
129 cross platform (we now use Twisted's process management), 2) has much
168 improved performance, 3) uses subcommands for different types of clusters, 4)
130 improved performance, 3) uses subcommands for different types of clusters, 4)
169 uses argparse for parsing command line options, 5) has better support for
131 uses argparse for parsing command line options, 5) has better support for
170 starting clusters using :command:`mpirun`, 6) has experimental support for
132 starting clusters using :command:`mpirun`, 6) has experimental support for
171 starting engines using PBS. It can also reuse FURL files, by appropriately
133 starting engines using PBS. It can also reuse FURL files, by appropriately
172 passing options to its subcommands. However, this new version of ipcluster
134 passing options to its subcommands. However, this new version of ipcluster
173 should be considered a technology preview. We plan on changing the API in
135 should be considered a technology preview. We plan on changing the API in
174 significant ways before it is final.
136 significant ways before it is final.
175
137
176 * The :mod:`argparse` module has been added to :mod:`IPython.external`.
177
178 * Full description of the security model added to the docs.
138 * Full description of the security model added to the docs.
179
139
180 * cd completer: show bookmarks if no other completions are available.
140 * cd completer: show bookmarks if no other completions are available.
181
141
182 * sh profile: easy way to give 'title' to prompt: assign to variable
142 * sh profile: easy way to give 'title' to prompt: assign to variable
183 '_prompt_title'. It looks like this::
143 '_prompt_title'. It looks like this::
184
144
185 [~]|1> _prompt_title = 'sudo!'
145 [~]|1> _prompt_title = 'sudo!'
186 sudo![~]|2>
146 sudo![~]|2>
187
147
188 * %edit: If you do '%edit pasted_block', pasted_block variable gets updated
148 * %edit: If you do '%edit pasted_block', pasted_block variable gets updated
189 with new data (so repeated editing makes sense)
149 with new data (so repeated editing makes sense)
190
150
151 .. _Numpy Documentation Standard: http://projects.scipy.org/numpy/wiki/CodingStyleGuidelines#docstring-standard
152
153 .. _argparse: http://code.google.com/p/argparse/
154
191 Bug fixes
155 Bug fixes
192 ---------
156 ---------
193
157
194 * Fix #368719, removed top-level debian/ directory to make the job of Debian
158 * Fix #368719, removed top-level debian/ directory to make the job of Debian
195 packagers easier.
159 packagers easier.
196
160
197 * Fix #291143 by including man pages contributed by Stephan Peijnik from the
161 * Fix #291143 by including man pages contributed by Stephan Peijnik from the
198 Debian project.
162 Debian project.
199
163
200 * Fix #358202, effectively a race condition, by properly synchronizing file
164 * Fix #358202, effectively a race condition, by properly synchronizing file
201 creation at cluster startup time.
165 creation at cluster startup time.
202
166
203 * `%timeit` now handles correctly functions that take a long time to execute
167 * `%timeit` now handles correctly functions that take a long time to execute
204 even the first time, by not repeating them.
168 even the first time, by not repeating them.
205
169
206 * Fix #239054, releasing of references after exiting.
170 * Fix #239054, releasing of references after exiting.
207
171
208 * Fix #341726, thanks to Alexander Clausen.
172 * Fix #341726, thanks to Alexander Clausen.
209
173
210 * Fix #269966. This long-standing and very difficult bug (which is actually a
174 * Fix #269966. This long-standing and very difficult bug (which is actually a
211 problem in Python itself) meant long-running sessions would inevitably grow
175 problem in Python itself) meant long-running sessions would inevitably grow
212 in memory size, often with catastrophic consequences if users had large
176 in memory size, often with catastrophic consequences if users had large
213 objects in their scripts. Now, using `%run` repeatedly should not cause any
177 objects in their scripts. Now, using `%run` repeatedly should not cause any
214 memory leaks. Special thanks to John Hunter and Sameer D'Costa for their
178 memory leaks. Special thanks to John Hunter and Sameer D'Costa for their
215 help with this bug.
179 help with this bug.
216
180
217 * Fix #295371, bug in `%history`.
181 * Fix #295371, bug in `%history`.
218
182
219 * Improved support for py2exe.
183 * Improved support for py2exe.
220
184
221 * Fix #270856: IPython hangs with PyGTK
185 * Fix #270856: IPython hangs with PyGTK
222
186
223 * Fix #270998: A magic with no docstring breaks the '%magic magic'
187 * Fix #270998: A magic with no docstring breaks the '%magic magic'
224
188
225 * fix #271684: -c startup commands screw up raw vs. native history
189 * fix #271684: -c startup commands screw up raw vs. native history
226
190
227 * Numerous bugs on Windows with the new ipcluster have been fixed.
191 * Numerous bugs on Windows with the new ipcluster have been fixed.
228
192
229 * The ipengine and ipcontroller scripts now handle missing furl files
193 * The ipengine and ipcontroller scripts now handle missing furl files
230 more gracefully by giving better error messages.
194 more gracefully by giving better error messages.
231
195
232 * %rehashx: Aliases no longer contain dots. python3.0 binary
196 * %rehashx: Aliases no longer contain dots. python3.0 binary
233 will create alias python30. Fixes:
197 will create alias python30. Fixes:
234 #259716 "commands with dots in them don't work"
198 #259716 "commands with dots in them don't work"
235
199
236 * %cpaste: %cpaste -r repeats the last pasted block.
200 * %cpaste: %cpaste -r repeats the last pasted block.
237 The block is assigned to pasted_block even if code
201 The block is assigned to pasted_block even if code
238 raises exception.
202 raises exception.
239
203
240 * Bug #274067 'The code in get_home_dir is broken for py2exe' was
204 * Bug #274067 'The code in get_home_dir is broken for py2exe' was
241 fixed.
205 fixed.
242
206
207 * Many other small bug fixes not listed here by number (see the bzr log for
208 more info).
209
243 Backwards incompatible changes
210 Backwards incompatible changes
244 ------------------------------
211 ------------------------------
245
212
246 * `ipykit` and related files were unmaintained and have been removed.
213 * `ipykit` and related files were unmaintained and have been removed.
247
214
248 * The :func:`IPython.genutils.doctest_reload` does not actually call
215 * The :func:`IPython.genutils.doctest_reload` does not actually call
249 `reload(doctest)` anymore, as this was causing many problems with the test
216 `reload(doctest)` anymore, as this was causing many problems with the test
250 suite. It still resets `doctest.master` to None.
217 suite. It still resets `doctest.master` to None.
251
218
252 * While we have not deliberately broken Python 2.4 compatibility, only minor
219 * While we have not deliberately broken Python 2.4 compatibility, only minor
253 testing was done with Python 2.4, while 2.5 and 2.6 were fully tested. But
220 testing was done with Python 2.4, while 2.5 and 2.6 were fully tested. But
254 if you encounter problems with 2.4, please do report them as bugs.
221 if you encounter problems with 2.4, please do report them as bugs.
255
222
256 * The :command:`ipcluster` now requires a mode argument; for example to start a
223 * The :command:`ipcluster` now requires a mode argument; for example to start a
257 cluster on the local machine with 4 engines, you must now type::
224 cluster on the local machine with 4 engines, you must now type::
258
225
259 $ ipcluster local -n 4
226 $ ipcluster local -n 4
260
227
261 * The controller now has a ``-r`` flag that needs to be used if you want to
228 * The controller now has a ``-r`` flag that needs to be used if you want to
262 reuse existing furl files. Otherwise they are deleted (the default).
229 reuse existing furl files. Otherwise they are deleted (the default).
263
230
264 * Remove ipy_leo.py. You can use :command:`easy_install ipython-extension` to
231 * Remove ipy_leo.py. You can use :command:`easy_install ipython-extension` to
265 get it. (done to decouple it from ipython release cycle)
232 get it. (done to decouple it from ipython release cycle)
266
233
267
234
268 Release 0.9.1
235 Release 0.9.1
269 =============
236 =============
270
237
271 This release was quickly made to restore compatibility with Python 2.4, which
238 This release was quickly made to restore compatibility with Python 2.4, which
272 version 0.9 accidentally broke. No new features were introduced, other than
239 version 0.9 accidentally broke. No new features were introduced, other than
273 some additional testing support for internal use.
240 some additional testing support for internal use.
274
241
275
242
276 Release 0.9
243 Release 0.9
277 ===========
244 ===========
278
245
279 New features
246 New features
280 ------------
247 ------------
281
248
282 * All furl files and security certificates are now put in a read-only
249 * All furl files and security certificates are now put in a read-only
283 directory named ~./ipython/security.
250 directory named ~./ipython/security.
284
251
285 * A single function :func:`get_ipython_dir`, in :mod:`IPython.genutils` that
252 * A single function :func:`get_ipython_dir`, in :mod:`IPython.genutils` that
286 determines the user's IPython directory in a robust manner.
253 determines the user's IPython directory in a robust manner.
287
254
288 * Laurent's WX application has been given a top-level script called
255 * Laurent's WX application has been given a top-level script called
289 ipython-wx, and it has received numerous fixes. We expect this code to be
256 ipython-wx, and it has received numerous fixes. We expect this code to be
290 architecturally better integrated with Gael's WX 'ipython widget' over the
257 architecturally better integrated with Gael's WX 'ipython widget' over the
291 next few releases.
258 next few releases.
292
259
293 * The Editor synchronization work by Vivian De Smedt has been merged in. This
260 * The Editor synchronization work by Vivian De Smedt has been merged in. This
294 code adds a number of new editor hooks to synchronize with editors under
261 code adds a number of new editor hooks to synchronize with editors under
295 Windows.
262 Windows.
296
263
297 * A new, still experimental but highly functional, WX shell by Gael Varoquaux.
264 * A new, still experimental but highly functional, WX shell by Gael Varoquaux.
298 This work was sponsored by Enthought, and while it's still very new, it is
265 This work was sponsored by Enthought, and while it's still very new, it is
299 based on a more cleanly organized arhictecture of the various IPython
266 based on a more cleanly organized arhictecture of the various IPython
300 components. We will continue to develop this over the next few releases as a
267 components. We will continue to develop this over the next few releases as a
301 model for GUI components that use IPython.
268 model for GUI components that use IPython.
302
269
303 * Another GUI frontend, Cocoa based (Cocoa is the OSX native GUI framework),
270 * Another GUI frontend, Cocoa based (Cocoa is the OSX native GUI framework),
304 authored by Barry Wark. Currently the WX and the Cocoa ones have slightly
271 authored by Barry Wark. Currently the WX and the Cocoa ones have slightly
305 different internal organizations, but the whole team is working on finding
272 different internal organizations, but the whole team is working on finding
306 what the right abstraction points are for a unified codebase.
273 what the right abstraction points are for a unified codebase.
307
274
308 * As part of the frontend work, Barry Wark also implemented an experimental
275 * As part of the frontend work, Barry Wark also implemented an experimental
309 event notification system that various ipython components can use. In the
276 event notification system that various ipython components can use. In the
310 next release the implications and use patterns of this system regarding the
277 next release the implications and use patterns of this system regarding the
311 various GUI options will be worked out.
278 various GUI options will be worked out.
312
279
313 * IPython finally has a full test system, that can test docstrings with
280 * IPython finally has a full test system, that can test docstrings with
314 IPython-specific functionality. There are still a few pieces missing for it
281 IPython-specific functionality. There are still a few pieces missing for it
315 to be widely accessible to all users (so they can run the test suite at any
282 to be widely accessible to all users (so they can run the test suite at any
316 time and report problems), but it now works for the developers. We are
283 time and report problems), but it now works for the developers. We are
317 working hard on continuing to improve it, as this was probably IPython's
284 working hard on continuing to improve it, as this was probably IPython's
318 major Achilles heel (the lack of proper test coverage made it effectively
285 major Achilles heel (the lack of proper test coverage made it effectively
319 impossible to do large-scale refactoring). The full test suite can now
286 impossible to do large-scale refactoring). The full test suite can now
320 be run using the :command:`iptest` command line program.
287 be run using the :command:`iptest` command line program.
321
288
322 * The notion of a task has been completely reworked. An `ITask` interface has
289 * The notion of a task has been completely reworked. An `ITask` interface has
323 been created. This interface defines the methods that tasks need to
290 been created. This interface defines the methods that tasks need to
324 implement. These methods are now responsible for things like submitting
291 implement. These methods are now responsible for things like submitting
325 tasks and processing results. There are two basic task types:
292 tasks and processing results. There are two basic task types:
326 :class:`IPython.kernel.task.StringTask` (this is the old `Task` object, but
293 :class:`IPython.kernel.task.StringTask` (this is the old `Task` object, but
327 renamed) and the new :class:`IPython.kernel.task.MapTask`, which is based on
294 renamed) and the new :class:`IPython.kernel.task.MapTask`, which is based on
328 a function.
295 a function.
329
296
330 * A new interface, :class:`IPython.kernel.mapper.IMapper` has been defined to
297 * A new interface, :class:`IPython.kernel.mapper.IMapper` has been defined to
331 standardize the idea of a `map` method. This interface has a single `map`
298 standardize the idea of a `map` method. This interface has a single `map`
332 method that has the same syntax as the built-in `map`. We have also defined
299 method that has the same syntax as the built-in `map`. We have also defined
333 a `mapper` factory interface that creates objects that implement
300 a `mapper` factory interface that creates objects that implement
334 :class:`IPython.kernel.mapper.IMapper` for different controllers. Both the
301 :class:`IPython.kernel.mapper.IMapper` for different controllers. Both the
335 multiengine and task controller now have mapping capabilties.
302 multiengine and task controller now have mapping capabilties.
336
303
337 * The parallel function capabilities have been reworks. The major changes are
304 * The parallel function capabilities have been reworks. The major changes are
338 that i) there is now an `@parallel` magic that creates parallel functions,
305 that i) there is now an `@parallel` magic that creates parallel functions,
339 ii) the syntax for mulitple variable follows that of `map`, iii) both the
306 ii) the syntax for mulitple variable follows that of `map`, iii) both the
340 multiengine and task controller now have a parallel function implementation.
307 multiengine and task controller now have a parallel function implementation.
341
308
342 * All of the parallel computing capabilities from `ipython1-dev` have been
309 * All of the parallel computing capabilities from `ipython1-dev` have been
343 merged into IPython proper. This resulted in the following new subpackages:
310 merged into IPython proper. This resulted in the following new subpackages:
344 :mod:`IPython.kernel`, :mod:`IPython.kernel.core`, :mod:`IPython.config`,
311 :mod:`IPython.kernel`, :mod:`IPython.kernel.core`, :mod:`IPython.config`,
345 :mod:`IPython.tools` and :mod:`IPython.testing`.
312 :mod:`IPython.tools` and :mod:`IPython.testing`.
346
313
347 * As part of merging in the `ipython1-dev` stuff, the `setup.py` script and
314 * As part of merging in the `ipython1-dev` stuff, the `setup.py` script and
348 friends have been completely refactored. Now we are checking for
315 friends have been completely refactored. Now we are checking for
349 dependencies using the approach that matplotlib uses.
316 dependencies using the approach that matplotlib uses.
350
317
351 * The documentation has been completely reorganized to accept the
318 * The documentation has been completely reorganized to accept the
352 documentation from `ipython1-dev`.
319 documentation from `ipython1-dev`.
353
320
354 * We have switched to using Foolscap for all of our network protocols in
321 * We have switched to using Foolscap for all of our network protocols in
355 :mod:`IPython.kernel`. This gives us secure connections that are both
322 :mod:`IPython.kernel`. This gives us secure connections that are both
356 encrypted and authenticated.
323 encrypted and authenticated.
357
324
358 * We have a brand new `COPYING.txt` files that describes the IPython license
325 * We have a brand new `COPYING.txt` files that describes the IPython license
359 and copyright. The biggest change is that we are putting "The IPython
326 and copyright. The biggest change is that we are putting "The IPython
360 Development Team" as the copyright holder. We give more details about
327 Development Team" as the copyright holder. We give more details about
361 exactly what this means in this file. All developer should read this and use
328 exactly what this means in this file. All developer should read this and use
362 the new banner in all IPython source code files.
329 the new banner in all IPython source code files.
363
330
364 * sh profile: ./foo runs foo as system command, no need to do !./foo anymore
331 * sh profile: ./foo runs foo as system command, no need to do !./foo anymore
365
332
366 * String lists now support ``sort(field, nums = True)`` method (to easily sort
333 * String lists now support ``sort(field, nums = True)`` method (to easily sort
367 system command output). Try it with ``a = !ls -l ; a.sort(1, nums=1)``.
334 system command output). Try it with ``a = !ls -l ; a.sort(1, nums=1)``.
368
335
369 * '%cpaste foo' now assigns the pasted block as string list, instead of string
336 * '%cpaste foo' now assigns the pasted block as string list, instead of string
370
337
371 * The ipcluster script now run by default with no security. This is done
338 * The ipcluster script now run by default with no security. This is done
372 because the main usage of the script is for starting things on localhost.
339 because the main usage of the script is for starting things on localhost.
373 Eventually when ipcluster is able to start things on other hosts, we will put
340 Eventually when ipcluster is able to start things on other hosts, we will put
374 security back.
341 security back.
375
342
376 * 'cd --foo' searches directory history for string foo, and jumps to that dir.
343 * 'cd --foo' searches directory history for string foo, and jumps to that dir.
377 Last part of dir name is checked first. If no matches for that are found,
344 Last part of dir name is checked first. If no matches for that are found,
378 look at the whole path.
345 look at the whole path.
379
346
380
347
381 Bug fixes
348 Bug fixes
382 ---------
349 ---------
383
350
384 * The Windows installer has been fixed. Now all IPython scripts have ``.bat``
351 * The Windows installer has been fixed. Now all IPython scripts have ``.bat``
385 versions created. Also, the Start Menu shortcuts have been updated.
352 versions created. Also, the Start Menu shortcuts have been updated.
386
353
387 * The colors escapes in the multiengine client are now turned off on win32 as
354 * The colors escapes in the multiengine client are now turned off on win32 as
388 they don't print correctly.
355 they don't print correctly.
389
356
390 * The :mod:`IPython.kernel.scripts.ipengine` script was exec'ing
357 * The :mod:`IPython.kernel.scripts.ipengine` script was exec'ing
391 mpi_import_statement incorrectly, which was leading the engine to crash when
358 mpi_import_statement incorrectly, which was leading the engine to crash when
392 mpi was enabled.
359 mpi was enabled.
393
360
394 * A few subpackages had missing ``__init__.py`` files.
361 * A few subpackages had missing ``__init__.py`` files.
395
362
396 * The documentation is only created if Sphinx is found. Previously, the
363 * The documentation is only created if Sphinx is found. Previously, the
397 ``setup.py`` script would fail if it was missing.
364 ``setup.py`` script would fail if it was missing.
398
365
399 * Greedy ``cd`` completion has been disabled again (it was enabled in 0.8.4) as
366 * Greedy ``cd`` completion has been disabled again (it was enabled in 0.8.4) as
400 it caused problems on certain platforms.
367 it caused problems on certain platforms.
401
368
402
369
403 Backwards incompatible changes
370 Backwards incompatible changes
404 ------------------------------
371 ------------------------------
405
372
406 * The ``clusterfile`` options of the :command:`ipcluster` command has been
373 * The ``clusterfile`` options of the :command:`ipcluster` command has been
407 removed as it was not working and it will be replaced soon by something much
374 removed as it was not working and it will be replaced soon by something much
408 more robust.
375 more robust.
409
376
410 * The :mod:`IPython.kernel` configuration now properly find the user's
377 * The :mod:`IPython.kernel` configuration now properly find the user's
411 IPython directory.
378 IPython directory.
412
379
413 * In ipapi, the :func:`make_user_ns` function has been replaced with
380 * In ipapi, the :func:`make_user_ns` function has been replaced with
414 :func:`make_user_namespaces`, to support dict subclasses in namespace
381 :func:`make_user_namespaces`, to support dict subclasses in namespace
415 creation.
382 creation.
416
383
417 * :class:`IPython.kernel.client.Task` has been renamed
384 * :class:`IPython.kernel.client.Task` has been renamed
418 :class:`IPython.kernel.client.StringTask` to make way for new task types.
385 :class:`IPython.kernel.client.StringTask` to make way for new task types.
419
386
420 * The keyword argument `style` has been renamed `dist` in `scatter`, `gather`
387 * The keyword argument `style` has been renamed `dist` in `scatter`, `gather`
421 and `map`.
388 and `map`.
422
389
423 * Renamed the values that the rename `dist` keyword argument can have from
390 * Renamed the values that the rename `dist` keyword argument can have from
424 `'basic'` to `'b'`.
391 `'basic'` to `'b'`.
425
392
426 * IPython has a larger set of dependencies if you want all of its capabilities.
393 * IPython has a larger set of dependencies if you want all of its capabilities.
427 See the `setup.py` script for details.
394 See the `setup.py` script for details.
428
395
429 * The constructors for :class:`IPython.kernel.client.MultiEngineClient` and
396 * The constructors for :class:`IPython.kernel.client.MultiEngineClient` and
430 :class:`IPython.kernel.client.TaskClient` no longer take the (ip,port) tuple.
397 :class:`IPython.kernel.client.TaskClient` no longer take the (ip,port) tuple.
431 Instead they take the filename of a file that contains the FURL for that
398 Instead they take the filename of a file that contains the FURL for that
432 client. If the FURL file is in your IPYTHONDIR, it will be found automatically
399 client. If the FURL file is in your IPYTHONDIR, it will be found automatically
433 and the constructor can be left empty.
400 and the constructor can be left empty.
434
401
435 * The asynchronous clients in :mod:`IPython.kernel.asyncclient` are now created
402 * The asynchronous clients in :mod:`IPython.kernel.asyncclient` are now created
436 using the factory functions :func:`get_multiengine_client` and
403 using the factory functions :func:`get_multiengine_client` and
437 :func:`get_task_client`. These return a `Deferred` to the actual client.
404 :func:`get_task_client`. These return a `Deferred` to the actual client.
438
405
439 * The command line options to `ipcontroller` and `ipengine` have changed to
406 * The command line options to `ipcontroller` and `ipengine` have changed to
440 reflect the new Foolscap network protocol and the FURL files. Please see the
407 reflect the new Foolscap network protocol and the FURL files. Please see the
441 help for these scripts for details.
408 help for these scripts for details.
442
409
443 * The configuration files for the kernel have changed because of the Foolscap
410 * The configuration files for the kernel have changed because of the Foolscap
444 stuff. If you were using custom config files before, you should delete them
411 stuff. If you were using custom config files before, you should delete them
445 and regenerate new ones.
412 and regenerate new ones.
446
413
447 Changes merged in from IPython1
414 Changes merged in from IPython1
448 -------------------------------
415 -------------------------------
449
416
450 New features
417 New features
451 ............
418 ............
452
419
453 * Much improved ``setup.py`` and ``setupegg.py`` scripts. Because Twisted and
420 * Much improved ``setup.py`` and ``setupegg.py`` scripts. Because Twisted and
454 zope.interface are now easy installable, we can declare them as dependencies
421 zope.interface are now easy installable, we can declare them as dependencies
455 in our setupegg.py script.
422 in our setupegg.py script.
456
423
457 * IPython is now compatible with Twisted 2.5.0 and 8.x.
424 * IPython is now compatible with Twisted 2.5.0 and 8.x.
458
425
459 * Added a new example of how to use :mod:`ipython1.kernel.asynclient`.
426 * Added a new example of how to use :mod:`ipython1.kernel.asynclient`.
460
427
461 * Initial draft of a process daemon in :mod:`ipython1.daemon`. This has not
428 * Initial draft of a process daemon in :mod:`ipython1.daemon`. This has not
462 been merged into IPython and is still in `ipython1-dev`.
429 been merged into IPython and is still in `ipython1-dev`.
463
430
464 * The ``TaskController`` now has methods for getting the queue status.
431 * The ``TaskController`` now has methods for getting the queue status.
465
432
466 * The ``TaskResult`` objects not have information about how long the task
433 * The ``TaskResult`` objects not have information about how long the task
467 took to run.
434 took to run.
468
435
469 * We are attaching additional attributes to exceptions ``(_ipython_*)`` that
436 * We are attaching additional attributes to exceptions ``(_ipython_*)`` that
470 we use to carry additional info around.
437 we use to carry additional info around.
471
438
472 * New top-level module :mod:`asyncclient` that has asynchronous versions (that
439 * New top-level module :mod:`asyncclient` that has asynchronous versions (that
473 return deferreds) of the client classes. This is designed to users who want
440 return deferreds) of the client classes. This is designed to users who want
474 to run their own Twisted reactor.
441 to run their own Twisted reactor.
475
442
476 * All the clients in :mod:`client` are now based on Twisted. This is done by
443 * All the clients in :mod:`client` are now based on Twisted. This is done by
477 running the Twisted reactor in a separate thread and using the
444 running the Twisted reactor in a separate thread and using the
478 :func:`blockingCallFromThread` function that is in recent versions of Twisted.
445 :func:`blockingCallFromThread` function that is in recent versions of Twisted.
479
446
480 * Functions can now be pushed/pulled to/from engines using
447 * Functions can now be pushed/pulled to/from engines using
481 :meth:`MultiEngineClient.push_function` and
448 :meth:`MultiEngineClient.push_function` and
482 :meth:`MultiEngineClient.pull_function`.
449 :meth:`MultiEngineClient.pull_function`.
483
450
484 * Gather/scatter are now implemented in the client to reduce the work load
451 * Gather/scatter are now implemented in the client to reduce the work load
485 of the controller and improve performance.
452 of the controller and improve performance.
486
453
487 * Complete rewrite of the IPython docuementation. All of the documentation
454 * Complete rewrite of the IPython docuementation. All of the documentation
488 from the IPython website has been moved into docs/source as restructured
455 from the IPython website has been moved into docs/source as restructured
489 text documents. PDF and HTML documentation are being generated using
456 text documents. PDF and HTML documentation are being generated using
490 Sphinx.
457 Sphinx.
491
458
492 * New developer oriented documentation: development guidelines and roadmap.
459 * New developer oriented documentation: development guidelines and roadmap.
493
460
494 * Traditional ``ChangeLog`` has been changed to a more useful ``changes.txt``
461 * Traditional ``ChangeLog`` has been changed to a more useful ``changes.txt``
495 file that is organized by release and is meant to provide something more
462 file that is organized by release and is meant to provide something more
496 relevant for users.
463 relevant for users.
497
464
498 Bug fixes
465 Bug fixes
499 .........
466 .........
500
467
501 * Created a proper ``MANIFEST.in`` file to create source distributions.
468 * Created a proper ``MANIFEST.in`` file to create source distributions.
502
469
503 * Fixed a bug in the ``MultiEngine`` interface. Previously, multi-engine
470 * Fixed a bug in the ``MultiEngine`` interface. Previously, multi-engine
504 actions were being collected with a :class:`DeferredList` with
471 actions were being collected with a :class:`DeferredList` with
505 ``fireononeerrback=1``. This meant that methods were returning
472 ``fireononeerrback=1``. This meant that methods were returning
506 before all engines had given their results. This was causing extremely odd
473 before all engines had given their results. This was causing extremely odd
507 bugs in certain cases. To fix this problem, we have 1) set
474 bugs in certain cases. To fix this problem, we have 1) set
508 ``fireononeerrback=0`` to make sure all results (or exceptions) are in
475 ``fireononeerrback=0`` to make sure all results (or exceptions) are in
509 before returning and 2) introduced a :exc:`CompositeError` exception
476 before returning and 2) introduced a :exc:`CompositeError` exception
510 that wraps all of the engine exceptions. This is a huge change as it means
477 that wraps all of the engine exceptions. This is a huge change as it means
511 that users will have to catch :exc:`CompositeError` rather than the actual
478 that users will have to catch :exc:`CompositeError` rather than the actual
512 exception.
479 exception.
513
480
514 Backwards incompatible changes
481 Backwards incompatible changes
515 ..............................
482 ..............................
516
483
517 * All names have been renamed to conform to the lowercase_with_underscore
484 * All names have been renamed to conform to the lowercase_with_underscore
518 convention. This will require users to change references to all names like
485 convention. This will require users to change references to all names like
519 ``queueStatus`` to ``queue_status``.
486 ``queueStatus`` to ``queue_status``.
520
487
521 * Previously, methods like :meth:`MultiEngineClient.push` and
488 * Previously, methods like :meth:`MultiEngineClient.push` and
522 :meth:`MultiEngineClient.push` used ``*args`` and ``**kwargs``. This was
489 :meth:`MultiEngineClient.push` used ``*args`` and ``**kwargs``. This was
523 becoming a problem as we weren't able to introduce new keyword arguments into
490 becoming a problem as we weren't able to introduce new keyword arguments into
524 the API. Now these methods simple take a dict or sequence. This has also
491 the API. Now these methods simple take a dict or sequence. This has also
525 allowed us to get rid of the ``*All`` methods like :meth:`pushAll` and
492 allowed us to get rid of the ``*All`` methods like :meth:`pushAll` and
526 :meth:`pullAll`. These things are now handled with the ``targets`` keyword
493 :meth:`pullAll`. These things are now handled with the ``targets`` keyword
527 argument that defaults to ``'all'``.
494 argument that defaults to ``'all'``.
528
495
529 * The :attr:`MultiEngineClient.magicTargets` has been renamed to
496 * The :attr:`MultiEngineClient.magicTargets` has been renamed to
530 :attr:`MultiEngineClient.targets`.
497 :attr:`MultiEngineClient.targets`.
531
498
532 * All methods in the MultiEngine interface now accept the optional keyword
499 * All methods in the MultiEngine interface now accept the optional keyword
533 argument ``block``.
500 argument ``block``.
534
501
535 * Renamed :class:`RemoteController` to :class:`MultiEngineClient` and
502 * Renamed :class:`RemoteController` to :class:`MultiEngineClient` and
536 :class:`TaskController` to :class:`TaskClient`.
503 :class:`TaskController` to :class:`TaskClient`.
537
504
538 * Renamed the top-level module from :mod:`api` to :mod:`client`.
505 * Renamed the top-level module from :mod:`api` to :mod:`client`.
539
506
540 * Most methods in the multiengine interface now raise a :exc:`CompositeError`
507 * Most methods in the multiengine interface now raise a :exc:`CompositeError`
541 exception that wraps the user's exceptions, rather than just raising the raw
508 exception that wraps the user's exceptions, rather than just raising the raw
542 user's exception.
509 user's exception.
543
510
544 * Changed the ``setupNS`` and ``resultNames`` in the ``Task`` class to ``push``
511 * Changed the ``setupNS`` and ``resultNames`` in the ``Task`` class to ``push``
545 and ``pull``.
512 and ``pull``.
546
513
547
514
548 Release 0.8.4
515 Release 0.8.4
549 =============
516 =============
550
517
551 This was a quick release to fix an unfortunate bug that slipped into the 0.8.3
518 This was a quick release to fix an unfortunate bug that slipped into the 0.8.3
552 release. The ``--twisted`` option was disabled, as it turned out to be broken
519 release. The ``--twisted`` option was disabled, as it turned out to be broken
553 across several platforms.
520 across several platforms.
554
521
555
522
556 Release 0.8.3
523 Release 0.8.3
557 =============
524 =============
558
525
559 * pydb is now disabled by default (due to %run -d problems). You can enable
526 * pydb is now disabled by default (due to %run -d problems). You can enable
560 it by passing -pydb command line argument to IPython. Note that setting
527 it by passing -pydb command line argument to IPython. Note that setting
561 it in config file won't work.
528 it in config file won't work.
562
529
563
530
564 Release 0.8.2
531 Release 0.8.2
565 =============
532 =============
566
533
567 * %pushd/%popd behave differently; now "pushd /foo" pushes CURRENT directory
534 * %pushd/%popd behave differently; now "pushd /foo" pushes CURRENT directory
568 and jumps to /foo. The current behaviour is closer to the documented
535 and jumps to /foo. The current behaviour is closer to the documented
569 behaviour, and should not trip anyone.
536 behaviour, and should not trip anyone.
570
537
571
538
572 Older releases
539 Older releases
573 ==============
540 ==============
574
541
575 Changes in earlier releases of IPython are described in the older file
542 Changes in earlier releases of IPython are described in the older file
576 ``ChangeLog``. Please refer to this document for details.
543 ``ChangeLog``. Please refer to this document for details.
577
544
@@ -1,494 +1,515 b''
1 .. _development:
1 .. _development:
2
2
3 ==============================
3 ==============================
4 IPython development guidelines
4 IPython development guidelines
5 ==============================
5 ==============================
6
6
7
7
8 Overview
8 Overview
9 ========
9 ========
10
10
11 This document describes IPython from the perspective of developers. Most
11 This document describes IPython from the perspective of developers. Most
12 importantly, it gives information for people who want to contribute to the
12 importantly, it gives information for people who want to contribute to the
13 development of IPython. So if you want to help out, read on!
13 development of IPython. So if you want to help out, read on!
14
14
15 How to contribute to IPython
15 How to contribute to IPython
16 ============================
16 ============================
17
17
18 IPython development is done using Bazaar [Bazaar]_ and Launchpad [Launchpad]_.
18 IPython development is done using Bazaar [Bazaar]_ and Launchpad [Launchpad]_.
19 This makes it easy for people to contribute to the development of IPython.
19 This makes it easy for people to contribute to the development of IPython.
20 There are several ways in which you can join in.
20 There are several ways in which you can join in.
21
21
22 If you have a small change that you want to send to the team, you can edit your
22 If you have a small change that you want to send to the team, you can edit your
23 bazaar checkout of IPython (see below) in-place, and ask bazaar for the
23 bazaar checkout of IPython (see below) in-place, and ask bazaar for the
24 differences::
24 differences::
25
25
26 $ cd /path/to/your/copy/of/ipython
26 $ cd /path/to/your/copy/of/ipython
27 $ bzr diff > my_fixes.diff
27 $ bzr diff > my_fixes.diff
28
28
29 This produces a patch file with your fixes, which we can apply to the source
29 This produces a patch file with your fixes, which we can apply to the source
30 tree. This file should then be attached to a ticket in our `bug tracker
30 tree. This file should then be attached to a ticket in our `bug tracker
31 <https://bugs.launchpad.net/ipython>`_, indicating what it does.
31 <https://bugs.launchpad.net/ipython>`_, indicating what it does.
32
32
33 This model of creating small, self-contained patches works very well and there
33 This model of creating small, self-contained patches works very well and there
34 are open source projects that do their entire development this way. However,
34 are open source projects that do their entire development this way. However,
35 in IPython we have found that for tracking larger changes, making use of
35 in IPython we have found that for tracking larger changes, making use of
36 bazaar's full capabilities in conjunction with Launchpad's code hosting
36 bazaar's full capabilities in conjunction with Launchpad's code hosting
37 services makes for a much better experience.
37 services makes for a much better experience.
38
38
39 Making your own branch of IPython allows you to refine your changes over time,
39 Making your own branch of IPython allows you to refine your changes over time,
40 track the development of the main team, and propose your own full version of
40 track the development of the main team, and propose your own full version of
41 the code for others to use and review, with a minimum amount of fuss. The next
41 the code for others to use and review, with a minimum amount of fuss. The next
42 parts of this document will explain how to do this.
42 parts of this document will explain how to do this.
43
43
44 Install Bazaar and create a Launchpad account
44 Install Bazaar and create a Launchpad account
45 ---------------------------------------------
45 ---------------------------------------------
46
46
47 First make sure you have installed Bazaar (see their `website
47 First make sure you have installed Bazaar (see their `website
48 <http://bazaar-vcs.org/>`_). To see that Bazaar is installed and knows about
48 <http://bazaar-vcs.org/>`_). To see that Bazaar is installed and knows about
49 you, try the following::
49 you, try the following::
50
50
51 $ bzr whoami
51 $ bzr whoami
52 Joe Coder <jcoder@gmail.com>
52 Joe Coder <jcoder@gmail.com>
53
53
54 This should display your name and email. Next, you will want to create an
54 This should display your name and email. Next, you will want to create an
55 account on the `Launchpad website <http://www.launchpad.net>`_ and setup your
55 account on the `Launchpad website <http://www.launchpad.net>`_ and setup your
56 ssh keys. For more information of setting up your ssh keys, see `this link
56 ssh keys. For more information of setting up your ssh keys, see `this link
57 <https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair>`_.
57 <https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair>`_.
58
58
59 Get the main IPython branch from Launchpad
59 Get the main IPython branch from Launchpad
60 ------------------------------------------
60 ------------------------------------------
61
61
62 Now, you can get a copy of the main IPython development branch (we call this
62 Now, you can get a copy of the main IPython development branch (we call this
63 the "trunk")::
63 the "trunk")::
64
64
65 $ bzr branch lp:ipython
65 $ bzr branch lp:ipython
66
66
67 Create a working branch
67 Create a working branch
68 -----------------------
68 -----------------------
69
69
70 When working on IPython, you won't actually make edits directly to the
70 When working on IPython, you won't actually make edits directly to the
71 :file:`lp:ipython` branch. Instead, you will create a separate branch for your
71 :file:`lp:ipython` branch. Instead, you will create a separate branch for your
72 changes. For now, let's assume you want to do your work in a branch named
72 changes. For now, let's assume you want to do your work in a branch named
73 "ipython-mybranch". Create this branch by doing::
73 "ipython-mybranch". Create this branch by doing::
74
74
75 $ bzr branch ipython ipython-mybranch
75 $ bzr branch ipython ipython-mybranch
76
76
77 When you actually create a branch, you will want to give it a name that
77 When you actually create a branch, you will want to give it a name that
78 reflects the nature of the work that you will be doing in it, like
78 reflects the nature of the work that you will be doing in it, like
79 "install-docs-update".
79 "install-docs-update".
80
80
81 Make edits in your working branch
81 Make edits in your working branch
82 ---------------------------------
82 ---------------------------------
83
83
84 Now you are ready to actually make edits in your :file:`ipython-mybranch`
84 Now you are ready to actually make edits in your :file:`ipython-mybranch`
85 branch. Before doing this, it is helpful to install this branch so you can
85 branch. Before doing this, it is helpful to install this branch so you can
86 test your changes as you work. This is easiest if you have setuptools
86 test your changes as you work. This is easiest if you have setuptools
87 installed. Then, just do::
87 installed. Then, just do::
88
88
89 $ cd ipython-mybranch
89 $ cd ipython-mybranch
90 $ python setupegg.py develop
90 $ python setupegg.py develop
91
91
92 Now, make some changes. After a while, you will want to commit your changes.
92 Now, make some changes. After a while, you will want to commit your changes.
93 This let's Bazaar know that you like the changes you have made and gives you
93 This let's Bazaar know that you like the changes you have made and gives you
94 an opportunity to keep a nice record of what you have done. This looks like
94 an opportunity to keep a nice record of what you have done. This looks like
95 this::
95 this::
96
96
97 $ ...do work in ipython-mybranch...
97 $ ...do work in ipython-mybranch...
98 $ bzr commit -m "the commit message goes here"
98 $ bzr commit -m "the commit message goes here"
99
99
100 Please note that since we now don't use an old-style linear ChangeLog (that
100 Please note that since we now don't use an old-style linear ChangeLog (that
101 tends to cause problems with distributed version control systems), you should
101 tends to cause problems with distributed version control systems), you should
102 ensure that your log messages are reasonably detailed. Use a docstring-like
102 ensure that your log messages are reasonably detailed. Use a docstring-like
103 approach in the commit messages (including the second line being left
103 approach in the commit messages (including the second line being left
104 *blank*)::
104 *blank*)::
105
105
106 Single line summary of changes being committed.
106 Single line summary of changes being committed.
107
107
108 * more details when warranted ...
108 * more details when warranted ...
109 * including crediting outside contributors if they sent the
109 * including crediting outside contributors if they sent the
110 code/bug/idea!
110 code/bug/idea!
111
111
112 As you work, you will repeat this edit/commit cycle many times. If you work on
112 As you work, you will repeat this edit/commit cycle many times. If you work on
113 your branch for a long time, you will also want to get the latest changes from
113 your branch for a long time, you will also want to get the latest changes from
114 the :file:`lp:ipython` branch. This can be done with the following sequence of
114 the :file:`lp:ipython` branch. This can be done with the following sequence of
115 commands::
115 commands::
116
116
117 $ ls
117 $ ls
118 ipython
118 ipython
119 ipython-mybranch
119 ipython-mybranch
120
120
121 $ cd ipython
121 $ cd ipython
122 $ bzr pull
122 $ bzr pull
123 $ cd ../ipython-mybranch
123 $ cd ../ipython-mybranch
124 $ bzr merge ../ipython
124 $ bzr merge ../ipython
125 $ bzr commit -m "Merging changes from trunk"
125 $ bzr commit -m "Merging changes from trunk"
126
126
127 Along the way, you should also run the IPython test suite. You can do this
127 Along the way, you should also run the IPython test suite. You can do this
128 using the :command:`iptest` command (which is basically a customized version of
128 using the :command:`iptest` command (which is basically a customized version of
129 :command:`nosetests`)::
129 :command:`nosetests`)::
130
130
131 $ cd
131 $ cd
132 $ iptest
132 $ iptest
133
133
134 The :command:`iptest` command will also pick up and run any tests you have
134 The :command:`iptest` command will also pick up and run any tests you have
135 written. See :ref:`_devel_testing` for further details on the testing system.
135 written. See :ref:`_devel_testing` for further details on the testing system.
136
136
137
137
138 Post your branch and request a code review
138 Post your branch and request a code review
139 ------------------------------------------
139 ------------------------------------------
140
140
141 Once you are done with your edits, you should post your branch on Launchpad so
141 Once you are done with your edits, you should post your branch on Launchpad so
142 that other IPython developers can review the changes and help you merge your
142 that other IPython developers can review the changes and help you merge your
143 changes into the main development branch. To post your branch on Launchpad,
143 changes into the main development branch. To post your branch on Launchpad,
144 do::
144 do::
145
145
146 $ cd ipython-mybranch
146 $ cd ipython-mybranch
147 $ bzr push lp:~yourusername/ipython/ipython-mybranch
147 $ bzr push lp:~yourusername/ipython/ipython-mybranch
148
148
149 Then, go to the `IPython Launchpad site <www.launchpad.net/ipython>`_, and you
149 Then, go to the `IPython Launchpad site <www.launchpad.net/ipython>`_, and you
150 should see your branch under the "Code" tab. If you click on your branch, you
150 should see your branch under the "Code" tab. If you click on your branch, you
151 can provide a short description of the branch as well as mark its status. Most
151 can provide a short description of the branch as well as mark its status. Most
152 importantly, you should click the link that reads "Propose for merging into
152 importantly, you should click the link that reads "Propose for merging into
153 another branch". What does this do?
153 another branch". What does this do?
154
154
155 This let's the other IPython developers know that your branch is ready to be
155 This let's the other IPython developers know that your branch is ready to be
156 reviewed and merged into the main development branch. During this review
156 reviewed and merged into the main development branch. During this review
157 process, other developers will give you feedback and help you get your code
157 process, other developers will give you feedback and help you get your code
158 ready to be merged. What types of things will we be looking for:
158 ready to be merged. What types of things will we be looking for:
159
159
160 * All code is documented.
160 * All code is documented.
161 * All code has tests.
161 * All code has tests.
162 * The entire IPython test suite passes.
162 * The entire IPython test suite passes.
163
163
164 Once your changes have been reviewed and approved, someone will merge them
164 Once your changes have been reviewed and approved, someone will merge them
165 into the main development branch.
165 into the main development branch.
166
166
167
168 Some notes for core developers when merging third-party contributions
169 =====================================================================
170
171 Core developers, who ultimately merge any approved branch (from themselves,
172 another developer, or any third-party contribution) will typically use
173 :command:`bzr merge` to merge the branch into the trunk and push it to the main
174 Launcphad site. This is a short list of things to keep in mind when doing this
175 process, so that the project history is easy to understand in the long run, and
176 that generating release notes is as painless and accurate as possible.
177
178 - When you merge any non-trivial functionality (from one small bug fix to a big
179 feature branch), please remember to always edit the changes_ file
180 accordingly. This file has one main section for each release, and if you
181 edit it as you go, noting what new features, bug fixes or API changes you
182 have made, the release notes will be almost finished when they are needed
183 later. This is much easier if done when you merge the work, rather than
184 weeks or months later by re-reading a massive Bazaar log.
185
186 - When big merges are done, the practice of putting a summary commit message in
187 the merge is *extremely* useful. It makes this kind of job much nicer,
188 because that summary log message can be almost copy/pasted without changes,
189 if it was well written, rather than dissecting the next-level messages from
190 the individual commits.
191
192 - It's important that we remember to always credit who gave us something if
193 it's not the committer. In general, we have been fairly good on this front,
194 this is just a reminder to keep things up. As a note, if you are ever
195 committing something that is completely (or almost so) a third-party
196 contribution, do the commit as::
197
198 $ bzr commit --author="Someone Else"
199
200 This way it will show that name separately in the log, which makes it even
201 easier to spot. Obviously we often rework third party contributions
202 extensively, but this is still good to keep in mind for cases when we don't
203 touch the code too much.
204
205
167 Documentation
206 Documentation
168 =============
207 =============
169
208
170 Standalone documentation
209 Standalone documentation
171 ------------------------
210 ------------------------
172
211
173 All standalone documentation should be written in plain text (``.txt``) files
212 All standalone documentation should be written in plain text (``.txt``) files
174 using reStructuredText [reStructuredText]_ for markup and formatting. All such
213 using reStructuredText [reStructuredText]_ for markup and formatting. All such
175 documentation should be placed in directory :file:`docs/source` of the IPython
214 documentation should be placed in directory :file:`docs/source` of the IPython
176 source tree. The documentation in this location will serve as the main source
215 source tree. The documentation in this location will serve as the main source
177 for IPython documentation and all existing documentation should be converted
216 for IPython documentation and all existing documentation should be converted
178 to this format.
217 to this format.
179
218
180 To build the final documentation, we use Sphinx [Sphinx]_. Once you have
219 To build the final documentation, we use Sphinx [Sphinx]_. Once you have
181 Sphinx installed, you can build the html docs yourself by doing::
220 Sphinx installed, you can build the html docs yourself by doing::
182
221
183 $ cd ipython-mybranch/docs
222 $ cd ipython-mybranch/docs
184 $ make html
223 $ make html
185
224
186 Docstring format
225 Docstring format
187 ----------------
226 ----------------
188
227
189 Good docstrings are very important. All new code should have docstrings that
228 Good docstrings are very important. All new code should have docstrings that
190 are formatted using reStructuredText for markup and formatting, since it is
229 are formatted using reStructuredText for markup and formatting, since it is
191 understood by a wide variety of tools. Details about using reStructuredText
230 understood by a wide variety of tools. Details about using reStructuredText
192 for docstrings can be found `here
231 for docstrings can be found `here
193 <http://epydoc.sourceforge.net/manual-othermarkup.html>`_.
232 <http://epydoc.sourceforge.net/manual-othermarkup.html>`_.
194
233
195 Additional PEPs of interest regarding documentation of code:
234 Additional PEPs of interest regarding documentation of code:
196
235
197 * `Docstring Conventions <http://www.python.org/peps/pep-0257.html>`_
236 * `Docstring Conventions <http://www.python.org/peps/pep-0257.html>`_
198 * `Docstring Processing System Framework <http://www.python.org/peps/pep-0256.html>`_
237 * `Docstring Processing System Framework <http://www.python.org/peps/pep-0256.html>`_
199 * `Docutils Design Specification <http://www.python.org/peps/pep-0258.html>`_
238 * `Docutils Design Specification <http://www.python.org/peps/pep-0258.html>`_
200
239
201
240
202 Coding conventions
241 Coding conventions
203 ==================
242 ==================
204
243
205 General
244 General
206 -------
245 -------
207
246
208 In general, we'll try to follow the standard Python style conventions as
247 In general, we'll try to follow the standard Python style conventions as
209 described here:
248 described here:
210
249
211 * `Style Guide for Python Code <http://www.python.org/peps/pep-0008.html>`_
250 * `Style Guide for Python Code <http://www.python.org/peps/pep-0008.html>`_
212
251
213
252
214 Other comments:
253 Other comments:
215
254
216 * In a large file, top level classes and functions should be
255 * In a large file, top level classes and functions should be
217 separated by 2-3 lines to make it easier to separate them visually.
256 separated by 2-3 lines to make it easier to separate them visually.
218 * Use 4 spaces for indentation.
257 * Use 4 spaces for indentation.
219 * Keep the ordering of methods the same in classes that have the same
258 * Keep the ordering of methods the same in classes that have the same
220 methods. This is particularly true for classes that implement an interface.
259 methods. This is particularly true for classes that implement an interface.
221
260
222 Naming conventions
261 Naming conventions
223 ------------------
262 ------------------
224
263
225 In terms of naming conventions, we'll follow the guidelines from the `Style
264 In terms of naming conventions, we'll follow the guidelines from the `Style
226 Guide for Python Code`_.
265 Guide for Python Code`_.
227
266
228 For all new IPython code (and much existing code is being refactored), we'll
267 For all new IPython code (and much existing code is being refactored), we'll
229 use:
268 use:
230
269
231 * All ``lowercase`` module names.
270 * All ``lowercase`` module names.
232
271
233 * ``CamelCase`` for class names.
272 * ``CamelCase`` for class names.
234
273
235 * ``lowercase_with_underscores`` for methods, functions, variables and
274 * ``lowercase_with_underscores`` for methods, functions, variables and
236 attributes.
275 attributes.
237
276
238 There are, however, some important exceptions to these rules. In some cases,
277 There are, however, some important exceptions to these rules. In some cases,
239 IPython code will interface with packages (Twisted, Wx, Qt) that use other
278 IPython code will interface with packages (Twisted, Wx, Qt) that use other
240 conventions. At some level this makes it impossible to adhere to our own
279 conventions. At some level this makes it impossible to adhere to our own
241 standards at all times. In particular, when subclassing classes that use other
280 standards at all times. In particular, when subclassing classes that use other
242 naming conventions, you must follow their naming conventions. To deal with
281 naming conventions, you must follow their naming conventions. To deal with
243 cases like this, we propose the following policy:
282 cases like this, we propose the following policy:
244
283
245 * If you are subclassing a class that uses different conventions, use its
284 * If you are subclassing a class that uses different conventions, use its
246 naming conventions throughout your subclass. Thus, if you are creating a
285 naming conventions throughout your subclass. Thus, if you are creating a
247 Twisted Protocol class, used Twisted's
286 Twisted Protocol class, used Twisted's
248 ``namingSchemeForMethodsAndAttributes.``
287 ``namingSchemeForMethodsAndAttributes.``
249
288
250 * All IPython's official interfaces should use our conventions. In some cases
289 * All IPython's official interfaces should use our conventions. In some cases
251 this will mean that you need to provide shadow names (first implement
290 this will mean that you need to provide shadow names (first implement
252 ``fooBar`` and then ``foo_bar = fooBar``). We want to avoid this at all
291 ``fooBar`` and then ``foo_bar = fooBar``). We want to avoid this at all
253 costs, but it will probably be necessary at times. But, please use this
292 costs, but it will probably be necessary at times. But, please use this
254 sparingly!
293 sparingly!
255
294
256 Implementation-specific *private* methods will use
295 Implementation-specific *private* methods will use
257 ``_single_underscore_prefix``. Names with a leading double underscore will
296 ``_single_underscore_prefix``. Names with a leading double underscore will
258 *only* be used in special cases, as they makes subclassing difficult (such
297 *only* be used in special cases, as they makes subclassing difficult (such
259 names are not easily seen by child classes).
298 names are not easily seen by child classes).
260
299
261 Occasionally some run-in lowercase names are used, but mostly for very short
300 Occasionally some run-in lowercase names are used, but mostly for very short
262 names or where we are implementing methods very similar to existing ones in a
301 names or where we are implementing methods very similar to existing ones in a
263 base class (like ``runlines()`` where ``runsource()`` and ``runcode()`` had
302 base class (like ``runlines()`` where ``runsource()`` and ``runcode()`` had
264 established precedent).
303 established precedent).
265
304
266 The old IPython codebase has a big mix of classes and modules prefixed with an
305 The old IPython codebase has a big mix of classes and modules prefixed with an
267 explicit ``IP``. In Python this is mostly unnecessary, redundant and frowned
306 explicit ``IP``. In Python this is mostly unnecessary, redundant and frowned
268 upon, as namespaces offer cleaner prefixing. The only case where this approach
307 upon, as namespaces offer cleaner prefixing. The only case where this approach
269 is justified is for classes which are expected to be imported into external
308 is justified is for classes which are expected to be imported into external
270 namespaces and a very generic name (like Shell) is too likely to clash with
309 namespaces and a very generic name (like Shell) is too likely to clash with
271 something else. We'll need to revisit this issue as we clean up and refactor
310 something else. We'll need to revisit this issue as we clean up and refactor
272 the code, but in general we should remove as many unnecessary ``IP``/``ip``
311 the code, but in general we should remove as many unnecessary ``IP``/``ip``
273 prefixes as possible. However, if a prefix seems absolutely necessary the more
312 prefixes as possible. However, if a prefix seems absolutely necessary the more
274 specific ``IPY`` or ``ipy`` are preferred.
313 specific ``IPY`` or ``ipy`` are preferred.
275
314
276 .. _devel_testing:
315 .. _devel_testing:
277
316
278 Testing system
317 Testing system
279 ==============
318 ==============
280
319
281 It is extremely important that all code contributed to IPython has tests.
320 It is extremely important that all code contributed to IPython has tests.
282 Tests should be written as unittests, doctests or as entities that the Nose
321 Tests should be written as unittests, doctests or as entities that the Nose
283 [Nose]_ testing package will find. Regardless of how the tests are written, we
322 [Nose]_ testing package will find. Regardless of how the tests are written, we
284 will use Nose for discovering and running the tests. Nose will be required to
323 will use Nose for discovering and running the tests. Nose will be required to
285 run the IPython test suite, but will not be required to simply use IPython.
324 run the IPython test suite, but will not be required to simply use IPython.
286
325
287 Tests of Twisted using code need to follow two additional guidelines:
326 Tests of Twisted using code need to follow two additional guidelines:
288
327
289 1. Twisted using tests should be written by subclassing the :class:`TestCase`
328 1. Twisted using tests should be written by subclassing the :class:`TestCase`
290 class that comes with :mod:`twisted.trial.unittest`.
329 class that comes with :mod:`twisted.trial.unittest`.
291
330
292 2. All :class:`Deferred` instances that are created in the test must be
331 2. All :class:`Deferred` instances that are created in the test must be
293 properly chained and the final one *must* be the return value of the test
332 properly chained and the final one *must* be the return value of the test
294 method.
333 method.
295
334
296 When these two things are done, Nose will be able to run the tests and the
335 When these two things are done, Nose will be able to run the tests and the
297 twisted reactor will be handled correctly.
336 twisted reactor will be handled correctly.
298
337
299 Each subpackage in IPython should have its own :file:`tests` directory that
338 Each subpackage in IPython should have its own :file:`tests` directory that
300 contains all of the tests for that subpackage. This allows each subpackage to
339 contains all of the tests for that subpackage. This allows each subpackage to
301 be self-contained. A good convention to follow is to have a file named
340 be self-contained. A good convention to follow is to have a file named
302 :file:`test_foo.py` for each module :file:`foo.py` in the package. This makes
341 :file:`test_foo.py` for each module :file:`foo.py` in the package. This makes
303 it easy to organize the tests, though like most conventions, it's OK to break
342 it easy to organize the tests, though like most conventions, it's OK to break
304 it if logic and common sense dictate otherwise.
343 it if logic and common sense dictate otherwise.
305
344
306 If a subpackage has any dependencies beyond the Python standard library, the
345 If a subpackage has any dependencies beyond the Python standard library, the
307 tests for that subpackage should be skipped if the dependencies are not
346 tests for that subpackage should be skipped if the dependencies are not
308 found. This is very important so users don't get tests failing simply because
347 found. This is very important so users don't get tests failing simply because
309 they don't have dependencies. We ship a set of decorators in the
348 they don't have dependencies. We ship a set of decorators in the
310 :mod:`IPython.testing` package to tag tests that may be platform-specific or
349 :mod:`IPython.testing` package to tag tests that may be platform-specific or
311 otherwise may have restrictions; if the existing ones don't fit your needs, add
350 otherwise may have restrictions; if the existing ones don't fit your needs, add
312 a new decorator in that location so other tests can reuse it.
351 a new decorator in that location so other tests can reuse it.
313
352
314 To run the IPython test suite, use the :command:`iptest` command that is
353 To run the IPython test suite, use the :command:`iptest` command that is
315 installed with IPython (if you are using IPython in-place, without installing
354 installed with IPython (if you are using IPython in-place, without installing
316 it, you can find this script in the :file:`scripts` directory)::
355 it, you can find this script in the :file:`scripts` directory)::
317
356
318 $ iptest
357 $ iptest
319
358
320 This command runs Nose with the proper options and extensions. By default,
359 This command colects all IPython tests into separate groups, and then calls
321 :command:`iptest` runs the entire IPython test suite (skipping tests that may
360 either Nose with the proper options and extensions, or Twisted's
322 be platform-specific or which depend on tools you may not have). But you can
361 :command:`trial`. This ensures that tests that need the Twisted reactor
323 also use it to run only one specific test file, or a specific test function.
362 management facilities execute separate of Nose. If any individual test group
324 For example, this will run only the :file:`test_magic` file from the test
363 fails, :command:`iptest` will print what you need to type so you can rerun that
325 suite::
364 particular test group alone for debugging.
365
366 By default, :command:`iptest` runs the entire IPython test
367 suite (skipping tests that may be platform-specific or which depend on tools
368 you may not have). But you can also use it to run only one specific test file,
369 or a specific test function. For example, this will run only the
370 :file:`test_magic` file from the test suite::
326
371
327 $ iptest IPython.tests.test_magic
372 $ iptest IPython.tests.test_magic
328 ----------------------------------------------------------------------
373 ----------------------------------------------------------------------
329 Ran 10 tests in 0.348s
374 Ran 10 tests in 0.348s
330
375
331 OK (SKIP=3)
376 OK (SKIP=3)
332 Deleting object: second_pass
377 Deleting object: second_pass
333
378
334 while the ``path:function`` syntax allows you to select a specific function in
379 while the ``path:function`` syntax allows you to select a specific function in
335 that file to run::
380 that file to run::
336
381
337 $ iptest IPython.tests.test_magic:test_obj_del
382 $ iptest IPython.tests.test_magic:test_obj_del
338 ----------------------------------------------------------------------
383 ----------------------------------------------------------------------
339 Ran 1 test in 0.204s
384 Ran 1 test in 0.204s
340
385
341 OK
386 OK
342
387
343 Since :command:`iptest` is based on nosetests, you can pass it any regular
388 Since :command:`iptest` is based on nosetests, you can pass it any regular
344 nosetests option. For example, you can use ``--pdb`` or ``--pdb-failures`` to
389 nosetests option. For example, you can use ``--pdb`` or ``--pdb-failures`` to
345 automatically activate the interactive Pdb debugger on errors or failures. See
390 automatically activate the interactive Pdb debugger on errors or failures. See
346 the nosetests documentation for further details.
391 the nosetests documentation for further details.
347
392
348 .. warning::
349
350 Note that right now we have a nasty interaction between ipdoctest and
351 twisted. Until we figure this out, please use the following instructions to
352 ensure that at least you run all the tests.
353
354 Right now, if you now run::
355
356 $ iptest [any options] [any submodules]
357
358 it will NOT load ipdoctest but won't cause any Twisted problems.
359
360 Once you're happy that you didn't break Twisted, run::
361
362 $ iptest --with-ipdoctest [any options] [any submodules]
363
364 This MAY give a Twisted AlreadyCalledError exception at the end, but it will
365 also correctly load up all of the ipython-specific tests and doctests.
366
367 The above can be made easier with a trivial shell alias::
368
369 $ alias iptest2='iptest --with-ipdoctest'
370
371 So that you can run::
372
373 $ iptest ...
374 # Twisted happy
375 # iptest2 ...
376 # ignore possible Twisted error, this checks all the rest.
377
378
393
379 A few tips for writing tests
394 A few tips for writing tests
380 ----------------------------
395 ----------------------------
381
396
382 You can write tests either as normal test files, using all the conventions that
397 You can write tests either as normal test files, using all the conventions that
383 Nose recognizes, or as doctests. Note that *all* IPython functions should have
398 Nose recognizes, or as doctests. Note that *all* IPython functions should have
384 at least one example that serves as a doctest, whenever technically feasible.
399 at least one example that serves as a doctest, whenever technically feasible.
385 However, example doctests should only be in the main docstring if they are *a
400 However, example doctests should only be in the main docstring if they are *a
386 good example*, i.e. if they convey useful information about the function. If
401 good example*, i.e. if they convey useful information about the function. If
387 you simply would like to write a test as a doctest, put it in a separate test
402 you simply would like to write a test as a doctest, put it in a separate test
388 file and write a no-op function whose only purpose is its docstring.
403 file and write a no-op function whose only purpose is its docstring.
389
404
390 Note, however, that in a file named :file:`test_X`, functions whose only test
405 Note, however, that in a file named :file:`test_X`, functions whose only test
391 is their docstring (as a doctest) and which have no test functionality of their
406 is their docstring (as a doctest) and which have no test functionality of their
392 own, should be called *doctest_foo* instead of *test_foo*, otherwise they get
407 own, should be called *doctest_foo* instead of *test_foo*, otherwise they get
393 double-counted (the empty function call is counted as a test, which just
408 double-counted (the empty function call is counted as a test, which just
394 inflates tests numbers artificially). This restriction does not apply to
409 inflates tests numbers artificially). This restriction does not apply to
395 functions in files with other names, due to how Nose discovers tests.
410 functions in files with other names, due to how Nose discovers tests.
396
411
397 You can use IPython examples in your docstrings. Those can make full use of
412 You can use IPython examples in your docstrings. Those can make full use of
398 IPython functionality (magics, variable substitution, etc), but be careful to
413 IPython functionality (magics, variable substitution, etc), but be careful to
399 keep them generic enough that they run identically on all Operating Systems.
414 keep them generic enough that they run identically on all Operating Systems.
400
415
401 The prompts in your doctests can be either of the plain Python ``>>>`` variety
416 The prompts in your doctests can be either of the plain Python ``>>>`` variety
402 or ``In [1]:`` IPython style. Since this is the IPython system, after all, we
417 or ``In [1]:`` IPython style. Since this is the IPython system, after all, we
403 encourage you to use IPython prompts throughout, unless you are illustrating a
418 encourage you to use IPython prompts throughout, unless you are illustrating a
404 specific aspect of the normal prompts (such as the ``%doctest_mode`` magic).
419 specific aspect of the normal prompts (such as the ``%doctest_mode`` magic).
405
420
406 If a test isn't safe to run inside the main nose process (e.g. because it loads
421 If a test isn't safe to run inside the main nose process (e.g. because it loads
407 a GUI toolkit), consider running it in a subprocess and capturing its output
422 a GUI toolkit), consider running it in a subprocess and capturing its output
408 for evaluation and test decision later. Here is an example of how to do it, by
423 for evaluation and test decision later. Here is an example of how to do it, by
409 relying on the builtin ``_ip`` object that contains the public IPython api as
424 relying on the builtin ``_ip`` object that contains the public IPython api as
410 defined in :mod:`IPython.ipapi`::
425 defined in :mod:`IPython.ipapi`::
411
426
412 def test_obj_del():
427 def test_obj_del():
413 """Test that object's __del__ methods are called on exit."""
428 """Test that object's __del__ methods are called on exit."""
414 test_dir = os.path.dirname(__file__)
429 test_dir = os.path.dirname(__file__)
415 del_file = os.path.join(test_dir,'obj_del.py')
430 del_file = os.path.join(test_dir,'obj_del.py')
416 out = _ip.IP.getoutput('ipython %s' % del_file)
431 out = _ip.IP.getoutput('ipython %s' % del_file)
417 nt.assert_equals(out,'object A deleted')
432 nt.assert_equals(out,'object A deleted')
418
433
419
434
420
435
421 If a doctest contains input whose output you don't want to verify identically
436 If a doctest contains input whose output you don't want to verify identically
422 via doctest (random output, an object id, etc), you can mark a docstring with
437 via doctest (random output, an object id, etc), you can mark a docstring with
423 ``#random``. All of these test will have their code executed but no output
438 ``#random``. All of these test will have their code executed but no output
424 checking will be done::
439 checking will be done::
425
440
426 >>> 1+3
441 >>> 1+3
427 junk goes here... # random
442 junk goes here... # random
428
443
429 >>> 1+2
444 >>> 1+2
430 again, anything goes #random
445 again, anything goes #random
431 if multiline, the random mark is only needed once.
446 if multiline, the random mark is only needed once.
432
447
433 >>> 1+2
448 >>> 1+2
434 You can also put the random marker at the end:
449 You can also put the random marker at the end:
435 # random
450 # random
436
451
437 >>> 1+2
452 >>> 1+2
438 # random
453 # random
439 .. or at the beginning.
454 .. or at the beginning.
440
455
441 In a case where you want an *entire* docstring to be executed but not verified
456 In a case where you want an *entire* docstring to be executed but not verified
442 (this only serves to check that the code runs without crashing, so it should be
457 (this only serves to check that the code runs without crashing, so it should be
443 used very sparingly), you can put ``# all-random`` in the docstring.
458 used very sparingly), you can put ``# all-random`` in the docstring.
444
459
445 .. _devel_config:
460 .. _devel_config:
446
461
447 Release checklist
462 Release checklist
448 =================
463 =================
449
464
450 Most of the release process is automated by the :file:`release` script in the
465 Most of the release process is automated by the :file:`release` script in the
451 :file:`tools` directory. This is just a handy reminder for the release manager.
466 :file:`tools` directory. This is just a handy reminder for the release manager.
452
467
468 #. First, run :file:`build_release`, which does all the file checking and
469 building that the real release script will do. This will let you do test
470 installations, check that the build procedure runs OK, etc. You may want to
471 disable a few things like multi-version RPM building while testing, because
472 otherwise the build takes really long.
473
453 #. Run the release script, which makes the tar.gz, eggs and Win32 .exe
474 #. Run the release script, which makes the tar.gz, eggs and Win32 .exe
454 installer. It posts them to the site and registers the release with PyPI.
475 installer. It posts them to the site and registers the release with PyPI.
455
476
456 #. Updating the website with announcements and links to the updated
477 #. Updating the website with announcements and links to the updated
457 changes.txt in html form. Remember to put a short note both on the news
478 changes.txt in html form. Remember to put a short note both on the news
458 page of the site and on Launcphad.
479 page of the site and on Launcphad.
459
480
460 #. Drafting a short release announcement with i) highlights and ii) a link to
481 #. Drafting a short release announcement with i) highlights and ii) a link to
461 the html changes.txt.
482 the html changes.txt.
462
483
463 #. Make sure that the released version of the docs is live on the site.
484 #. Make sure that the released version of the docs is live on the site.
464
485
465 #. Celebrate!
486 #. Celebrate!
466
487
467 Porting to 3.0
488 Porting to 3.0
468 ==============
489 ==============
469
490
470 There are no definite plans for porting of IPython to python 3. The major
491 There are no definite plans for porting of IPython to python 3. The major
471 issue is the dependency on twisted framework for the networking/threading
492 issue is the dependency on twisted framework for the networking/threading
472 stuff. It is possible that it the traditional IPython interactive console
493 stuff. It is possible that it the traditional IPython interactive console
473 could be ported more easily since it has no such dependency. Here are a few
494 could be ported more easily since it has no such dependency. Here are a few
474 things that will need to be considered when doing such a port especially
495 things that will need to be considered when doing such a port especially
475 if we want to have a codebase that works directly on both 2.x and 3.x.
496 if we want to have a codebase that works directly on both 2.x and 3.x.
476
497
477 1. The syntax for exceptions changed (PEP 3110). The old
498 1. The syntax for exceptions changed (PEP 3110). The old
478 `except exc, var` changed to `except exc as var`. At last
499 `except exc, var` changed to `except exc as var`. At last
479 count there was 78 occurences of this usage in the codebase. This
500 count there was 78 occurences of this usage in the codebase. This
480 is a particularly problematic issue, because it's not easy to
501 is a particularly problematic issue, because it's not easy to
481 implement it in a 2.5-compatible way.
502 implement it in a 2.5-compatible way.
482
503
483 Because it is quite difficult to support simultaneously Python 2.5 and 3.x, we
504 Because it is quite difficult to support simultaneously Python 2.5 and 3.x, we
484 will likely at some point put out a release that requires strictly 2.6 and
505 will likely at some point put out a release that requires strictly 2.6 and
485 abandons 2.5 compatibility. This will then allow us to port the code to using
506 abandons 2.5 compatibility. This will then allow us to port the code to using
486 :func:`print` as a function, `except exc as var` syntax, etc. But as of
507 :func:`print` as a function, `except exc as var` syntax, etc. But as of
487 version 0.11 at least, we will retain Python 2.5 compatibility.
508 version 0.11 at least, we will retain Python 2.5 compatibility.
488
509
489
510
490 .. [Bazaar] Bazaar. http://bazaar-vcs.org/
511 .. [Bazaar] Bazaar. http://bazaar-vcs.org/
491 .. [Launchpad] Launchpad. http://www.launchpad.net/ipython
512 .. [Launchpad] Launchpad. http://www.launchpad.net/ipython
492 .. [reStructuredText] reStructuredText. http://docutils.sourceforge.net/rst.html
513 .. [reStructuredText] reStructuredText. http://docutils.sourceforge.net/rst.html
493 .. [Sphinx] Sphinx. http://sphinx.pocoo.org/
514 .. [Sphinx] Sphinx. http://sphinx.pocoo.org/
494 .. [Nose] Nose: a discovery based unittest extension. http://code.google.com/p/python-nose/
515 .. [Nose] Nose: a discovery based unittest extension. http://code.google.com/p/python-nose/
General Comments 0
You need to be logged in to leave comments. Login now