##// END OF EJS Templates
Work on documentation....
Brian Granger -
Show More
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
@@ -0,0 +1,191 b''
1 How to contribute to IPython
2 ============================
3
4 IPython development is done using Bazaar [Bazaar]_ and Launchpad [Launchpad]_.
5 This makes it easy for people to contribute to the development of IPython.
6 There are several ways in which you can join in.
7
8 If you have a small change that you want to send to the team, you can edit your
9 bazaar checkout of IPython (see below) in-place, and ask bazaar for the
10 differences::
11
12 $ cd /path/to/your/copy/of/ipython
13 $ bzr diff > my_fixes.diff
14
15 This produces a patch file with your fixes, which we can apply to the source
16 tree. This file should then be attached to a ticket in our `bug tracker
17 <https://bugs.launchpad.net/ipython>`_, indicating what it does.
18
19 This model of creating small, self-contained patches works very well and there
20 are open source projects that do their entire development this way. However,
21 in IPython we have found that for tracking larger changes, making use of
22 bazaar's full capabilities in conjunction with Launchpad's code hosting
23 services makes for a much better experience.
24
25 Making your own branch of IPython allows you to refine your changes over time,
26 track the development of the main team, and propose your own full version of
27 the code for others to use and review, with a minimum amount of fuss. The next
28 parts of this document will explain how to do this.
29
30 Install Bazaar and create a Launchpad account
31 ---------------------------------------------
32
33 First make sure you have installed Bazaar (see their `website
34 <http://bazaar-vcs.org/>`_). To see that Bazaar is installed and knows about
35 you, try the following::
36
37 $ bzr whoami
38 Joe Coder <jcoder@gmail.com>
39
40 This should display your name and email. Next, you will want to create an
41 account on the `Launchpad website <http://www.launchpad.net>`_ and setup your
42 ssh keys. For more information of setting up your ssh keys, see `this link
43 <https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair>`_.
44
45 Get the main IPython branch from Launchpad
46 ------------------------------------------
47
48 Now, you can get a copy of the main IPython development branch (we call this
49 the "trunk")::
50
51 $ bzr branch lp:ipython
52
53 Create a working branch
54 -----------------------
55
56 When working on IPython, you won't actually make edits directly to the
57 :file:`lp:ipython` branch. Instead, you will create a separate branch for your
58 changes. For now, let's assume you want to do your work in a branch named
59 "ipython-mybranch". Create this branch by doing::
60
61 $ bzr branch ipython ipython-mybranch
62
63 When you actually create a branch, you will want to give it a name that
64 reflects the nature of the work that you will be doing in it, like
65 "install-docs-update".
66
67 Make edits in your working branch
68 ---------------------------------
69
70 Now you are ready to actually make edits in your :file:`ipython-mybranch`
71 branch. Before doing this, it is helpful to install this branch so you can
72 test your changes as you work. This is easiest if you have setuptools
73 installed. Then, just do::
74
75 $ cd ipython-mybranch
76 $ python setupegg.py develop
77
78 Now, make some changes. After a while, you will want to commit your changes.
79 This let's Bazaar know that you like the changes you have made and gives you
80 an opportunity to keep a nice record of what you have done. This looks like
81 this::
82
83 $ ...do work in ipython-mybranch...
84 $ bzr commit -m "the commit message goes here"
85
86 Please note that since we now don't use an old-style linear ChangeLog (that
87 tends to cause problems with distributed version control systems), you should
88 ensure that your log messages are reasonably detailed. Use a docstring-like
89 approach in the commit messages (including the second line being left
90 *blank*)::
91
92 Single line summary of changes being committed.
93
94 * more details when warranted ...
95 * including crediting outside contributors if they sent the
96 code/bug/idea!
97
98 As you work, you will repeat this edit/commit cycle many times. If you work on
99 your branch for a long time, you will also want to get the latest changes from
100 the :file:`lp:ipython` branch. This can be done with the following sequence of
101 commands::
102
103 $ ls
104 ipython
105 ipython-mybranch
106
107 $ cd ipython
108 $ bzr pull
109 $ cd ../ipython-mybranch
110 $ bzr merge ../ipython
111 $ bzr commit -m "Merging changes from trunk"
112
113 Along the way, you should also run the IPython test suite. You can do this
114 using the :command:`iptest` command (which is basically a customized version of
115 :command:`nosetests`)::
116
117 $ cd
118 $ iptest
119
120 The :command:`iptest` command will also pick up and run any tests you have
121 written. See :ref:`testing documentation <devel_testing>` for further details
122 on the testing system.
123
124
125 Post your branch and request a code review
126 ------------------------------------------
127
128 Once you are done with your edits, you should post your branch on Launchpad so
129 that other IPython developers can review the changes and help you merge your
130 changes into the main development branch. To post your branch on Launchpad,
131 do::
132
133 $ cd ipython-mybranch
134 $ bzr push lp:~yourusername/ipython/ipython-mybranch
135
136 Then, go to the `IPython Launchpad site <www.launchpad.net/ipython>`_, and you
137 should see your branch under the "Code" tab. If you click on your branch, you
138 can provide a short description of the branch as well as mark its status. Most
139 importantly, you should click the link that reads "Propose for merging into
140 another branch". What does this do?
141
142 This let's the other IPython developers know that your branch is ready to be
143 reviewed and merged into the main development branch. During this review
144 process, other developers will give you feedback and help you get your code
145 ready to be merged. What types of things will we be looking for:
146
147 * All code is documented.
148 * All code has tests.
149 * The entire IPython test suite passes.
150
151 Once your changes have been reviewed and approved, someone will merge them
152 into the main development branch.
153
154
155 Some notes for core developers when merging third-party contributions
156 =====================================================================
157
158 Core developers, who ultimately merge any approved branch (from themselves,
159 another developer, or any third-party contribution) will typically use
160 :command:`bzr merge` to merge the branch into the trunk and push it to the
161 main Launcphad site. This is a short list of things to keep in mind when doing
162 this process, so that the project history is easy to understand in the long
163 run, and that generating release notes is as painless and accurate as
164 possible.
165
166 - When you merge any non-trivial functionality (from one small bug fix to a
167 big feature branch), please remember to always edit the :file:`changes.txt`
168 file accordingly. This file has one main section for each release, and if
169 you edit it as you go, noting what new features, bug fixes or API changes
170 you have made, the release notes will be almost finished when they are
171 needed later. This is much easier if done when you merge the work, rather
172 than weeks or months later by re-reading a massive Bazaar log.
173
174 - When big merges are done, the practice of putting a summary commit message
175 in the merge is *extremely* useful. It makes this kind of job much nicer,
176 because that summary log message can be almost copy/pasted without changes,
177 if it was well written, rather than dissecting the next-level messages from
178 the individual commits.
179
180 - It's important that we remember to always credit who gave us something if
181 it's not the committer. In general, we have been fairly good on this front,
182 this is just a reminder to keep things up. As a note, if you are ever
183 committing something that is completely (or almost so) a third-party
184 contribution, do the commit as::
185
186 $ bzr commit --author="Someone Else"
187
188 This way it will show that name separately in the log, which makes it even
189 easier to spot. Obviously we often rework third party contributions
190 extensively, but this is still good to keep in mind for cases when we don't
191 touch the code too much. No newline at end of file
@@ -0,0 +1,25 b''
1 Release checklist
2 =================
3
4 Most of the release process is automated by the :file:`release` script in the
5 :file:`tools` directory. This is just a handy reminder for the release manager.
6
7 #. First, run :file:`build_release`, which does all the file checking and
8 building that the real release script will do. This will let you do test
9 installations, check that the build procedure runs OK, etc. You may want to
10 disable a few things like multi-version RPM building while testing, because
11 otherwise the build takes really long.
12
13 #. Run the release script, which makes the tar.gz, eggs and Win32 .exe
14 installer. It posts them to the site and registers the release with PyPI.
15
16 #. Updating the website with announcements and links to the updated
17 changes.txt in html form. Remember to put a short note both on the news
18 page of the site and on Launcphad.
19
20 #. Drafting a short release announcement with i) highlights and ii) a link to
21 the html changes.txt.
22
23 #. Make sure that the released version of the docs is live on the site.
24
25 #. Celebrate! No newline at end of file
@@ -0,0 +1,194 b''
1 .. _testing:
2
3 =========================
4 Writing and running tests
5 =========================
6
7 Overview
8 ========
9
10 It is extremely important that all code contributed to IPython has tests.
11 Tests should be written as unittests, doctests or other entities that the
12 IPython test system can detect. See below for more details on this.
13
14 Each subpackage in IPython should have its own :file:`tests` directory that
15 contains all of the tests for that subpackage. All of the files in the
16 :file:`tests` directory should have the word "tests" in them to enable
17 the testing framework to find them.
18
19 If a subpackage has any dependencies beyond the Python standard library, the
20 tests for that subpackage should be skipped if the dependencies are not found.
21 This is very important so users don't get tests failing simply because they
22 don't have dependencies. We are still figuring out the best way for this
23 to be handled.
24
25 Status
26 ======
27
28 Currently IPython's testing system is being reworked. In the meantime,
29 we recommend the following testing practices:
30
31 * To run regular tests, use the :cmd:`nosetests` command on a per file basis:
32
33 .. code-block:: bash
34
35 nosetests -vvs IPython.core.tests.test_component
36
37 * To run Twisted-using tests, use the :cmd:`trial` command on a per file
38 basis:
39
40 .. code-block:: bash
41
42 trial IPython.kernel
43
44 * For now, regular tests (of non-Twisted using code) should be written as
45 unit tests. They should be subclasses of :class:`unittest.TestCase`.
46
47 * Tests of Twisted [Twisted]_ using code should be written by subclassing the
48 ``TestCase`` class that comes with ``twisted.trial.unittest``.
49
50 .. _devel_testing:
51
52 Older material
53 ==============
54
55 It is extremely important that all code contributed to IPython has tests.
56 Tests should be written as unittests, doctests or as entities that the Nose
57 [Nose]_ testing package will find. Regardless of how the tests are written, we
58 will use Nose for discovering and running the tests. Nose will be required to
59 run the IPython test suite, but will not be required to simply use IPython.
60
61 Tests of Twisted using code need to follow two additional guidelines:
62
63 1. Twisted using tests should be written by subclassing the :class:`TestCase`
64 class that comes with :mod:`twisted.trial.unittest`.
65
66 2. All :class:`Deferred` instances that are created in the test must be
67 properly chained and the final one *must* be the return value of the test
68 method.
69
70 When these two things are done, Nose will be able to run the tests and the
71 twisted reactor will be handled correctly.
72
73 Each subpackage in IPython should have its own :file:`tests` directory that
74 contains all of the tests for that subpackage. This allows each subpackage to
75 be self-contained. A good convention to follow is to have a file named
76 :file:`test_foo.py` for each module :file:`foo.py` in the package. This makes
77 it easy to organize the tests, though like most conventions, it's OK to break
78 it if logic and common sense dictate otherwise.
79
80 If a subpackage has any dependencies beyond the Python standard library, the
81 tests for that subpackage should be skipped if the dependencies are not
82 found. This is very important so users don't get tests failing simply because
83 they don't have dependencies. We ship a set of decorators in the
84 :mod:`IPython.testing` package to tag tests that may be platform-specific or
85 otherwise may have restrictions; if the existing ones don't fit your needs, add
86 a new decorator in that location so other tests can reuse it.
87
88 To run the IPython test suite, use the :command:`iptest` command that is
89 installed with IPython (if you are using IPython in-place, without installing
90 it, you can find this script in the :file:`scripts` directory)::
91
92 $ iptest
93
94 This command colects all IPython tests into separate groups, and then calls
95 either Nose with the proper options and extensions, or Twisted's
96 :command:`trial`. This ensures that tests that need the Twisted reactor
97 management facilities execute separate of Nose. If any individual test group
98 fails, :command:`iptest` will print what you need to type so you can rerun that
99 particular test group alone for debugging.
100
101 By default, :command:`iptest` runs the entire IPython test
102 suite (skipping tests that may be platform-specific or which depend on tools
103 you may not have). But you can also use it to run only one specific test file,
104 or a specific test function. For example, this will run only the
105 :file:`test_magic` file from the test suite::
106
107 $ iptest IPython.tests.test_magic
108 ----------------------------------------------------------------------
109 Ran 10 tests in 0.348s
110
111 OK (SKIP=3)
112 Deleting object: second_pass
113
114 while the ``path:function`` syntax allows you to select a specific function in
115 that file to run::
116
117 $ iptest IPython.tests.test_magic:test_obj_del
118 ----------------------------------------------------------------------
119 Ran 1 test in 0.204s
120
121 OK
122
123 Since :command:`iptest` is based on nosetests, you can pass it any regular
124 nosetests option. For example, you can use ``--pdb`` or ``--pdb-failures`` to
125 automatically activate the interactive Pdb debugger on errors or failures. See
126 the nosetests documentation for further details.
127
128
129 A few tips for writing tests
130 ----------------------------
131
132 You can write tests either as normal test files, using all the conventions that
133 Nose recognizes, or as doctests. Note that *all* IPython functions should have
134 at least one example that serves as a doctest, whenever technically feasible.
135 However, example doctests should only be in the main docstring if they are *a
136 good example*, i.e. if they convey useful information about the function. If
137 you simply would like to write a test as a doctest, put it in a separate test
138 file and write a no-op function whose only purpose is its docstring.
139
140 Note, however, that in a file named :file:`test_X`, functions whose only test
141 is their docstring (as a doctest) and which have no test functionality of their
142 own, should be called *doctest_foo* instead of *test_foo*, otherwise they get
143 double-counted (the empty function call is counted as a test, which just
144 inflates tests numbers artificially). This restriction does not apply to
145 functions in files with other names, due to how Nose discovers tests.
146
147 You can use IPython examples in your docstrings. Those can make full use of
148 IPython functionality (magics, variable substitution, etc), but be careful to
149 keep them generic enough that they run identically on all Operating Systems.
150
151 The prompts in your doctests can be either of the plain Python ``>>>`` variety
152 or ``In [1]:`` IPython style. Since this is the IPython system, after all, we
153 encourage you to use IPython prompts throughout, unless you are illustrating a
154 specific aspect of the normal prompts (such as the ``%doctest_mode`` magic).
155
156 If a test isn't safe to run inside the main nose process (e.g. because it loads
157 a GUI toolkit), consider running it in a subprocess and capturing its output
158 for evaluation and test decision later. Here is an example of how to do it, by
159 relying on the builtin ``_ip`` object that contains the public IPython api as
160 defined in :mod:`IPython.ipapi`::
161
162 def test_obj_del():
163 """Test that object's __del__ methods are called on exit."""
164 test_dir = os.path.dirname(__file__)
165 del_file = os.path.join(test_dir,'obj_del.py')
166 out = _ip.IP.getoutput('ipython %s' % del_file)
167 nt.assert_equals(out,'object A deleted')
168
169
170
171 If a doctest contains input whose output you don't want to verify identically
172 via doctest (random output, an object id, etc), you can mark a docstring with
173 ``#random``. All of these test will have their code executed but no output
174 checking will be done::
175
176 >>> 1+3
177 junk goes here... # random
178
179 >>> 1+2
180 again, anything goes #random
181 if multiline, the random mark is only needed once.
182
183 >>> 1+2
184 You can also put the random marker at the end:
185 # random
186
187 >>> 1+2
188 # random
189 .. or at the beginning.
190
191 In a case where you want an *entire* docstring to be executed but not verified
192 (this only serves to check that the code runs without crashing, so it should be
193 used very sparingly), you can put ``# all-random`` in the docstring.
194
@@ -4,205 +4,206 b''
4 Credits
4 Credits
5 =======
5 =======
6
6
7 IPython is led by Fernando Pérez.
7 IPython was started and continues to be led by Fernando Pérez.
8
8
9 As of this writing, the following developers have joined the core team:
9 Core developers
10 ===============
10
11
11 * [Robert Kern] <rkern-AT-enthought.com>: co-mentored the 2005
12 As of this writing, core development team consists of the following
12 Google Summer of Code project to develop python interactive
13 developers:
13 notebooks (XML documents) and graphical interface. This project
14 was awarded to the students Tzanko Matev <tsanko-AT-gmail.com> and
15 Toni Alatalo <antont-AT-an.org>.
16
14
17 * [Brian Granger] <ellisonbg-AT-gmail.com>: extending IPython to allow
15 * **Fernando Pérez** <Fernando.Perez-AT-berkeley.edu> Project creator and leader,
18 support for interactive parallel computing.
16 IPython core, parallel computing infrastructure, testing, release manager.
19
17
20 * [Benjamin (Min) Ragan-Kelley]: key work on IPython's parallel
18 * **Robert Kern** <rkern-AT-enthought.com> Co-mentored the 2005 Google Summer of
21 computing infrastructure.
19 Code project, work on IPython's core.
22
20
23 * [Ville Vainio] <vivainio-AT-gmail.com>: Ville has made many improvements
21 * **Brian Granger** <ellisonbg-AT-gmail.com> Parallel computing
24 to the core of IPython and was the maintainer of the main IPython
22 infrastructure, IPython core.
25 trunk from version 0.7.1 to 0.8.4.
26
23
27 * [Gael Varoquaux] <gael.varoquaux-AT-normalesup.org>: work on the merged
24 * **Benjamin (Min) Ragan-Kelley** <benjaminrk-AT-gmail.com> Parallel computing
28 architecture for the interpreter as of version 0.9, implementing a new WX GUI
25 infrastructure.
29 based on this system.
30
26
31 * [Barry Wark] <barrywark-AT-gmail.com>: implementing a new Cocoa GUI, as well
27 * **Ville Vainio** <vivainio-AT-gmail.com> IPython core, maintainer of IPython
32 as work on the new interpreter architecture and Twisted support.
28 trunk from version 0.7.2 to 0.8.4.
33
29
34 * [Laurent Dufrechou] <laurent.dufrechou-AT-gmail.com>: development of the WX
30 * **Gael Varoquaux** <gael.varoquaux-AT-normalesup.org> wxPython IPython GUI,
35 GUI support.
31 frontend architecture.
36
32
37 * [Jörgen Stenarson] <jorgen.stenarson-AT-bostream.nu>: maintainer of the
33 * **Barry Wark** <barrywark-AT-gmail.com> Cocoa GUI, frontend architecture.
38 PyReadline project, necessary for IPython under windows.
39
34
35 * **Laurent Dufrechou** <laurent.dufrechou-AT-gmail.com> wxPython IPython GUI.
36
37 * **Jörgen Stenarson** <jorgen.stenarson-AT-bostream.nu> Maintainer of the
38 PyReadline project, which is needed for IPython under windows.
39
40 Special thanks
41 ==============
40
42
41 The IPython project is also very grateful to:
43 The IPython project is also very grateful to:
42
44
43 Bill Bumgarner <bbum-AT-friday.com>: for providing the DPyGetOpt module
45 Bill Bumgarner <bbum-AT-friday.com>, for providing the DPyGetOpt module that
44 which gives very powerful and convenient handling of command-line
46 IPython used for parsing command line options through version 0.10.
45 options (light years ahead of what Python 2.1.1's getopt module does).
46
47
47 Ka-Ping Yee <ping-AT-lfw.org>: for providing the Itpl module for
48 Ka-Ping Yee <ping-AT-lfw.org>, for providing the Itpl module for convenient
48 convenient and powerful string interpolation with a much nicer syntax
49 and powerful string interpolation with a much nicer syntax than formatting
49 than formatting through the '%' operator.
50 through the '%' operator.
50
51
51 Arnd Baecker <baecker-AT-physik.tu-dresden.de>: for his many very useful
52 Arnd Baecker <baecker-AT-physik.tu-dresden.de>, for his many very useful
52 suggestions and comments, and lots of help with testing and
53 suggestions and comments, and lots of help with testing and documentation
53 documentation checking. Many of IPython's newer features are a result of
54 checking. Many of IPython's newer features are a result of discussions with
54 discussions with him (bugs are still my fault, not his).
55 him.
55
56
56 Obviously Guido van Rossum and the whole Python development team, that
57 Obviously Guido van Rossum and the whole Python development team, for creating
57 goes without saying.
58 a great language for interactive computing.
58
59
59 IPython's website is generously hosted at http://ipython.scipy.orgby
60 Enthought (http://www.enthought.com), for hosting IPython's website and
60 Enthought (http://www.enthought.com). I am very grateful to them and all
61 supporting the project in various ways over the years.
61 of the SciPy team for their contribution.
62
62
63 Fernando would also like to thank Stephen Figgins <fig-AT-monitor.net>,
63 Fernando would also like to thank Stephen Figgins <fig-AT-monitor.net>,
64 an O'Reilly Python editor. His Oct/11/2001 article about IPP and
64 an O'Reilly Python editor. His October 11, 2001 article about IPP and
65 LazyPython, was what got this project started. You can read it at:
65 LazyPython, was what got this project started. You can read it at
66 http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html.
66 http://www.onlamp.com/pub/a/python/2001/10/11/pythonnews.html.
67
67
68 And last but not least, all the kind IPython users who have emailed new code,
68 Contributors
69 bug reports, fixes, comments and ideas. A brief list follows, please let us
69 ============
70 know if we have ommitted your name by accident:
70
71 And last but not least, all the kind IPython contributors who have contributed
72 new code, bug reports, fixes, comments and ideas. A brief list follows, please
73 let us know if we have omitted your name by accident:
71
74
72 * Dan Milstein <danmil-AT-comcast.net>. A bold refactoring of the
75 * Dan Milstein <danmil-AT-comcast.net> A bold refactor of the core prefilter
73 core prefilter stuff in the IPython interpreter.
76 machinery in the IPython interpreter.
74
77
75 * [Jack Moffit] <jack-AT-xiph.org> Bug fixes, including the infamous
78 * Jack Moffit <jack-AT-xiph.org> Bug fixes, including the infamous color
76 color problem. This bug alone caused many lost hours and
79 problem. This bug alone caused many lost hours and frustration, many thanks
77 frustration, many thanks to him for the fix. I've always been a
80 to him for the fix. I've always been a fan of Ogg & friends, now I have one
78 fan of Ogg & friends, now I have one more reason to like these folks.
81 more reason to like these folks. Jack is also contributing with Debian
79 Jack is also contributing with Debian packaging and many other
82 packaging and many other things.
80 things.
81
83
82 * [Alexander Schmolck] <a.schmolck-AT-gmx.net> Emacs work, bug
84 * Alexander Schmolck <a.schmolck-AT-gmx.net> Emacs work, bug reports, bug
83 reports, bug fixes, ideas, lots more. The ipython.el mode for
85 fixes, ideas, lots more. The ipython.el mode for (X)Emacs is Alex's code,
84 (X)Emacs is Alex's code, providing full support for IPython under
86 providing full support for IPython under (X)Emacs.
85 (X)Emacs.
86
87
87 * [Andrea Riciputi] <andrea.riciputi-AT-libero.it> Mac OSX
88 * Andrea Riciputi <andrea.riciputi-AT-libero.it> Mac OSX information, Fink
88 information, Fink package management.
89 package management.
89
90
90 * [Gary Bishop] <gb-AT-cs.unc.edu> Bug reports, and patches to work
91 * Gary Bishop <gb-AT-cs.unc.edu> Bug reports, and patches to work around the
91 around the exception handling idiosyncracies of WxPython. Readline
92 exception handling idiosyncracies of WxPython. Readline and color support
92 and color support for Windows.
93 for Windows.
93
94
94 * [Jeffrey Collins] <Jeff.Collins-AT-vexcel.com> Bug reports. Much
95 * Jeffrey Collins <Jeff.Collins-AT-vexcel.com>. Bug reports. Much improved
95 improved readline support, including fixes for Python 2.3.
96 readline support, including fixes for Python 2.3.
96
97
97 * [Dryice Liu] <dryice-AT-liu.com.cn> FreeBSD port.
98 * Dryice Liu <dryice-AT-liu.com.cn> FreeBSD port.
98
99
99 * [Mike Heeter] <korora-AT-SDF.LONESTAR.ORG>
100 * Mike Heeter <korora-AT-SDF.LONESTAR.ORG>
100
101
101 * [Christopher Hart] <hart-AT-caltech.edu> PDB integration.
102 * Christopher Hart <hart-AT-caltech.edu> PDB integration.
102
103
103 * [Milan Zamazal] <pdm-AT-zamazal.org> Emacs info.
104 * Milan Zamazal <pdm-AT-zamazal.org> Emacs info.
104
105
105 * [Philip Hisley] <compsys-AT-starpower.net>
106 * Philip Hisley <compsys-AT-starpower.net>
106
107
107 * [Holger Krekel] <pyth-AT-devel.trillke.net> Tab completion, lots
108 * Holger Krekel <pyth-AT-devel.trillke.net> Tab completion, lots more.
108 more.
109
109
110 * [Robin Siebler] <robinsiebler-AT-starband.net>
110 * Robin Siebler <robinsiebler-AT-starband.net>
111
111
112 * [Ralf Ahlbrink] <ralf_ahlbrink-AT-web.de>
112 * Ralf Ahlbrink <ralf_ahlbrink-AT-web.de>
113
113
114 * [Thorsten Kampe] <thorsten-AT-thorstenkampe.de>
114 * Thorsten Kampe <thorsten-AT-thorstenkampe.de>
115
115
116 * [Fredrik Kant] <fredrik.kant-AT-front.com> Windows setup.
116 * Fredrik Kant <fredrik.kant-AT-front.com> Windows setup.
117
117
118 * [Syver Enstad] <syver-en-AT-online.no> Windows setup.
118 * Syver Enstad <syver-en-AT-online.no> Windows setup.
119
119
120 * [Richard] <rxe-AT-renre-europe.com> Global embedding.
120 * Richard <rxe-AT-renre-europe.com> Global embedding.
121
121
122 * [Hayden Callow] <h.callow-AT-elec.canterbury.ac.nz> Gnuplot.py 1.6
122 * Hayden Callow <h.callow-AT-elec.canterbury.ac.nz> Gnuplot.py 1.6
123 compatibility.
123 compatibility.
124
124
125 * [Leonardo Santagada] <retype-AT-terra.com.br> Fixes for Windows
125 * Leonardo Santagada <retype-AT-terra.com.br> Fixes for Windows
126 installation.
126 installation.
127
127
128 * [Christopher Armstrong] <radix-AT-twistedmatrix.com> Bugfixes.
128 * Christopher Armstrong <radix-AT-twistedmatrix.com> Bugfixes.
129
129
130 * [Francois Pinard] <pinard-AT-iro.umontreal.ca> Code and
130 * Francois Pinard <pinard-AT-iro.umontreal.ca> Code and
131 documentation fixes.
131 documentation fixes.
132
132
133 * [Cory Dodt] <cdodt-AT-fcoe.k12.ca.us> Bug reports and Windows
133 * Cory Dodt <cdodt-AT-fcoe.k12.ca.us> Bug reports and Windows
134 ideas. Patches for Windows installer.
134 ideas. Patches for Windows installer.
135
135
136 * [Olivier Aubert] <oaubert-AT-bat710.univ-lyon1.fr> New magics.
136 * Olivier Aubert <oaubert-AT-bat710.univ-lyon1.fr> New magics.
137
137
138 * [King C. Shu] <kingshu-AT-myrealbox.com> Autoindent patch.
138 * King C. Shu <kingshu-AT-myrealbox.com> Autoindent patch.
139
139
140 * [Chris Drexler] <chris-AT-ac-drexler.de> Readline packages for
140 * Chris Drexler <chris-AT-ac-drexler.de> Readline packages for
141 Win32/CygWin.
141 Win32/CygWin.
142
142
143 * [Gustavo Cordova Avila] <gcordova-AT-sismex.com> EvalDict code for
143 * Gustavo Cordova Avila <gcordova-AT-sismex.com> EvalDict code for
144 nice, lightweight string interpolation.
144 nice, lightweight string interpolation.
145
145
146 * [Kasper Souren] <Kasper.Souren-AT-ircam.fr> Bug reports, ideas.
146 * Kasper Souren <Kasper.Souren-AT-ircam.fr> Bug reports, ideas.
147
147
148 * [Gever Tulley] <gever-AT-helium.com> Code contributions.
148 * Gever Tulley <gever-AT-helium.com> Code contributions.
149
149
150 * [Ralf Schmitt] <ralf-AT-brainbot.com> Bug reports & fixes.
150 * Ralf Schmitt <ralf-AT-brainbot.com> Bug reports & fixes.
151
151
152 * [Oliver Sander] <osander-AT-gmx.de> Bug reports.
152 * Oliver Sander <osander-AT-gmx.de> Bug reports.
153
153
154 * [Rod Holland] <rhh-AT-structurelabs.com> Bug reports and fixes to
154 * Rod Holland <rhh-AT-structurelabs.com> Bug reports and fixes to
155 logging module.
155 logging module.
156
156
157 * [Daniel 'Dang' Griffith] <pythondev-dang-AT-lazytwinacres.net>
157 * Daniel 'Dang' Griffith <pythondev-dang-AT-lazytwinacres.net>
158 Fixes, enhancement suggestions for system shell use.
158 Fixes, enhancement suggestions for system shell use.
159
159
160 * [Viktor Ransmayr] <viktor.ransmayr-AT-t-online.de> Tests and
160 * Viktor Ransmayr <viktor.ransmayr-AT-t-online.de> Tests and
161 reports on Windows installation issues. Contributed a true Windows
161 reports on Windows installation issues. Contributed a true Windows
162 binary installer.
162 binary installer.
163
163
164 * [Mike Salib] <msalib-AT-mit.edu> Help fixing a subtle bug related
164 * Mike Salib <msalib-AT-mit.edu> Help fixing a subtle bug related
165 to traceback printing.
165 to traceback printing.
166
166
167 * [W.J. van der Laan] <gnufnork-AT-hetdigitalegat.nl> Bash-like
167 * W.J. van der Laan <gnufnork-AT-hetdigitalegat.nl> Bash-like
168 prompt specials.
168 prompt specials.
169
169
170 * [Antoon Pardon] <Antoon.Pardon-AT-rece.vub.ac.be> Critical fix for
170 * Antoon Pardon <Antoon.Pardon-AT-rece.vub.ac.be> Critical fix for
171 the multithreaded IPython.
171 the multithreaded IPython.
172
172
173 * [John Hunter] <jdhunter-AT-nitace.bsd.uchicago.edu> Matplotlib
173 * John Hunter <jdhunter-AT-nitace.bsd.uchicago.edu> Matplotlib
174 author, helped with all the development of support for matplotlib
174 author, helped with all the development of support for matplotlib
175 in IPyhton, including making necessary changes to matplotlib itself.
175 in IPyhton, including making necessary changes to matplotlib itself.
176
176
177 * [Matthew Arnison] <maffew-AT-cat.org.au> Bug reports, '%run -d' idea.
177 * Matthew Arnison <maffew-AT-cat.org.au> Bug reports, '%run -d' idea.
178
178
179 * [Prabhu Ramachandran] <prabhu_r-AT-users.sourceforge.net> Help
179 * Prabhu Ramachandran <prabhu_r-AT-users.sourceforge.net> Help
180 with (X)Emacs support, threading patches, ideas...
180 with (X)Emacs support, threading patches, ideas...
181
181
182 * [Norbert Tretkowski] <tretkowski-AT-inittab.de> help with Debian
182 * Norbert Tretkowski <tretkowski-AT-inittab.de> help with Debian
183 packaging and distribution.
183 packaging and distribution.
184
184
185 * [George Sakkis] <gsakkis-AT-eden.rutgers.edu> New matcher for
185 * George Sakkis <gsakkis-AT-eden.rutgers.edu> New matcher for
186 tab-completing named arguments of user-defined functions.
186 tab-completing named arguments of user-defined functions.
187
187
188 * [Jörgen Stenarson] <jorgen.stenarson-AT-bostream.nu> Wildcard
188 * Jörgen Stenarson <jorgen.stenarson-AT-bostream.nu> Wildcard
189 support implementation for searching namespaces.
189 support implementation for searching namespaces.
190
190
191 * [Vivian De Smedt] <vivian-AT-vdesmedt.com> Debugger enhancements,
191 * Vivian De Smedt <vivian-AT-vdesmedt.com> Debugger enhancements,
192 so that when pdb is activated from within IPython, coloring, tab
192 so that when pdb is activated from within IPython, coloring, tab
193 completion and other features continue to work seamlessly.
193 completion and other features continue to work seamlessly.
194
194
195 * [Scott Tsai] <scottt958-AT-yahoo.com.tw> Support for automatic
195 * Scott Tsai <scottt958-AT-yahoo.com.tw> Support for automatic
196 editor invocation on syntax errors (see
196 editor invocation on syntax errors (see
197 http://www.scipy.net/roundup/ipython/issue36).
197 http://www.scipy.net/roundup/ipython/issue36).
198
198
199 * [Alexander Belchenko] <bialix-AT-ukr.net> Improvements for win32
199 * Alexander Belchenko <bialix-AT-ukr.net> Improvements for win32
200 paging system.
200 paging system.
201
201
202 * [Will Maier] <willmaier-AT-ml1.net> Official OpenBSD port.
202 * Will Maier <willmaier-AT-ml1.net> Official OpenBSD port.
203
203
204 * [Ondrej Certik] <ondrej-AT-certik.cz>: set up the IPython docs to use the new
204 * Ondrej Certik <ondrej-AT-certik.cz> Set up the IPython docs to use the new
205 Sphinx system used by Python, Matplotlib and many more projects.
205 Sphinx system used by Python, Matplotlib and many more projects.
206
206
207 * [Stefan van der Walt] <stefan-AT-sun.ac.za>: support for the new config system.
207 * Stefan van der Walt <stefan-AT-sun.ac.za> Design and prototype of the
208 Traits based config system.
208
209
@@ -7,21 +7,22 b' History'
7 Origins
7 Origins
8 =======
8 =======
9
9
10 IPython was starting in 2001 by Fernando Perez. IPython as we know it
10 IPython was starting in 2001 by Fernando Perez while he was a graduate student
11 today grew out of the following three projects:
11 at the University of Colorado, Boulder. IPython as we know it today grew out
12
12 of the following three projects:
13 * ipython by Fernando Pérez. I was working on adding
13
14 Mathematica-type prompts and a flexible configuration system
14 * ipython by Fernando Pérez. Fernando began using Python and ipython began as
15 (something better than $PYTHONSTARTUP) to the standard Python
15 an outgrowth of his desire for things like Mathematica-style prompts, access
16 interactive interpreter.
16 to previous output (again like Mathematica's % syntax) and a flexible
17 configuration system (something better than :envvar:`PYTHONSTARTUP`).
17 * IPP by Janko Hauser. Very well organized, great usability. Had
18 * IPP by Janko Hauser. Very well organized, great usability. Had
18 an old help system. IPP was used as the 'container' code into
19 an old help system. IPP was used as the "container" code into
19 which I added the functionality from ipython and LazyPython.
20 which Fernando added the functionality from ipython and LazyPython.
20 * LazyPython by Nathan Gray. Simple but very powerful. The quick
21 * LazyPython by Nathan Gray. Simple but very powerful. The quick
21 syntax (auto parens, auto quotes) and verbose/colored tracebacks
22 syntax (auto parens, auto quotes) and verbose/colored tracebacks
22 were all taken from here.
23 were all taken from here.
23
24
24 Here is how Fernando describes it:
25 Here is how Fernando describes the early history of IPython:
25
26
26 When I found out about IPP and LazyPython I tried to join all three
27 When I found out about IPP and LazyPython I tried to join all three
27 into a unified system. I thought this could provide a very nice
28 into a unified system. I thought this could provide a very nice
@@ -31,8 +32,3 b' Here is how Fernando describes it:'
31 think it worked reasonably well, though it was a lot more work than I
32 think it worked reasonably well, though it was a lot more work than I
32 had initially planned.
33 had initially planned.
33
34
34 Today and how we got here
35 =========================
36
37 This needs to be filled in.
38
@@ -7,7 +7,8 b' License and Copyright'
7 License
7 License
8 =======
8 =======
9
9
10 IPython is licensed under the terms of the new or revised BSD license, as follows::
10 IPython is licensed under the terms of the new or revised BSD license, as
11 follows::
11
12
12 Copyright (c) 2008, IPython Development Team
13 Copyright (c) 2008, IPython Development Team
13
14
@@ -44,25 +45,24 b' About the IPython Development Team'
44 ==================================
45 ==================================
45
46
46 Fernando Perez began IPython in 2001 based on code from Janko Hauser
47 Fernando Perez began IPython in 2001 based on code from Janko Hauser
47 <jhauser@zscout.de> and Nathaniel Gray <n8gray@caltech.edu>. Fernando is still
48 <jhauser-AT-zscout.de> and Nathaniel Gray <n8gray-AT-caltech.edu>. Fernando is still
48 the project lead.
49 the project lead.
49
50
50 The IPython Development Team is the set of all contributors to the IPython
51 The IPython Development Team is the set of all contributors to the IPython
51 project. This includes all of the IPython subprojects. Here is a list of the
52 project. This includes all of the IPython subprojects. Here is a list of the
52 currently active contributors:
53 currently active contributors:
53
54
54 * Matthieu Brucher
55 * Matthieu Brucher
55 * Ondrej Certik
56 * Ondrej Certik
56 * Laurent Dufrechou
57 * Laurent Dufrechou
57 * Robert Kern
58 * Robert Kern
58 * Brian E. Granger
59 * Brian E. Granger
59 * Fernando Perez (project leader)
60 * Fernando Perez (project leader)
60 * Benjamin Ragan-Kelley
61 * Benjamin Ragan-Kelley
61 * Ville M. Vainio
62 * Ville M. Vainio
62 * Gael Varoququx
63 * Gael Varoququx
63 * Stefan van der Walt
64 * Stefan van der Walt
64 * Tech-X Corporation
65 * Barry Wark
65 * Barry Wark
66
66
67 If your name is missing, please add it.
67 If your name is missing, please add it.
68
68
@@ -71,13 +71,16 b' Our Copyright Policy'
71
71
72 IPython uses a shared copyright model. Each contributor maintains copyright
72 IPython uses a shared copyright model. Each contributor maintains copyright
73 over their contributions to IPython. But, it is important to note that these
73 over their contributions to IPython. But, it is important to note that these
74 contributions are typically only changes to the repositories. Thus, the
74 contributions are typically only changes (diffs/commits) to the repositories.
75 IPython source code, in its entirety is not the copyright of any single person
75 Thus, the IPython source code, in its entirety is not the copyright of any
76 or institution. Instead, it is the collective copyright of the entire IPython
76 single person or institution. Instead, it is the collective copyright of the
77 Development Team. If individual contributors want to maintain a record of what
77 entire IPython Development Team. If individual contributors want to maintain a
78 changes/contributions they have specific copyright on, they should indicate
78 record of what changes/contributions they have specific copyright on, they
79 their copyright in the commit message of the change, when they commit the
79 should indicate their copyright in the commit message of the change, when they
80 change to one of the IPython repositories.
80 commit the change to one of the IPython repositories.
81
82 Any new code contributed to IPython must be licensed under the BSD license or
83 a similar (MIT) open source license.
81
84
82 Miscellaneous
85 Miscellaneous
83 =============
86 =============
@@ -79,64 +79,78 b' the code, but in general we should remove as many unnecessary ``IP``/``ip``'
79 prefixes as possible. However, if a prefix seems absolutely necessary the more
79 prefixes as possible. However, if a prefix seems absolutely necessary the more
80 specific ``IPY`` or ``ipy`` are preferred.
80 specific ``IPY`` or ``ipy`` are preferred.
81
81
82 Older material
83 ==============
82
84
83 .. _devel-testing:
85 General
86 -------
84
87
85 Testing system
88 In general, we'll try to follow the standard Python style conventions as
86 ==============
89 described here:
90
91 * `Style Guide for Python Code <http://www.python.org/peps/pep-0008.html>`_
92
93
94 Other comments:
95
96 * In a large file, top level classes and functions should be
97 separated by 2-3 lines to make it easier to separate them visually.
98 * Use 4 spaces for indentation.
99 * Keep the ordering of methods the same in classes that have the same
100 methods. This is particularly true for classes that implement an interface.
101
102 Naming conventions
103 ------------------
104
105 In terms of naming conventions, we'll follow the guidelines from the `Style
106 Guide for Python Code`_.
107
108 For all new IPython code (and much existing code is being refactored), we'll
109 use:
110
111 * All ``lowercase`` module names.
112
113 * ``CamelCase`` for class names.
114
115 * ``lowercase_with_underscores`` for methods, functions, variables and
116 attributes.
117
118 There are, however, some important exceptions to these rules. In some cases,
119 IPython code will interface with packages (Twisted, Wx, Qt) that use other
120 conventions. At some level this makes it impossible to adhere to our own
121 standards at all times. In particular, when subclassing classes that use other
122 naming conventions, you must follow their naming conventions. To deal with
123 cases like this, we propose the following policy:
124
125 * If you are subclassing a class that uses different conventions, use its
126 naming conventions throughout your subclass. Thus, if you are creating a
127 Twisted Protocol class, used Twisted's
128 ``namingSchemeForMethodsAndAttributes.``
129
130 * All IPython's official interfaces should use our conventions. In some cases
131 this will mean that you need to provide shadow names (first implement
132 ``fooBar`` and then ``foo_bar = fooBar``). We want to avoid this at all
133 costs, but it will probably be necessary at times. But, please use this
134 sparingly!
135
136 Implementation-specific *private* methods will use
137 ``_single_underscore_prefix``. Names with a leading double underscore will
138 *only* be used in special cases, as they makes subclassing difficult (such
139 names are not easily seen by child classes).
140
141 Occasionally some run-in lowercase names are used, but mostly for very short
142 names or where we are implementing methods very similar to existing ones in a
143 base class (like ``runlines()`` where ``runsource()`` and ``runcode()`` had
144 established precedent).
145
146 The old IPython codebase has a big mix of classes and modules prefixed with an
147 explicit ``IP``. In Python this is mostly unnecessary, redundant and frowned
148 upon, as namespaces offer cleaner prefixing. The only case where this approach
149 is justified is for classes which are expected to be imported into external
150 namespaces and a very generic name (like Shell) is too likely to clash with
151 something else. We'll need to revisit this issue as we clean up and refactor
152 the code, but in general we should remove as many unnecessary ``IP``/``ip``
153 prefixes as possible. However, if a prefix seems absolutely necessary the more
154 specific ``IPY`` or ``ipy`` are preferred.
87
155
88 It is extremely important that all code contributed to IPython has tests. Tests
89 should be written as unittests, doctests or as entities that the `Nose`_
90 testing package will find. Regardless of how the tests are written, we will use
91 `Nose`_ for discovering and running the tests. `Nose`_ will be required to run
92 the IPython test suite, but will not be required to simply use IPython.
93
94 .. _Nose: http://code.google.com/p/python-nose/
95
96 Tests of `Twisted`__ using code should be written by subclassing the
97 ``TestCase`` class that comes with ``twisted.trial.unittest``. When this is
98 done, `Nose`_ will be able to run the tests and the twisted reactor will be
99 handled correctly.
100
101 .. __: http://www.twistedmatrix.com
102
103 Each subpackage in IPython should have its own ``tests`` directory that
104 contains all of the tests for that subpackage. This allows each subpackage to
105 be self-contained. If a subpackage has any dependencies beyond the Python
106 standard library, the tests for that subpackage should be skipped if the
107 dependencies are not found. This is very important so users don't get tests
108 failing simply because they don't have dependencies.
109
110 We also need to look into use Noses ability to tag tests to allow a more
111 modular approach of running tests.
112
113 .. _devel-config:
114
115 Configuration system
116 ====================
117
118 IPython uses `.ini`_ files for configuration purposes. This represents a huge
119 improvement over the configuration system used in IPython. IPython works with
120 these files using the `ConfigObj`_ package, which IPython includes as
121 ``ipython1/external/configobj.py``.
122
123 Currently, we are using raw `ConfigObj`_ objects themselves. Each subpackage of
124 IPython should contain a ``config`` subdirectory that contains all of the
125 configuration information for the subpackage. To see how configuration
126 information is defined (along with defaults) see at the examples in
127 ``ipython1/kernel/config`` and ``ipython1/core/config``. Likewise, to see how
128 the configuration information is used, see examples in
129 ``ipython1/kernel/scripts/ipengine.py``.
130
131 Eventually, we will add a new layer on top of the raw `ConfigObj`_ objects. We
132 are calling this new layer, ``tconfig``, as it will use a `Traits`_-like
133 validation model. We won't actually use `Traits`_, but will implement
134 something similar in pure Python. But, even in this new system, we will still
135 use `ConfigObj`_ and `.ini`_ files underneath the hood. Talk to Fernando if you
136 are interested in working on this part of IPython. The current prototype of
137 ``tconfig`` is located in the IPython sandbox.
138
139 .. _.ini: http://docs.python.org/lib/module-ConfigParser.html
140 .. _ConfigObj: http://www.voidspace.org.uk/python/configobj.html
141 .. _Traits: http://code.enthought.com/traits/
142
156
@@ -102,3 +102,40 b' machinery to process reStructuredText):'
102 - `Docstring Processing System Framework <http://www.python.org/peps/pep-0256.html>`_
102 - `Docstring Processing System Framework <http://www.python.org/peps/pep-0256.html>`_
103 - `Docutils Design Specification <http://www.python.org/peps/pep-0258.html>`_
103 - `Docutils Design Specification <http://www.python.org/peps/pep-0258.html>`_
104
104
105 Older material
106 ==============
107
108 Documentation
109 =============
110
111 Standalone documentation
112 ------------------------
113
114 All standalone documentation should be written in plain text (``.txt``) files
115 using reStructuredText [reStructuredText]_ for markup and formatting. All such
116 documentation should be placed in directory :file:`docs/source` of the IPython
117 source tree. The documentation in this location will serve as the main source
118 for IPython documentation and all existing documentation should be converted
119 to this format.
120
121 To build the final documentation, we use Sphinx [Sphinx]_. Once you have
122 Sphinx installed, you can build the html docs yourself by doing::
123
124 $ cd ipython-mybranch/docs
125 $ make html
126
127 Docstring format
128 ----------------
129
130 Good docstrings are very important. All new code should have docstrings that
131 are formatted using reStructuredText for markup and formatting, since it is
132 understood by a wide variety of tools. Details about using reStructuredText
133 for docstrings can be found `here
134 <http://epydoc.sourceforge.net/manual-othermarkup.html>`_.
135
136 Additional PEPs of interest regarding documentation of code:
137
138 * `Docstring Conventions <http://www.python.org/peps/pep-0257.html>`_
139 * `Docstring Processing System Framework <http://www.python.org/peps/pep-0256.html>`_
140 * `Docutils Design Specification <http://www.python.org/peps/pep-0258.html>`_
141
@@ -1,16 +1,25 b''
1 ===========================
1 .. _developer_guide:
2 IPython Developer's Guide
2
3 ===========================
3 =========================
4 IPython developer's guide
5 =========================
4
6
5 .. toctree::
7 .. toctree::
6 :maxdepth: 2
8 :maxdepth: 2
7
9
8 overview.txt
10 contributing.txt
9 coding_guide.txt
11 coding_guide.txt
10 doc_guide.txt
12 doc_guide.txt
13 testing.txt
14 release.txt
11 roadmap.txt
15 roadmap.txt
12
16
13 notification_blueprint.txt
17 notification_blueprint.txt
14 config_blueprint.txt
15 reorg.txt
18 reorg.txt
16
19
20
21 .. [Bazaar] Bazaar. http://bazaar-vcs.org/
22 .. [Launchpad] Launchpad. http://www.launchpad.net/ipython
23 .. [reStructuredText] reStructuredText. http://docutils.sourceforge.net/rst.html
24 .. [Sphinx] Sphinx. http://sphinx.pocoo.org/
25 .. [Nose] Nose: a discovery based unittest extension. http://code.google.com/p/python-nose/ No newline at end of file
@@ -39,29 +39,38 b' The notification center must:'
39 What's not included
39 What's not included
40 ===================
40 ===================
41
41
42 As written, the :mod:`IPython.kernel.core.notificaiton` module does not:
42 As written, the :mod:`IPython.kernel.core.notification` module does not:
43
43
44 * Provide out-of-process or network notifications (these should be handled by
44 * Provide out-of-process or network notifications (these should be handled by
45 a separate, Twisted aware module in :mod:`IPython.kernel`).
45 a separate, Twisted aware module in :mod:`IPython.kernel`).
46
46
47 * Provide zope.interface-style interfaces for the notification system (these
47 * Provide zope.interface style interfaces for the notification system (these
48 should also be provided by the :mod:`IPython.kernel` module).
48 should also be provided by the :mod:`IPython.kernel` module).
49
49
50 Use Cases
50 Use Cases
51 =========
51 =========
52
52
53 The following use cases describe the main intended uses of the notificaiton module and illustrate the main success scenario for each use case:
53 The following use cases describe the main intended uses of the notification
54 module and illustrate the main success scenario for each use case:
54
55
55 1. Dwight Schroot is writing a frontend for the IPython project. His frontend is stuck in the stone age and must communicate synchronously with an IPython.kernel.core.Interpreter instance. Because code is executed in blocks by the Interpreter, Dwight's UI freezes every time he executes a long block of code. To keep track of the progress of his long running block, Dwight adds the following code to his frontend's set-up code::
56 Scenario 1
57 ----------
56
58
57 from IPython.kernel.core.notification import NotificationCenter
59 Dwight Schroot is writing a frontend for the IPython project. His frontend is
58 center = NotificationCenter.sharedNotificationCenter
60 stuck in the stone age and must communicate synchronously with an
59 center.registerObserver(self, type=IPython.kernel.core.Interpreter.STDOUT_NOTIFICATION_TYPE, notifying_object=self.interpreter, callback=self.stdout_notification)
61 :mod:`IPython.kernel.core.Interpreter` instance. Because code is executed in blocks
60
62 by the Interpreter, Dwight's UI freezes every time he executes a long block of
61 and elsewhere in his front end::
63 code. To keep track of the progress of his long running block, Dwight adds the
64 following code to his frontend's set-up code::
65
66 from IPython.kernel.core.notification import NotificationCenter
67 center = NotificationCenter.sharedNotificationCenter
68 center.registerObserver(self, type=IPython.kernel.core.Interpreter.STDOUT_NOTIFICATION_TYPE, notifying_object=self.interpreter, callback=self.stdout_notification)
62
69
63 def stdout_notification(self, type, notifying_object, out_string=None):
70 and elsewhere in his front end::
64 self.writeStdOut(out_string)
71
72 def stdout_notification(self, type, notifying_object, out_string=None):
73 self.writeStdOut(out_string)
65
74
66 If everything works, the Interpreter will (according to its published API)
75 If everything works, the Interpreter will (according to its published API)
67 fire a notification via the
76 fire a notification via the
@@ -78,7 +87,10 b" Like magic, Dwight's frontend is able to provide output, even during"
78 long-running calculations. Now if Jim could just convince Dwight to use
87 long-running calculations. Now if Jim could just convince Dwight to use
79 Twisted...
88 Twisted...
80
89
81 2. Boss Hog is writing a frontend for the IPython project. Because Boss Hog is
90 Scenario 2
91 ----------
92
93 Boss Hog is writing a frontend for the IPython project. Because Boss Hog is
82 stuck in the stone age, his frontend will be written in a new Fortran-like
94 stuck in the stone age, his frontend will be written in a new Fortran-like
83 dialect of python and will run only from the command line. Because he doesn't
95 dialect of python and will run only from the command line. Because he doesn't
84 need any fancy notification system and is used to worrying about every cycle
96 need any fancy notification system and is used to worrying about every cycle
@@ -92,17 +104,20 b' Interpreter (or any other object) fires an event for which there are no'
92 registered observers. Of course, the same notificaiton-enabled Interpreter can
104 registered observers. Of course, the same notificaiton-enabled Interpreter can
93 then be used in frontends that require notifications, thus saving the IPython
105 then be used in frontends that require notifications, thus saving the IPython
94 project from a nasty civil war.
106 project from a nasty civil war.
95
107
96 3. Barry is wrting a frontend for the IPython project. Because Barry's front
108 Scenario 3
97 end is the *new hotness*, it uses an asynchronous event model to communicate
109 ----------
98 with a Twisted :mod:`~IPython.kernel.engineservice` that communicates with the
110
99 IPython :class:`~IPython.kernel.core.interpreter.Interpreter`. Using the
111 Barry is wrting a frontend for the IPython project. Because Barry's front end
112 is the *new hotness*, it uses an asynchronous event model to communicate with
113 a Twisted :mod:`IPython.kernel.engineservice` that communicates with the
114 IPython :class:`IPython.kernel.core.interpreter.Interpreter`. Using the
100 :mod:`IPython.kernel.notification` module, an asynchronous wrapper on the
115 :mod:`IPython.kernel.notification` module, an asynchronous wrapper on the
101 :mod:`IPython.kernel.core.notification` module, Barry's frontend can register
116 :mod:`IPython.kernel.core.notification` module, Barry's frontend can register
102 for notifications from the interpreter that are delivered asynchronously. Even
117 for notifications from the interpreter that are delivered asynchronously. Even
103 if Barry's frontend is running on a separate process or even host from the
118 if Barry's frontend is running on a separate process or even host from the
104 Interpreter, the notifications are delivered, as if by dark and twisted magic.
119 Interpreter, the notifications are delivered, as if by dark and twisted magic.
105 Just like Dwight's frontend, Barry's frontend can now recieve notifications of
120 Just like Dwight's frontend, Barry's frontend can now receive notifications of
106 e.g. writing to stdout/stderr, opening/closing an external file, an exception
121 e.g. writing to stdout/stderr, opening/closing an external file, an exception
107 in the executing code, etc.
122 in the executing code, etc.
108
123
This diff has been collapsed as it changes many lines, (510 lines changed) Show them Hide them
@@ -1,518 +1,8 b''
1 .. _development:
2
1
3 ==============================
4 IPython development guidelines
5 ==============================
6
2
7
3
8 Overview
9 ========
10
4
11 This document describes IPython from the perspective of developers. Most
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!
14
5
15 How to contribute to IPython
16 ============================
17
6
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.
20 There are several ways in which you can join in.
21
7
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
24 differences::
25
26 $ cd /path/to/your/copy/of/ipython
27 $ bzr diff > my_fixes.diff
28
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
31 <https://bugs.launchpad.net/ipython>`_, indicating what it does.
32
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,
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
37 services makes for a much better experience.
38
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
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.
43
44 Install Bazaar and create a Launchpad account
45 ---------------------------------------------
46
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
49 you, try the following::
50
51 $ bzr whoami
52 Joe Coder <jcoder@gmail.com>
53
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
56 ssh keys. For more information of setting up your ssh keys, see `this link
57 <https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair>`_.
58
59 Get the main IPython branch from Launchpad
60 ------------------------------------------
61
62 Now, you can get a copy of the main IPython development branch (we call this
63 the "trunk")::
64
65 $ bzr branch lp:ipython
66
67 Create a working branch
68 -----------------------
69
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
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::
74
75 $ bzr branch ipython ipython-mybranch
76
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
79 "install-docs-update".
80
81 Make edits in your working branch
82 ---------------------------------
83
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
86 test your changes as you work. This is easiest if you have setuptools
87 installed. Then, just do::
88
89 $ cd ipython-mybranch
90 $ python setupegg.py develop
91
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
94 an opportunity to keep a nice record of what you have done. This looks like
95 this::
96
97 $ ...do work in ipython-mybranch...
98 $ bzr commit -m "the commit message goes here"
99
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
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
104 *blank*)::
105
106 Single line summary of changes being committed.
107
108 * more details when warranted ...
109 * including crediting outside contributors if they sent the
110 code/bug/idea!
111
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
114 the :file:`lp:ipython` branch. This can be done with the following sequence of
115 commands::
116
117 $ ls
118 ipython
119 ipython-mybranch
120
121 $ cd ipython
122 $ bzr pull
123 $ cd ../ipython-mybranch
124 $ bzr merge ../ipython
125 $ bzr commit -m "Merging changes from trunk"
126
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
129 :command:`nosetests`)::
130
131 $ cd
132 $ iptest
133
134 The :command:`iptest` command will also pick up and run any tests you have
135 written. See :ref:`testing documentation <devel_testing>` for further details
136 on the testing system.
137
138
139 Post your branch and request a code review
140 ------------------------------------------
141
142 Once you are done with your edits, you should post your branch on Launchpad so
143 that other IPython developers can review the changes and help you merge your
144 changes into the main development branch. To post your branch on Launchpad,
145 do::
146
147 $ cd ipython-mybranch
148 $ bzr push lp:~yourusername/ipython/ipython-mybranch
149
150 Then, go to the `IPython Launchpad site <www.launchpad.net/ipython>`_, and you
151 should see your branch under the "Code" tab. If you click on your branch, you
152 can provide a short description of the branch as well as mark its status. Most
153 importantly, you should click the link that reads "Propose for merging into
154 another branch". What does this do?
155
156 This let's the other IPython developers know that your branch is ready to be
157 reviewed and merged into the main development branch. During this review
158 process, other developers will give you feedback and help you get your code
159 ready to be merged. What types of things will we be looking for:
160
161 * All code is documented.
162 * All code has tests.
163 * The entire IPython test suite passes.
164
165 Once your changes have been reviewed and approved, someone will merge them
166 into the main development branch.
167
168
169 Some notes for core developers when merging third-party contributions
170 =====================================================================
171
172 Core developers, who ultimately merge any approved branch (from themselves,
173 another developer, or any third-party contribution) will typically use
174 :command:`bzr merge` to merge the branch into the trunk and push it to the
175 main Launcphad site. This is a short list of things to keep in mind when doing
176 this process, so that the project history is easy to understand in the long
177 run, and that generating release notes is as painless and accurate as
178 possible.
179
180 - When you merge any non-trivial functionality (from one small bug fix to a
181 big feature branch), please remember to always edit the :file:`changes.txt`
182 file accordingly. This file has one main section for each release, and if
183 you edit it as you go, noting what new features, bug fixes or API changes
184 you have made, the release notes will be almost finished when they are
185 needed later. This is much easier if done when you merge the work, rather
186 than weeks or months later by re-reading a massive Bazaar log.
187
188 - When big merges are done, the practice of putting a summary commit message
189 in the merge is *extremely* useful. It makes this kind of job much nicer,
190 because that summary log message can be almost copy/pasted without changes,
191 if it was well written, rather than dissecting the next-level messages from
192 the individual commits.
193
194 - It's important that we remember to always credit who gave us something if
195 it's not the committer. In general, we have been fairly good on this front,
196 this is just a reminder to keep things up. As a note, if you are ever
197 committing something that is completely (or almost so) a third-party
198 contribution, do the commit as::
199
200 $ bzr commit --author="Someone Else"
201
202 This way it will show that name separately in the log, which makes it even
203 easier to spot. Obviously we often rework third party contributions
204 extensively, but this is still good to keep in mind for cases when we don't
205 touch the code too much.
206
207
208 Documentation
209 =============
210
211 Standalone documentation
212 ------------------------
213
214 All standalone documentation should be written in plain text (``.txt``) files
215 using reStructuredText [reStructuredText]_ for markup and formatting. All such
216 documentation should be placed in directory :file:`docs/source` of the IPython
217 source tree. The documentation in this location will serve as the main source
218 for IPython documentation and all existing documentation should be converted
219 to this format.
220
221 To build the final documentation, we use Sphinx [Sphinx]_. Once you have
222 Sphinx installed, you can build the html docs yourself by doing::
223
224 $ cd ipython-mybranch/docs
225 $ make html
226
227 Docstring format
228 ----------------
229
230 Good docstrings are very important. All new code should have docstrings that
231 are formatted using reStructuredText for markup and formatting, since it is
232 understood by a wide variety of tools. Details about using reStructuredText
233 for docstrings can be found `here
234 <http://epydoc.sourceforge.net/manual-othermarkup.html>`_.
235
236 Additional PEPs of interest regarding documentation of code:
237
238 * `Docstring Conventions <http://www.python.org/peps/pep-0257.html>`_
239 * `Docstring Processing System Framework <http://www.python.org/peps/pep-0256.html>`_
240 * `Docutils Design Specification <http://www.python.org/peps/pep-0258.html>`_
241
242
243 Coding conventions
244 ==================
245
246 General
247 -------
248
249 In general, we'll try to follow the standard Python style conventions as
250 described here:
251
252 * `Style Guide for Python Code <http://www.python.org/peps/pep-0008.html>`_
253
254
255 Other comments:
256
257 * In a large file, top level classes and functions should be
258 separated by 2-3 lines to make it easier to separate them visually.
259 * Use 4 spaces for indentation.
260 * Keep the ordering of methods the same in classes that have the same
261 methods. This is particularly true for classes that implement an interface.
262
263 Naming conventions
264 ------------------
265
266 In terms of naming conventions, we'll follow the guidelines from the `Style
267 Guide for Python Code`_.
268
269 For all new IPython code (and much existing code is being refactored), we'll
270 use:
271
272 * All ``lowercase`` module names.
273
274 * ``CamelCase`` for class names.
275
276 * ``lowercase_with_underscores`` for methods, functions, variables and
277 attributes.
278
279 There are, however, some important exceptions to these rules. In some cases,
280 IPython code will interface with packages (Twisted, Wx, Qt) that use other
281 conventions. At some level this makes it impossible to adhere to our own
282 standards at all times. In particular, when subclassing classes that use other
283 naming conventions, you must follow their naming conventions. To deal with
284 cases like this, we propose the following policy:
285
286 * If you are subclassing a class that uses different conventions, use its
287 naming conventions throughout your subclass. Thus, if you are creating a
288 Twisted Protocol class, used Twisted's
289 ``namingSchemeForMethodsAndAttributes.``
290
291 * All IPython's official interfaces should use our conventions. In some cases
292 this will mean that you need to provide shadow names (first implement
293 ``fooBar`` and then ``foo_bar = fooBar``). We want to avoid this at all
294 costs, but it will probably be necessary at times. But, please use this
295 sparingly!
296
297 Implementation-specific *private* methods will use
298 ``_single_underscore_prefix``. Names with a leading double underscore will
299 *only* be used in special cases, as they makes subclassing difficult (such
300 names are not easily seen by child classes).
301
302 Occasionally some run-in lowercase names are used, but mostly for very short
303 names or where we are implementing methods very similar to existing ones in a
304 base class (like ``runlines()`` where ``runsource()`` and ``runcode()`` had
305 established precedent).
306
307 The old IPython codebase has a big mix of classes and modules prefixed with an
308 explicit ``IP``. In Python this is mostly unnecessary, redundant and frowned
309 upon, as namespaces offer cleaner prefixing. The only case where this approach
310 is justified is for classes which are expected to be imported into external
311 namespaces and a very generic name (like Shell) is too likely to clash with
312 something else. We'll need to revisit this issue as we clean up and refactor
313 the code, but in general we should remove as many unnecessary ``IP``/``ip``
314 prefixes as possible. However, if a prefix seems absolutely necessary the more
315 specific ``IPY`` or ``ipy`` are preferred.
316
317 .. _devel_testing:
318
319 Testing system
320 ==============
321
322 It is extremely important that all code contributed to IPython has tests.
323 Tests should be written as unittests, doctests or as entities that the Nose
324 [Nose]_ testing package will find. Regardless of how the tests are written, we
325 will use Nose for discovering and running the tests. Nose will be required to
326 run the IPython test suite, but will not be required to simply use IPython.
327
328 Tests of Twisted using code need to follow two additional guidelines:
329
330 1. Twisted using tests should be written by subclassing the :class:`TestCase`
331 class that comes with :mod:`twisted.trial.unittest`.
332
333 2. All :class:`Deferred` instances that are created in the test must be
334 properly chained and the final one *must* be the return value of the test
335 method.
336
337 When these two things are done, Nose will be able to run the tests and the
338 twisted reactor will be handled correctly.
339
340 Each subpackage in IPython should have its own :file:`tests` directory that
341 contains all of the tests for that subpackage. This allows each subpackage to
342 be self-contained. A good convention to follow is to have a file named
343 :file:`test_foo.py` for each module :file:`foo.py` in the package. This makes
344 it easy to organize the tests, though like most conventions, it's OK to break
345 it if logic and common sense dictate otherwise.
346
347 If a subpackage has any dependencies beyond the Python standard library, the
348 tests for that subpackage should be skipped if the dependencies are not
349 found. This is very important so users don't get tests failing simply because
350 they don't have dependencies. We ship a set of decorators in the
351 :mod:`IPython.testing` package to tag tests that may be platform-specific or
352 otherwise may have restrictions; if the existing ones don't fit your needs, add
353 a new decorator in that location so other tests can reuse it.
354
355 To run the IPython test suite, use the :command:`iptest` command that is
356 installed with IPython (if you are using IPython in-place, without installing
357 it, you can find this script in the :file:`scripts` directory)::
358
359 $ iptest
360
361 This command colects all IPython tests into separate groups, and then calls
362 either Nose with the proper options and extensions, or Twisted's
363 :command:`trial`. This ensures that tests that need the Twisted reactor
364 management facilities execute separate of Nose. If any individual test group
365 fails, :command:`iptest` will print what you need to type so you can rerun that
366 particular test group alone for debugging.
367
368 By default, :command:`iptest` runs the entire IPython test
369 suite (skipping tests that may be platform-specific or which depend on tools
370 you may not have). But you can also use it to run only one specific test file,
371 or a specific test function. For example, this will run only the
372 :file:`test_magic` file from the test suite::
373
374 $ iptest IPython.tests.test_magic
375 ----------------------------------------------------------------------
376 Ran 10 tests in 0.348s
377
378 OK (SKIP=3)
379 Deleting object: second_pass
380
381 while the ``path:function`` syntax allows you to select a specific function in
382 that file to run::
383
384 $ iptest IPython.tests.test_magic:test_obj_del
385 ----------------------------------------------------------------------
386 Ran 1 test in 0.204s
387
388 OK
389
390 Since :command:`iptest` is based on nosetests, you can pass it any regular
391 nosetests option. For example, you can use ``--pdb`` or ``--pdb-failures`` to
392 automatically activate the interactive Pdb debugger on errors or failures. See
393 the nosetests documentation for further details.
394
395
396 A few tips for writing tests
397 ----------------------------
398
399 You can write tests either as normal test files, using all the conventions that
400 Nose recognizes, or as doctests. Note that *all* IPython functions should have
401 at least one example that serves as a doctest, whenever technically feasible.
402 However, example doctests should only be in the main docstring if they are *a
403 good example*, i.e. if they convey useful information about the function. If
404 you simply would like to write a test as a doctest, put it in a separate test
405 file and write a no-op function whose only purpose is its docstring.
406
407 Note, however, that in a file named :file:`test_X`, functions whose only test
408 is their docstring (as a doctest) and which have no test functionality of their
409 own, should be called *doctest_foo* instead of *test_foo*, otherwise they get
410 double-counted (the empty function call is counted as a test, which just
411 inflates tests numbers artificially). This restriction does not apply to
412 functions in files with other names, due to how Nose discovers tests.
413
414 You can use IPython examples in your docstrings. Those can make full use of
415 IPython functionality (magics, variable substitution, etc), but be careful to
416 keep them generic enough that they run identically on all Operating Systems.
417
418 The prompts in your doctests can be either of the plain Python ``>>>`` variety
419 or ``In [1]:`` IPython style. Since this is the IPython system, after all, we
420 encourage you to use IPython prompts throughout, unless you are illustrating a
421 specific aspect of the normal prompts (such as the ``%doctest_mode`` magic).
422
423 If a test isn't safe to run inside the main nose process (e.g. because it loads
424 a GUI toolkit), consider running it in a subprocess and capturing its output
425 for evaluation and test decision later. Here is an example of how to do it, by
426 relying on the builtin ``_ip`` object that contains the public IPython api as
427 defined in :mod:`IPython.ipapi`::
428
429 def test_obj_del():
430 """Test that object's __del__ methods are called on exit."""
431 test_dir = os.path.dirname(__file__)
432 del_file = os.path.join(test_dir,'obj_del.py')
433 out = _ip.IP.getoutput('ipython %s' % del_file)
434 nt.assert_equals(out,'object A deleted')
435
436
437
438 If a doctest contains input whose output you don't want to verify identically
439 via doctest (random output, an object id, etc), you can mark a docstring with
440 ``#random``. All of these test will have their code executed but no output
441 checking will be done::
442
443 >>> 1+3
444 junk goes here... # random
445
446 >>> 1+2
447 again, anything goes #random
448 if multiline, the random mark is only needed once.
449
450 >>> 1+2
451 You can also put the random marker at the end:
452 # random
453
454 >>> 1+2
455 # random
456 .. or at the beginning.
457
458 In a case where you want an *entire* docstring to be executed but not verified
459 (this only serves to check that the code runs without crashing, so it should be
460 used very sparingly), you can put ``# all-random`` in the docstring.
461
462 .. _devel_config:
463
464 Release checklist
465 =================
466
467 Most of the release process is automated by the :file:`release` script in the
468 :file:`tools` directory. This is just a handy reminder for the release manager.
469
470 #. First, run :file:`build_release`, which does all the file checking and
471 building that the real release script will do. This will let you do test
472 installations, check that the build procedure runs OK, etc. You may want to
473 disable a few things like multi-version RPM building while testing, because
474 otherwise the build takes really long.
475
476 #. Run the release script, which makes the tar.gz, eggs and Win32 .exe
477 installer. It posts them to the site and registers the release with PyPI.
478
479 #. Updating the website with announcements and links to the updated
480 changes.txt in html form. Remember to put a short note both on the news
481 page of the site and on Launcphad.
482
483 #. Drafting a short release announcement with i) highlights and ii) a link to
484 the html changes.txt.
485
486 #. Make sure that the released version of the docs is live on the site.
487
488 #. Celebrate!
489
490 Porting to 3.0
491 ==============
492
493 There are no definite plans for porting of IPython to python 3. The major
494 issue is the dependency on twisted framework for the networking/threading
495 stuff. It is possible that it the traditional IPython interactive console
496 could be ported more easily since it has no such dependency. Here are a few
497 things that will need to be considered when doing such a port especially
498 if we want to have a codebase that works directly on both 2.x and 3.x.
499
500 1. The syntax for exceptions changed (PEP 3110). The old
501 `except exc, var` changed to `except exc as var`. At last
502 count there was 78 occurences of this usage in the codebase. This
503 is a particularly problematic issue, because it's not easy to
504 implement it in a 2.5-compatible way.
505
506 Because it is quite difficult to support simultaneously Python 2.5 and 3.x, we
507 will likely at some point put out a release that requires strictly 2.6 and
508 abandons 2.5 compatibility. This will then allow us to port the code to using
509 :func:`print` as a function, `except exc as var` syntax, etc. But as of
510 version 0.11 at least, we will retain Python 2.5 compatibility.
511
512
513 .. [Bazaar] Bazaar. http://bazaar-vcs.org/
514 .. [Launchpad] Launchpad. http://www.launchpad.net/ipython
515 .. [reStructuredText] reStructuredText. http://docutils.sourceforge.net/rst.html
516 .. [Sphinx] Sphinx. http://sphinx.pocoo.org/
517 .. [Nose] Nose: a discovery based unittest extension. http://code.google.com/p/python-nose/
518
8
@@ -92,3 +92,23 b' Currently, we have a number of performance issues in :mod:`IPython.kernel`:'
92 separate the controller itself into multiple processes, one for the core
92 separate the controller itself into multiple processes, one for the core
93 controller and one each for the controller interfaces.
93 controller and one each for the controller interfaces.
94
94
95 Porting to 3.0
96 ==============
97
98 There are no definite plans for porting of IPython to Python 3. The major
99 issue is the dependency on Twisted framework for the networking/threading
100 stuff. It is possible that it the traditional IPython interactive console
101 could be ported more easily since it has no such dependency. Here are a few
102 things that will need to be considered when doing such a port especially
103 if we want to have a codebase that works directly on both 2.x and 3.x.
104
105 1. The syntax for exceptions changed (PEP 3110). The old `except exc, var`
106 changed to `except exc as var`. At last count there was 78 occurrences of this
107 usage in the code base. This is a particularly problematic issue, because it's
108 not easy to implement it in a 2.5-compatible way.
109
110 Because it is quite difficult to support simultaneously Python 2.5 and 3.x, we
111 will likely at some point put out a release that requires strictly 2.6 and
112 abandons 2.5 compatibility. This will then allow us to port the code to using
113 :func:`print` as a function, `except exc as var` syntax, etc. But as of
114 version 0.11 at least, we will retain Python 2.5 compatibility.
@@ -91,6 +91,3 b' handling the data movement. Here are some ideas:'
91
91
92 5. See if you can pass data directly between engines using MPI.
92 5. See if you can pass data directly between engines using MPI.
93
93
94 Isn't Python slow to be used for high-performance parallel computing?
95 ---------------------------------------------------------------------
96
@@ -7,8 +7,7 b' IPython Documentation'
7 :Release: |release|
7 :Release: |release|
8 :Date: |today|
8 :Date: |today|
9
9
10 Welcome to the official IPython documentation. This document describes the
10 Welcome to the official IPython documentation.
11 various parts of IPython that are relevant to both users and developers.
12
11
13 Contents
12 Contents
14 ========
13 ========
@@ -34,16 +34,20 b' Quickstart'
34
34
35 If you have :mod:`setuptools` installed and you are on OS X or Linux (not
35 If you have :mod:`setuptools` installed and you are on OS X or Linux (not
36 Windows), the following will download and install IPython *and* the main
36 Windows), the following will download and install IPython *and* the main
37 optional dependencies::
37 optional dependencies:
38
38
39 $ easy_install ipython[kernel,security,test]
39 .. code-block:: bash
40
41 easy_install ipython[kernel,security,test]
40
42
41 This will get Twisted, zope.interface and Foolscap, which are needed for
43 This will get Twisted, zope.interface and Foolscap, which are needed for
42 IPython's parallel computing features as well as the nose package, which will
44 IPython's parallel computing features as well as the nose package, which will
43 enable you to run IPython's test suite. To run IPython's test suite, use the
45 enable you to run IPython's test suite. To run IPython's test suite, use the
44 :command:`iptest` command::
46 :command:`iptest` command:
47
48 .. code-block:: bash
45
49
46 $ iptest
50 iptest
47
51
48 Read on for more specific details and instructions for Windows.
52 Read on for more specific details and instructions for Windows.
49
53
@@ -62,9 +66,11 b' Installation using easy_install'
62 -------------------------------
66 -------------------------------
63
67
64 If you have :mod:`setuptools` installed, the easiest way of getting IPython is
68 If you have :mod:`setuptools` installed, the easiest way of getting IPython is
65 to simple use :command:`easy_install`::
69 to simple use :command:`easy_install`:
66
70
67 $ easy_install ipython
71 .. code-block:: bash
72
73 easy_install ipython
68
74
69 That's it.
75 That's it.
70
76
@@ -73,11 +79,13 b' Installation from source'
73
79
74 If you don't want to use :command:`easy_install`, or don't have it installed,
80 If you don't want to use :command:`easy_install`, or don't have it installed,
75 just grab the latest stable build of IPython from `here
81 just grab the latest stable build of IPython from `here
76 <http://ipython.scipy.org/dist/>`_. Then do the following::
82 <http://ipython.scipy.org/dist/>`_. Then do the following:
83
84 .. code-block:: bash
77
85
78 $ tar -xzf ipython.tar.gz
86 tar -xzf ipython.tar.gz
79 $ cd ipython
87 cd ipython
80 $ python setup.py install
88 python setup.py install
81
89
82 If you are installing to a location (like ``/usr/local``) that requires higher
90 If you are installing to a location (like ``/usr/local``) that requires higher
83 permissions, you may need to run the last command with :command:`sudo`.
91 permissions, you may need to run the last command with :command:`sudo`.
@@ -98,7 +106,7 b' use any of the following alternatives:'
98 3. Install from source, but using :mod:`setuptools` (``python setupegg.py
106 3. Install from source, but using :mod:`setuptools` (``python setupegg.py
99 install``).
107 install``).
100
108
101 IPython by default runs in a termninal window, but the normal terminal
109 IPython by default runs in a terminal window, but the normal terminal
102 application supplied by Microsoft Windows is very primitive. You may want to
110 application supplied by Microsoft Windows is very primitive. You may want to
103 download the excellent and free Console_ application instead, which is a far
111 download the excellent and free Console_ application instead, which is a far
104 superior tool. You can even configure Console to give you by default an
112 superior tool. You can even configure Console to give you by default an
@@ -113,26 +121,32 b' Installing the development version'
113
121
114 It is also possible to install the development version of IPython from our
122 It is also possible to install the development version of IPython from our
115 `Bazaar <http://bazaar-vcs.org/>`_ source code repository. To do this you will
123 `Bazaar <http://bazaar-vcs.org/>`_ source code repository. To do this you will
116 need to have Bazaar installed on your system. Then just do::
124 need to have Bazaar installed on your system. Then just do:
117
125
118 $ bzr branch lp:ipython
126 .. code-block:: bash
119 $ cd ipython
127
120 $ python setup.py install
128 bzr branch lp:ipython
129 cd ipython
130 python setup.py install
121
131
122 Again, this last step on Windows won't create ``.bat`` files or Start Menu
132 Again, this last step on Windows won't create ``.bat`` files or Start Menu
123 shortcuts, so you will have to use one of the other approaches listed above.
133 shortcuts, so you will have to use one of the other approaches listed above.
124
134
125 Some users want to be able to follow the development branch as it changes. If
135 Some users want to be able to follow the development branch as it changes. If
126 you have :mod:`setuptools` installed, this is easy. Simply replace the last
136 you have :mod:`setuptools` installed, this is easy. Simply replace the last
127 step by::
137 step by:
138
139 .. code-block:: bash
128
140
129 $ python setupegg.py develop
141 python setupegg.py develop
130
142
131 This creates links in the right places and installs the command line script to
143 This creates links in the right places and installs the command line script to
132 the appropriate places. Then, if you want to update your IPython at any time,
144 the appropriate places. Then, if you want to update your IPython at any time,
133 just do::
145 just do:
146
147 .. code-block:: bash
134
148
135 $ bzr pull
149 bzr pull
136
150
137 Basic optional dependencies
151 Basic optional dependencies
138 ===========================
152 ===========================
@@ -165,9 +179,11 b' many of the issues related to the differences between readline and libedit have'
165 been resolved. For many users, libedit may be sufficient.
179 been resolved. For many users, libedit may be sufficient.
166
180
167 Most users on OS X will want to get the full :mod:`readline` module. To get a
181 Most users on OS X will want to get the full :mod:`readline` module. To get a
168 working :mod:`readline` module, just do (with :mod:`setuptools` installed)::
182 working :mod:`readline` module, just do (with :mod:`setuptools` installed):
169
183
170 $ easy_install readline
184 .. code-block:: bash
185
186 easy_install readline
171
187
172 .. note:
188 .. note:
173
189
@@ -190,28 +206,35 b' nose'
190
206
191 To run the IPython test suite you will need the :mod:`nose` package. Nose
207 To run the IPython test suite you will need the :mod:`nose` package. Nose
192 provides a great way of sniffing out and running all of the IPython tests. The
208 provides a great way of sniffing out and running all of the IPython tests. The
193 simplest way of getting nose, is to use :command:`easy_install`::
209 simplest way of getting nose, is to use :command:`easy_install`:
210
211 .. code-block:: bash
194
212
195 $ easy_install nose
213 easy_install nose
196
214
197 Another way of getting this is to do::
215 Another way of getting this is to do:
198
216
199 $ easy_install ipython[test]
217 .. code-block:: bash
218
219 easy_install ipython[test]
200
220
201 For more installation options, see the `nose website
221 For more installation options, see the `nose website
202 <http://somethingaboutorange.com/mrl/projects/nose/>`_. Once you have nose
222 <http://somethingaboutorange.com/mrl/projects/nose/>`_. Once you have nose
203 installed, you can run IPython's test suite using the iptest command::
223 installed, you can run IPython's test suite using the iptest command:
204
224
205 $ iptest
225 .. code-block:: bash
206
226
227 iptest
207
228
208 pexpect
229 pexpect
209 -------
230 -------
210
231
211 The `pexpect <http://www.noah.org/wiki/Pexpect>`_ package is used in IPython's
232 The `pexpect <http://www.noah.org/wiki/Pexpect>`_ package is used in IPython's
212 :command:`irunner` script. On Unix platforms (including OS X), just do::
233 :command:`irunner` script. On Unix platforms (including OS X), just do:
234
235 .. code-block:: bash
213
236
214 $ easy_install pexpect
237 easy_install pexpect
215
238
216 Windows users are out of luck as pexpect does not run there.
239 Windows users are out of luck as pexpect does not run there.
217
240
@@ -227,36 +250,45 b' features require a number of additional packages:'
227 * Foolscap (a nice, secure network protocol)
250 * Foolscap (a nice, secure network protocol)
228 * pyOpenSSL (security for network connections)
251 * pyOpenSSL (security for network connections)
229
252
230 On a Unix style platform (including OS X), if you want to use :mod:`setuptools`, you can just do::
253 On a Unix style platform (including OS X), if you want to use
254 :mod:`setuptools`, you can just do:
231
255
232 $ easy_install ipython[kernel] # the first three
256 .. code-block:: bash
233 $ easy_install ipython[security] # pyOpenSSL
257
258 easy_install ipython[kernel] # the first three
259 easy_install ipython[security] # pyOpenSSL
234
260
235 zope.interface and Twisted
261 zope.interface and Twisted
236 --------------------------
262 --------------------------
237
263
238 Twisted [Twisted]_ and zope.interface [ZopeInterface]_ are used for networking
264 Twisted [Twisted]_ and zope.interface [ZopeInterface]_ are used for networking
239 related things. On Unix style platforms (including OS X), the simplest way of
265 related things. On Unix style platforms (including OS X), the simplest way of
240 getting the these is to use :command:`easy_install`::
266 getting the these is to use :command:`easy_install`:
267
268 .. code-block:: bash
241
269
242 $ easy_install zope.interface
270 easy_install zope.interface
243 $ easy_install Twisted
271 easy_install Twisted
244
272
245 Of course, you can also download the source tarballs from the `Twisted website
273 Of course, you can also download the source tarballs from the Twisted website
246 <twistedmatrix.org>`_ and the `zope.interface page at PyPI
274 [Twisted]_ and the `zope.interface page at PyPI
247 <http://pypi.python.org/pypi/zope.interface>`_ and do the usual ``python
275 <http://pypi.python.org/pypi/zope.interface>`_ and do the usual ``python
248 setup.py install`` if you prefer.
276 setup.py install`` if you prefer.
249
277
250 Windows is a bit different. For zope.interface and Twisted, simply get the latest binary ``.exe`` installer from the Twisted website. This installer includes both zope.interface and Twisted and should just work.
278 Windows is a bit different. For zope.interface and Twisted, simply get the
279 latest binary ``.exe`` installer from the Twisted website. This installer
280 includes both zope.interface and Twisted and should just work.
251
281
252 Foolscap
282 Foolscap
253 --------
283 --------
254
284
255 Foolscap [Foolscap]_ uses Twisted to provide a very nice secure RPC protocol that we use to implement our parallel computing features.
285 Foolscap [Foolscap]_ uses Twisted to provide a very nice secure RPC protocol that we use to implement our parallel computing features.
256
286
257 On all platforms a simple::
287 On all platforms a simple:
288
289 .. code-block:: bash
258
290
259 $ easy_install foolscap
291 easy_install foolscap
260
292
261 should work. You can also download the source tarballs from the `Foolscap
293 should work. You can also download the source tarballs from the `Foolscap
262 website <http://foolscap.lothar.com/trac>`_ and do ``python setup.py install``
294 website <http://foolscap.lothar.com/trac>`_ and do ``python setup.py install``
@@ -265,14 +297,16 b' if you prefer.'
265 pyOpenSSL
297 pyOpenSSL
266 ---------
298 ---------
267
299
268 IPython requires an older version of pyOpenSSL [pyOpenSSL]_ (0.6 rather than
300 IPython does not work with version 0.7 of pyOpenSSL [pyOpenSSL]_. It is known
269 the current 0.7). There are a couple of options for getting this:
301 to work with version 0.6 and will likely work with the more recent 0.8 and 0.9
302 versions. There are a couple of options for getting this:
270
303
271 1. Most Linux distributions have packages for pyOpenSSL.
304 1. Most Linux distributions have packages for pyOpenSSL.
272 2. The built-in Python 2.5 on OS X 10.5 already has it installed.
305 2. The built-in Python 2.5 on OS X 10.5 already has it installed.
273 3. There are source tarballs on the pyOpenSSL website. On Unix-like
306 3. There are source tarballs on the pyOpenSSL website. On Unix-like
274 platforms, these can be built using ``python seutp.py install``.
307 platforms, these can be built using ``python seutp.py install``.
275 4. There is also a binary ``.exe`` Windows installer on the `pyOpenSSL website <http://pyopenssl.sourceforge.net/>`_.
308 4. There is also a binary ``.exe`` Windows installer on the
309 `pyOpenSSL website <http://pyopenssl.sourceforge.net/>`_.
276
310
277 Dependencies for IPython.frontend (the IPython GUI)
311 Dependencies for IPython.frontend (the IPython GUI)
278 ===================================================
312 ===================================================
@@ -280,11 +314,11 b' Dependencies for IPython.frontend (the IPython GUI)'
280 wxPython
314 wxPython
281 --------
315 --------
282
316
283 Starting with IPython 0.9, IPython has a new IPython.frontend package that has
317 Starting with IPython 0.9, IPython has a new :mod:`IPython.frontend` package
284 a nice wxPython based IPython GUI. As you would expect, this GUI requires
318 that has a nice wxPython based IPython GUI. As you would expect, this GUI
285 wxPython. Most Linux distributions have wxPython packages available and the
319 requires wxPython. Most Linux distributions have wxPython packages available
286 built-in Python on OS X comes with wxPython preinstalled. For Windows, a
320 and the built-in Python on OS X comes with wxPython preinstalled. For Windows,
287 binary installer is available on the `wxPython website
321 a binary installer is available on the `wxPython website
288 <http://www.wxpython.org/>`_.
322 <http://www.wxpython.org/>`_.
289
323
290 .. [Twisted] Twisted matrix. http://twistedmatrix.org
324 .. [Twisted] Twisted matrix. http://twistedmatrix.org
@@ -8,5 +8,5 b' Using IPython for interactive work'
8 tutorial.txt
8 tutorial.txt
9 reference.txt
9 reference.txt
10 shell.txt
10 shell.txt
11 extension_api.txt
11
12
12
@@ -2,6 +2,14 b''
2 IPython reference
2 IPython reference
3 =================
3 =================
4
4
5 .. warning::
6
7 As of the 0.11 version of IPython, some of the features and APIs
8 described in this section have been deprecated or are broken. Our plan
9 is to continue to support these features, but they need to be updated
10 to take advantage of recent API changes. Furthermore, this section
11 of the documentation need to be updated to reflect all of these changes.
12
5 .. _command_line_options:
13 .. _command_line_options:
6
14
7 Command-line usage
15 Command-line usage
@@ -4,6 +4,14 b''
4 IPython as a system shell
4 IPython as a system shell
5 =========================
5 =========================
6
6
7 .. warning::
8
9 As of the 0.11 version of IPython, some of the features and APIs
10 described in this section have been deprecated or are broken. Our plan
11 is to continue to support these features, but they need to be updated
12 to take advantage of recent API changes. Furthermore, this section
13 of the documentation need to be updated to reflect all of these changes.
14
7 Overview
15 Overview
8 ========
16 ========
9
17
@@ -4,6 +4,14 b''
4 Quick IPython tutorial
4 Quick IPython tutorial
5 ======================
5 ======================
6
6
7 .. warning::
8
9 As of the 0.11 version of IPython, some of the features and APIs
10 described in this section have been deprecated or are broken. Our plan
11 is to continue to support these features, but they need to be updated
12 to take advantage of recent API changes. Furthermore, this section
13 of the documentation need to be updated to reflect all of these changes.
14
7 IPython can be used as an improved replacement for the Python prompt,
15 IPython can be used as an improved replacement for the Python prompt,
8 and for that you don't really need to read any more of this manual. But
16 and for that you don't really need to read any more of this manual. But
9 in this section we'll try to summarize a few tips on how to make the
17 in this section we'll try to summarize a few tips on how to make the
@@ -219,9 +219,9 b' Portability and Python requirements'
219 -----------------------------------
219 -----------------------------------
220
220
221 As of the 0.11 release, IPython works with either Python 2.5 or 2.6.
221 As of the 0.11 release, IPython works with either Python 2.5 or 2.6.
222 Versions 0.9 and 0.10 worked with Python 2.4 as well. We have not begun
222 Versions 0.9 and 0.10 worked with Python 2.4 as well. We have not yet begun
223 the test and port IPython to 3.0. Our plan is to gradually drop Python 2.5
223 to test and port IPython to Python 3. Our plan is to gradually drop Python 2.5
224 support and then begin the transition to strict 2.6 and 3.0.
224 support and then begin the transition to strict 2.6 and 3.
225
225
226 IPython is known to work on the following operating systems:
226 IPython is known to work on the following operating systems:
227
227
@@ -12,6 +12,11 b''
12 What's new in IPython
12 What's new in IPython
13 =====================
13 =====================
14
14
15 This section documents the changes that have been made in various versions of
16 IPython. Users should consult these pages to learn about new features, bug
17 fixes and backwards incompatibilities. Developers should summarize the
18 development work they do here in a user friendly format.
19
15 .. toctree::
20 .. toctree::
16 :maxdepth: 1
21 :maxdepth: 1
17
22
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
1 NO CONTENT: file was removed
NO CONTENT: file was removed
General Comments 0
You need to be logged in to leave comments. Login now