Show More
@@ -1,210 +1,218 b'' | |||||
1 | ============================= |
|
1 | ============================= | |
2 | IPython module reorganization |
|
2 | IPython module reorganization | |
3 | ============================= |
|
3 | ============================= | |
4 |
|
4 | |||
5 | Currently, IPython has many top-level modules that serve many different purposes. The lack of organization make it very difficult for developers to work on IPython and understand its design. This document contains notes about how we will reorganize the modules into sub-packages. |
|
5 | Currently, IPython has many top-level modules that serve many different purposes. The lack of organization make it very difficult for developers to work on IPython and understand its design. This document contains notes about how we will reorganize the modules into sub-packages. | |
6 |
|
6 | |||
7 | .. warning:: |
|
7 | .. warning:: | |
8 |
|
8 | |||
9 | This effort will possibly break third party packages that use IPython as |
|
9 | This effort will possibly break third party packages that use IPython as | |
10 | a library or hack on the IPython internals. |
|
10 | a library or hack on the IPython internals. | |
11 |
|
11 | |||
12 | .. warning:: |
|
12 | .. warning:: | |
13 |
|
13 | |||
14 | This effort will result in the removal from IPython of certain modules |
|
14 | This effort will result in the removal from IPython of certain modules | |
15 | that are not used anymore, don't currently work, are unmaintained, etc. |
|
15 | that are not used anymore, don't currently work, are unmaintained, etc. | |
16 |
|
16 | |||
|
17 | ||||
17 | Current subpackges |
|
18 | Current subpackges | |
18 | ================== |
|
19 | ================== | |
19 |
|
20 | |||
20 | IPython currently has the following sub-packages: |
|
21 | IPython currently has the following sub-packages: | |
21 |
|
22 | |||
22 | * :mod:`IPython.config` |
|
23 | * :mod:`IPython.config` | |
23 |
|
24 | |||
24 | * :mod:`IPython.Extensions` |
|
25 | * :mod:`IPython.Extensions` | |
25 |
|
26 | |||
26 | * :mod:`IPython.external` |
|
27 | * :mod:`IPython.external` | |
27 |
|
28 | |||
28 | * :mod:`IPython.frontend` |
|
29 | * :mod:`IPython.frontend` | |
29 |
|
30 | |||
30 | * :mod:`IPython.gui` |
|
31 | * :mod:`IPython.gui` | |
31 |
|
32 | |||
32 | * :mod:`IPython.kernel` |
|
33 | * :mod:`IPython.kernel` | |
33 |
|
34 | |||
34 | * :mod:`IPython.testing` |
|
35 | * :mod:`IPython.testing` | |
35 |
|
36 | |||
36 | * :mod:`IPython.tests` |
|
37 | * :mod:`IPython.tests` | |
37 |
|
38 | |||
38 | * :mod:`IPython.tools` |
|
39 | * :mod:`IPython.tools` | |
39 |
|
40 | |||
40 | * :mod:`IPython.UserConfig` |
|
41 | * :mod:`IPython.UserConfig` | |
41 |
|
42 | |||
42 | New Subpackages to be created |
|
43 | New Subpackages to be created | |
43 | ============================= |
|
44 | ============================= | |
44 |
|
45 | |||
45 | We propose to create the following new sub-packages: |
|
46 | We propose to create the following new sub-packages: | |
46 |
|
47 | |||
47 | * :mod:`IPython.core`. This sub-package will contain the core of the IPython |
|
48 | * :mod:`IPython.core`. This sub-package will contain the core of the IPython | |
48 | interpreter, but none of its extended capabilities. |
|
49 | interpreter, but none of its extended capabilities. | |
49 |
|
50 | |||
50 | * :mod:`IPython.lib`. IPython has many extended capabilities that are not part |
|
51 | * :mod:`IPython.lib`. IPython has many extended capabilities that are not part | |
51 |
of the IPython core. These things go here |
|
52 | of the IPython core. These things will go here. Any better names than | |
52 | core. |
|
53 | :mod:`IPython.lib`? | |
53 |
|
54 | |||
54 | * :mod:`IPython.python`. This sub-package will contain anything that might |
|
55 | * :mod:`IPython.python`. This sub-package will contain anything that might | |
55 |
eventually be found in the Python standard library |
|
56 | eventually be found in the Python standard library, like things in | |
56 | depend on Python and the standard library. Each sub-module in this |
|
57 | :mod:`genutils`. Each sub-module in this sub-package should contain functions | |
57 | sub-package should contain functions and objects that serve a single |
|
58 | and classes that serve a single purpose. Similar in purpose to | |
58 |
|
|
59 | :mod:`twisted.python`. Could also call this :mod:`IPython.tools`, | |
59 |
:mod:`IPython. |
|
60 | :mod:`IPython.utils` or something similar. | |
60 |
|
61 | |||
61 | * :mod:`IPython.sandbox`. This is for code that is untested and/or rotting and |
|
62 | * :mod:`IPython.sandbox`. This is for code that is untested and/or rotting and | |
62 | needs to be removed from IPython. Eventually all this code will either i) be |
|
63 | needs to be removed from IPython. Eventually all this code will either i) be | |
63 |
revived with tests and docs and re-included into IPython or 2) be |
|
64 | revived with tests and docs and re-included into IPython or 2) be removed from | |
64 |
separate top-level (not IPython) package that we |
|
65 | IPython proper, but put into a separate top-level (not IPython) package that we | |
|
66 | keep around. | |||
65 |
|
67 | |||
66 | Where things will be moved |
|
68 | Where things will be moved | |
67 | ========================== |
|
69 | ========================== | |
68 |
|
70 | |||
69 |
* : |
|
71 | * :file:`ColorANSI.py`. Move to :file:`IPython/core/coloransi.py`. | |
70 |
|
72 | |||
71 |
* : |
|
73 | * :file:`ConfigLoader.py`. Move to :file:`IPython/config/configloader.py`. | |
72 |
|
74 | |||
73 |
* : |
|
75 | * :file:`CrashHandler.py`. Move to :file:`IPython/core/crashhandler`. | |
74 |
|
76 | |||
75 |
* : |
|
77 | * :file:`DPyGetOpt.py`. Move to :mod:`IPython.sandbox` and replace with newer options parser. | |
76 |
|
78 | |||
77 |
* : |
|
79 | * :file:`Debugger.py`. Move to :file:`IPython/core/debugger.py`. | |
78 |
|
80 | |||
79 |
* : |
|
81 | * :file:`Extensions`. This needs to be gone through separately. Minimally, | |
80 | everything here should simply be put into :mod:`IPython.core`. Of course, as |
|
82 | the package should be renamed to :file:`extensions`. | |
81 | we do this, we will realize that some things belong in places like |
|
|||
82 | :mod:`IPython.core`, :mod:`IPython.lib` and :mod:`IPython.python`. |
|
|||
83 |
|
83 | |||
84 |
* : |
|
84 | * :file:`FakeModule.py`. Move to :file:`IPython/core/fakemodule.py`. | |
85 |
|
85 | |||
86 |
* : |
|
86 | * :file:`Gnuplot2.py`. Move to :file:`IPython.sandbox`. | |
87 |
|
87 | |||
88 |
* : |
|
88 | * :file:`GnuplotInteractive.py`. Move to :file:`IPython.sandbox`. | |
89 |
|
89 | |||
90 |
* : |
|
90 | * :file:`GnuplotRuntime.py`. Move to :file:`IPython.sandbox`. | |
91 |
|
91 | |||
92 |
* : |
|
92 | * :file:`Itpl.py`. Remove. Version already in :file:`IPython.external`. | |
93 |
|
93 | |||
94 |
* : |
|
94 | * :file:`Logger.py`. Move to :file:`IPython/core/logger.py`. | |
95 |
|
95 | |||
96 |
* : |
|
96 | * :file:`Magic.py`. Move to :file:`IPython/core/magic.py`. | |
97 |
|
97 | |||
98 |
* : |
|
98 | * :file:`OInspect.py`. Move to :file:`IPython/core/oinspect.py`. | |
99 |
|
99 | |||
100 |
* : |
|
100 | * :file:`OutputTrap.py`. Move to :file:`IPython/core/outputtrap.py`. | |
101 |
|
101 | |||
102 |
* : |
|
102 | * :file:`Prompts.py`. Move to :file:`IPython/core/prompts.py` or | |
|
103 | :file:`IPython/frontend/prompts.py`. | |||
103 |
|
104 | |||
104 |
* : |
|
105 | * :file:`PyColorize.py`. Replace with pygments? If not, move to :file:`IPython/core/pycolorize.py`. | |
105 |
|
106 | |||
106 |
* : |
|
107 | * :file:`Release.py`. Move to ??? or remove? | |
107 |
|
108 | |||
108 |
* : |
|
109 | * :file:`Shell.py`. Move to :file:`IPython.core.shell.py` or | |
|
110 | :file:`IPython/frontend/shell.py`. | |||
109 |
|
111 | |||
110 |
* : |
|
112 | * :file:`UserConfig`. Move to a subdirectory of :file:`IPython.config`. | |
111 |
|
113 | |||
112 |
* : |
|
114 | * :file:`background_jobs.py`. Move to :file:`IPython/lib/backgroundjobs.py`. | |
113 |
|
115 | |||
114 |
* : |
|
116 | * :file:`completer.py`. Move to :file:`IPython/core/completer.py`. | |
115 |
|
117 | |||
116 |
* : |
|
118 | * :file:`config`. Good where it is! | |
117 |
|
119 | |||
118 |
* : |
|
120 | * :file:`deep_reload.py`. Move to :file:`IPython/lib/deepreload.py`. | |
119 |
|
121 | |||
120 |
* : |
|
122 | * :file:`demo.py`. Move to :file:`IPython/lib/demo.py`. | |
121 |
|
123 | |||
122 |
* : |
|
124 | * :file:`dtutils.py`. Remove or move to :file:`IPython.testing` or | |
|
125 | :file:`IPython.lib`. | |||
123 |
|
126 | |||
124 |
* : |
|
127 | * :file:`excolors.py`. Move to :file:`IPython.core` or :file:`IPython.config`. | |
125 |
|
128 | |||
126 |
* : |
|
129 | * :file:`external`. Good where it is! | |
127 |
|
130 | |||
128 |
* : |
|
131 | * :file:`frontend`. Good where it is! | |
129 |
|
132 | |||
130 |
* : |
|
133 | * :file:`generics.py`. Move to :file:`IPython.python`. | |
131 |
|
134 | |||
132 |
* : |
|
135 | * :file:`genutils.py`. Move to :file:`IPython.python` and break up into different | |
|
136 | modules. | |||
133 |
|
137 | |||
134 |
* : |
|
138 | * :file:`gui`. Eventually this should be moved to a subdir of | |
|
139 | :file:`IPython.frontend`. | |||
135 |
|
140 | |||
136 |
* : |
|
141 | * :file:`history.py`. Move to :file:`IPython.core`. | |
137 |
|
142 | |||
138 |
* : |
|
143 | * :file:`hooks.py`. Move to :file:`IPython.core`. | |
139 |
|
144 | |||
140 |
* : |
|
145 | * :file:`ipapi.py`. Move to :file:`IPython.core`. | |
141 |
|
146 | |||
142 |
* : |
|
147 | * :file:`iplib.py`. Move to :file:`IPython.core`. | |
143 |
|
148 | |||
144 |
* : |
|
149 | * :file:`ipmaker.py`: Move to :file:`IPython.core`. | |
145 |
|
150 | |||
146 |
* : |
|
151 | * :file:`ipstruct.py`. Move to :file:`IPython.python`. | |
147 |
|
152 | |||
148 |
* : |
|
153 | * :file:`irunner.py`. Move to :file:`IPython.scripts`. | |
149 |
|
154 | |||
150 |
* : |
|
155 | * :file:`kernel`. Good where it is. | |
151 |
|
156 | |||
152 |
* : |
|
157 | * :file:`macro.py`. Move to :file:`IPython.core`. | |
153 |
|
158 | |||
154 |
* : |
|
159 | * :file:`numutils.py`. Move to :file:`IPython.sandbox`. | |
155 |
|
160 | |||
156 |
* : |
|
161 | * :file:`platutils.py`. Move to :file:`IPython.python`. | |
157 |
|
162 | |||
158 |
* : |
|
163 | * :file:`platutils_dummy.py`. Move to :file:`IPython.python`. | |
159 |
|
164 | |||
160 |
* : |
|
165 | * :file:`platutils_posix.py`. Move to :file:`IPython.python`. | |
161 |
|
166 | |||
162 |
* : |
|
167 | * :file:`platutils_win32.py`. Move to :file:`IPython.python`. | |
163 |
|
168 | |||
164 |
* : |
|
169 | * :file:`prefilter.py`: Move to :file:`IPython.core`. | |
165 |
|
170 | |||
166 |
* : |
|
171 | * :file:`rlineimpl.py`. Move to :file:`IPython.core`. | |
167 |
|
172 | |||
168 |
* : |
|
173 | * :file:`shadowns.py`. Move to :file:`IPython.core`. | |
169 |
|
174 | |||
170 |
* : |
|
175 | * :file:`shellglobals.py`. Move to :file:`IPython.core`. | |
171 |
|
176 | |||
172 |
* : |
|
177 | * :file:`strdispatch.py`. Move to :file:`IPython.python`. | |
173 |
|
178 | |||
174 |
* : |
|
179 | * :file:`testing`. Good where it is. | |
175 |
|
180 | |||
176 |
* : |
|
181 | * :file:`tests`. Good where it is. | |
177 |
|
182 | |||
178 |
* : |
|
183 | * :file:`tools`. Things in here need to be looked at and moved elsewhere like | |
|
184 | :file:`IPython.python`. | |||
179 |
|
185 | |||
180 |
* : |
|
186 | * :file:`twshell.py`. Move to :file:`IPython.sandbox`. | |
181 |
|
187 | |||
182 |
* : |
|
188 | * :file:`ultraTB.py`. Move to :file:`IPython/core/ultratb.py`. | |
183 |
|
189 | |||
184 |
* : |
|
190 | * :file:`upgrade_dir.py`. Move to :file:`IPython/python/upgradedir.py`. | |
185 |
|
191 | |||
186 |
* : |
|
192 | * :file:`usage.py`. Move to :file:`IPython.core`. | |
187 |
|
193 | |||
188 |
* : |
|
194 | * :file:`wildcard.py`. Move to :file:`IPython.python` or :file:`IPython.core`. | |
189 |
|
195 | |||
190 |
* : |
|
196 | * :file:`winconsole.py`. Move to :file:`IPython.lib`. | |
191 |
|
197 | |||
192 | Other things |
|
198 | Other things | |
193 | ============ |
|
199 | ============ | |
194 |
|
200 | |||
195 | When these files are moved around, a number of other things will happen at the same time: |
|
201 | When these files are moved around, a number of other things will happen at the same time: | |
196 |
|
202 | |||
197 | 1. Test files will be created for each module in IPython. Minimally, all |
|
203 | 1. Test files will be created for each module in IPython. Minimally, all | |
198 | modules will be imported as a part of the test. This will serve as a |
|
204 | modules will be imported as a part of the test. This will serve as a | |
199 | test of the module reorganization. These tests will be put into new |
|
205 | test of the module reorganization. These tests will be put into new | |
200 | :file:`tests` subdirectories that each package will have. |
|
206 | :file:`tests` subdirectories that each package will have. | |
201 |
|
207 | |||
202 | 2. Modules will be renamed to comply with PEP 8 naming conventions: all |
|
208 | 2. PyFlakes and other code checkers will be run to look for problems. | |
|
209 | ||||
|
210 | 3. Modules will be renamed to comply with PEP 8 naming conventions: all | |||
203 | lowercase and no special characters like ``-`` or ``_``. |
|
211 | lowercase and no special characters like ``-`` or ``_``. | |
204 |
|
212 | |||
205 |
|
|
213 | 4. Existing tests will be moved to the appropriate :file:`tests` | |
206 | subdirectories. |
|
214 | subdirectories. | |
207 |
|
215 | |||
208 |
|
216 | |||
209 |
|
217 | |||
210 |
|
218 |
General Comments 0
You need to be logged in to leave comments.
Login now