diff --git a/IPython/frontend/cocoa/tests/_trial_temp/test.log b/IPython/frontend/cocoa/tests/_trial_temp/test.log deleted file mode 100644 index 1fdde15..0000000 --- a/IPython/frontend/cocoa/tests/_trial_temp/test.log +++ /dev/null @@ -1,27 +0,0 @@ -2008-03-14 00:06:49-0700 [-] Log opened. -2008-03-14 00:06:49-0700 [-] --> ipython1.frontend.cocoa.tests.test_cocoa_frontend.TestIPythonCocoaControler.testControllerCompletesToken <-- -2008-03-14 00:06:49-0700 [-] Unhandled error in Deferred: -2008-03-14 00:06:49-0700 [-] Unhandled Error - Traceback (most recent call last): - File "/Library/Python/2.5/site-packages/Twisted-2.5.0_rUnknown-py2.5-macosx-10.3-i386.egg/twisted/internet/utils.py", line 144, in runWithWarningsSuppressed - result = f(*a, **kw) - File "/Users/barry/Desktop/ipython1-cocoa/ipython1/frontend/cocoa/tests/test_cocoa_frontend.py", line 94, in testControllerCompletesToken - self.controller.executeRequest([code]).addCallback(testCompletes) - File "/Library/Python/2.5/site-packages/Twisted-2.5.0_rUnknown-py2.5-macosx-10.3-i386.egg/twisted/internet/defer.py", line 196, in addCallback - callbackKeywords=kw) - File "/Library/Python/2.5/site-packages/Twisted-2.5.0_rUnknown-py2.5-macosx-10.3-i386.egg/twisted/internet/defer.py", line 187, in addCallbacks - self._runCallbacks() - --- --- - File "/Library/Python/2.5/site-packages/Twisted-2.5.0_rUnknown-py2.5-macosx-10.3-i386.egg/twisted/internet/defer.py", line 325, in _runCallbacks - self.result = callback(self.result, *args, **kw) - File "/Users/barry/Desktop/ipython1-cocoa/ipython1/frontend/cocoa/tests/test_cocoa_frontend.py", line 89, in testCompletes - self.assert_("longNameVariable" in result) - File "/Library/Python/2.5/site-packages/Twisted-2.5.0_rUnknown-py2.5-macosx-10.3-i386.egg/twisted/trial/unittest.py", line 136, in failUnless - raise self.failureException(msg) - twisted.trial.unittest.FailTest: None - -2008-03-14 00:06:49-0700 [-] --> ipython1.frontend.cocoa.tests.test_cocoa_frontend.TestIPythonCocoaControler.testControllerExecutesCode <-- -2008-03-14 00:06:49-0700 [-] --> ipython1.frontend.cocoa.tests.test_cocoa_frontend.TestIPythonCocoaControler.testControllerInstantiatesIEngineInteractive <-- -2008-03-14 00:06:49-0700 [-] --> ipython1.frontend.cocoa.tests.test_cocoa_frontend.TestIPythonCocoaControler.testControllerMirrorsUserNSWithValuesAsStrings <-- -2008-03-14 00:06:49-0700 [-] --> ipython1.frontend.cocoa.tests.test_cocoa_frontend.TestIPythonCocoaControler.testControllerRaisesCompilerErrorForIllegalCode <-- -2008-03-14 00:06:49-0700 [-] --> ipython1.frontend.cocoa.tests.test_cocoa_frontend.TestIPythonCocoaControler.testControllerReturnsNoneForIncompleteCode <-- diff --git a/IPython/frontend/tests/test_prefilterfrontend.py b/IPython/frontend/tests/test_prefilterfrontend.py index 6a9cd3a..de11c91 100644 --- a/IPython/frontend/tests/test_prefilterfrontend.py +++ b/IPython/frontend/tests/test_prefilterfrontend.py @@ -84,7 +84,7 @@ def isolate_ipython0(func): ipython0.user_ns = user_ns ipython0.user_global_ns = global_ns # Undo the hack at creation of PrefilterFrontEnd - from IPythoncore. import iplib + from IPython.core import iplib iplib.InteractiveShell.isthreaded = False return out diff --git a/IPython/kernel/client.py b/IPython/kernel/client.py index efbc160..905c395 100644 --- a/IPython/kernel/client.py +++ b/IPython/kernel/client.py @@ -30,7 +30,7 @@ __docformat__ = "restructuredtext en" import sys -# from IPython.tools import growl +# from IPython.utils import growl # growl.start("IPython1 Client") diff --git a/IPython/kernel/core/sync_traceback_trap.py b/IPython/kernel/core/sync_traceback_trap.py index cf9e1bf..973711b 100644 --- a/IPython/kernel/core/sync_traceback_trap.py +++ b/IPython/kernel/core/sync_traceback_trap.py @@ -18,7 +18,7 @@ __docformat__ = "restructuredtext en" # Imports #------------------------------------------------------------------------------- from traceback_trap import TracebackTrap -from IPython.ultraTB import ColorTB +from IPython.core.ultratb import ColorTB class SyncTracebackTrap(TracebackTrap): """ TracebackTrap that displays immediatly the traceback in addition diff --git a/IPython/kernel/multiengine.py b/IPython/kernel/multiengine.py index 4d1fe6c..0a5bd65 100644 --- a/IPython/kernel/multiengine.py +++ b/IPython/kernel/multiengine.py @@ -35,7 +35,7 @@ from twisted.internet import defer, reactor from twisted.python import log, components, failure from zope.interface import Interface, implements, Attribute -from IPython.tools import growl +from IPython.utils import growl from IPython.kernel.util import printer from IPython.kernel.twistedutil import gatherBoth from IPython.kernel import map as Map diff --git a/IPython/kernel/pendingdeferred.py b/IPython/kernel/pendingdeferred.py index 40c890b..91abdfb 100644 --- a/IPython/kernel/pendingdeferred.py +++ b/IPython/kernel/pendingdeferred.py @@ -30,7 +30,7 @@ from zope.interface import Interface, implements, Attribute from IPython.kernel.twistedutil import gatherBoth from IPython.kernel import error from IPython.external import guid -from IPython.tools import growl +from IPython.utils import growl class PendingDeferredManager(object): """A class to track pending deferreds. diff --git a/IPython/kernel/scripts/ipcontroller.py b/IPython/kernel/scripts/ipcontroller.py index 45fa612..aa87cc0 100755 --- a/IPython/kernel/scripts/ipcontroller.py +++ b/IPython/kernel/scripts/ipcontroller.py @@ -32,7 +32,7 @@ from twisted.python import log from IPython.kernel.fcutil import Tub, UnauthenticatedTub, have_crypto -# from IPython.tools import growl +# from IPython.utils import growl # growl.start("IPython1 Controller") from IPython.kernel.error import SecurityError diff --git a/scripts/iptest b/IPython/scripts/iptest similarity index 100% rename from scripts/iptest rename to IPython/scripts/iptest diff --git a/scripts/ipython b/IPython/scripts/ipython similarity index 90% rename from scripts/ipython rename to IPython/scripts/ipython index 1f9744d..0accfd4 100755 --- a/scripts/ipython +++ b/IPython/scripts/ipython @@ -23,6 +23,6 @@ this mode, there is no way to pass IPython any command-line options, as those are trapped first by Python itself. """ -import IPython.Shell +import IPython.core.shell -IPython.Shell.start().mainloop() +IPython.core.shell.start().mainloop() diff --git a/scripts/ipython-wx b/IPython/scripts/ipython-wx similarity index 100% rename from scripts/ipython-wx rename to IPython/scripts/ipython-wx diff --git a/scripts/ipython_win_post_install.py b/IPython/scripts/ipython_win_post_install.py similarity index 100% rename from scripts/ipython_win_post_install.py rename to IPython/scripts/ipython_win_post_install.py diff --git a/scripts/ipythonx b/IPython/scripts/ipythonx similarity index 100% rename from scripts/ipythonx rename to IPython/scripts/ipythonx diff --git a/scripts/irunner b/IPython/scripts/irunner similarity index 80% rename from scripts/irunner rename to IPython/scripts/irunner index c350d39..9406e27 100755 --- a/scripts/irunner +++ b/IPython/scripts/irunner @@ -4,6 +4,6 @@ Run with --help for details, or see the irunner source.""" -from IPython import irunner +from IPython.lib import irunner irunner.main() diff --git a/scripts/pycolor b/IPython/scripts/pycolor similarity index 60% rename from scripts/pycolor rename to IPython/scripts/pycolor index 9006717..8ad2267 100755 --- a/scripts/pycolor +++ b/IPython/scripts/pycolor @@ -2,5 +2,5 @@ # -*- coding: utf-8 -*- """Simple wrapper around PyColorize, which colorizes python sources.""" -import IPython.PyColorize -IPython.PyColorize.main() +import IPython.utils.PyColorize +IPython.utils.PyColorize.main() diff --git a/MANIFEST.in b/MANIFEST.in index 880dfd5..4c6c3bd 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,16 +2,20 @@ include ipython.py include setupbase.py include setupegg.py -graft scripts - graft setupext -graft IPython/UserConfig - graft IPython/kernel graft IPython/config +graft IPython/core +graft IPython/deathrow +graft IPython/external +graft IPython/frontend +graft IPython/gui +graft IPython/lib +graft IPython/quarantine +graft IPython/scripts graft IPython/testing -graft IPython/tools +graft IPython/utils recursive-include IPython/Extensions igrid_help* diff --git a/docs/source/conf.py b/docs/source/conf.py index 198b195..e4f948b 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -28,7 +28,7 @@ import ipython_console_highlighting # We load the ipython release info into a dict by explicit execution iprelease = {} -execfile('../../IPython/Release.py',iprelease) +execfile('../../IPython/core/release.py',iprelease) # General configuration # --------------------- diff --git a/docs/source/development/reorg.txt b/docs/source/development/reorg.txt index d475693..c43e623 100644 --- a/docs/source/development/reorg.txt +++ b/docs/source/development/reorg.txt @@ -84,6 +84,11 @@ level modules. Need to update the top level IPython/__init__.py file. +Need to get installation working correctly. + +When running python setup.py sdist, the Sphinx API docs fail to build because +of something going on with IPython.core.fakemodule + Where things will be moved ========================== diff --git a/ipython.py b/ipython.py index 5be0994..d2811d4 100755 --- a/ipython.py +++ b/ipython.py @@ -7,5 +7,5 @@ in './scripts' directory. This file is here (ipython source root directory) to facilitate non-root 'zero-installation' (just copy the source tree somewhere and run ipython.py) and development. """ -import IPython.Shell -IPython.Shell.start().mainloop() +import IPython.core.shell +IPython.core.shell.start().mainloop() diff --git a/setup.py b/setup.py index 46afbc8..f572729 100755 --- a/setup.py +++ b/setup.py @@ -29,7 +29,6 @@ if os.path.exists('MANIFEST'): os.remove('MANIFEST') from distutils.core import setup -# Local imports from IPython.utils.genutils import target_update from setupbase import ( @@ -42,6 +41,7 @@ from setupbase import ( ) isfile = os.path.isfile +pjoin = os.path.join #------------------------------------------------------------------------------- # Handle OS specific things @@ -99,7 +99,7 @@ if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'): # First, compute all the dependencies that can force us to rebuild the # docs. Start with the main release file that contains metadata - docdeps = ['IPython/Release.py'] + docdeps = ['IPython/core/release.py'] # Inculde all the reST sources pjoin = os.path.join for dirpath,dirnames,filenames in os.walk('docs/source'): @@ -144,12 +144,13 @@ if 'setuptools' in sys.modules: setuptools_extra_args['entry_points'] = { 'console_scripts': [ 'ipython = IPython.core.ipapi:launch_new_instance', - 'pycolor = IPython.PyColorize:main', + 'pycolor = IPython.utils.PyColorize:main', 'ipcontroller = IPython.kernel.scripts.ipcontroller:main', 'ipengine = IPython.kernel.scripts.ipengine:main', 'ipcluster = IPython.kernel.scripts.ipcluster:main', 'ipythonx = IPython.frontend.wx.ipythonx:main', 'iptest = IPython.testing.iptest:main', + 'irunner = IPython.lib.irunner:main' ] } setup_args['extras_require'] = dict( @@ -166,9 +167,9 @@ if 'setuptools' in sys.modules: scripts = [] else: # package_data of setuptools was introduced to distutils in 2.4 - cfgfiles = filter(isfile, glob('IPython/UserConfig/*')) + cfgfiles = filter(isfile, glob(pjoin('IPython','config','userconfig'))) if sys.version_info < (2,4): - data_files.append(('lib', 'IPython/UserConfig', cfgfiles)) + data_files.append(('lib', pjoin('IPython','config','userconfig'), cfgfiles)) # If we are running without setuptools, call this function which will # check for dependencies an inform the user what is needed. This is # just to make life easy for users. diff --git a/setupbase.py b/setupbase.py index 9c00a35..73c3dc3 100644 --- a/setupbase.py +++ b/setupbase.py @@ -58,7 +58,7 @@ def file_doesnt_endwith(test,endings): #--------------------------------------------------------------------------- # Release.py contains version, authors, license, url, keywords, etc. -execfile(pjoin('IPython','Release.py')) +execfile(pjoin('IPython','core','release.py')) # Create a dict with the basic information # This dict is eventually passed to setup after additional keys are added. @@ -104,21 +104,30 @@ def find_packages(): """ packages = ['IPython'] add_package(packages, 'config', tests=True) + add_package(packages, 'config.userconfig') + add_package(packages, 'core', tests=True) + add_package(packages, 'deathrow', tests=True) add_package(packages , 'Extensions') add_package(packages, 'external') - add_package(packages, 'gui') - add_package(packages, 'gui.wx') add_package(packages, 'frontend', tests=True) + # Don't include the cocoa frontend for now as it is not stable + if sys.platform == 'darwin' and False: + add_package(packages, 'frontend.cocoa', tests=True, others=['plugin']) + add_package(packages, 'frontend.cocoa.examples') + add_package(packages, 'frontend.cocoa.examples.IPython1Sandbox') + add_package(packages, 'frontend.cocoa.examples.IPython1Sandbox.English.lproj') add_package(packages, 'frontend.process') add_package(packages, 'frontend.wx') - add_package(packages, 'frontend.cocoa', tests=True) + add_package(packages, 'gui') + add_package(packages, 'gui.wx') add_package(packages, 'kernel', config=True, tests=True, scripts=True) add_package(packages, 'kernel.core', config=True, tests=True) + add_package(packages, 'lib', tests=True) + add_package(packages, 'quarantine', tests=True) + add_package(packages, 'scripts') add_package(packages, 'testing', tests=True) - add_package(packages, 'tests') add_package(packages, 'testing.plugin', tests=False) - add_package(packages, 'tools', tests=True) - add_package(packages, 'UserConfig') + add_package(packages, 'utils', tests=True) return packages #--------------------------------------------------------------------------- @@ -132,8 +141,7 @@ def find_package_data(): # This is not enough for these things to appear in an sdist. # We need to muck with the MANIFEST to get this to work package_data = { - 'IPython.UserConfig' : ['*'], - 'IPython.tools.tests' : ['*.txt'], + 'IPython.config.userconfig' : ['*'], 'IPython.testing' : ['*.txt'] } return package_data @@ -187,17 +195,24 @@ def find_data_files(): Most of these are docs. """ - docdirbase = 'share/doc/ipython' - manpagebase = 'share/man/man1' - + docdirbase = pjoin('share', 'doc', 'ipython') + manpagebase = pjoin('share', 'man', 'man1') + # Simple file lists can be made by hand - manpages = filter(isfile, glob('docs/man/*.1.gz')) - igridhelpfiles = filter(isfile, glob('IPython/Extensions/igrid_help.*')) + manpages = filter(isfile, glob(pjoin('docs','man','*.1.gz'))) + igridhelpfiles = filter(isfile, glob(pjoin('IPython','Extensions','igrid_help.*'))) # For nested structures, use the utility above - example_files = make_dir_struct('data','docs/examples', - pjoin(docdirbase,'examples')) - manual_files = make_dir_struct('data','docs/dist',pjoin(docdirbase,'manual')) + example_files = make_dir_struct( + 'data', + pjoin('docs','examples'), + pjoin(docdirbase,'examples') + ) + manual_files = make_dir_struct( + 'data', + pjoin('docs','dist'), + pjoin(docdirbase,'manual') + ) # And assemble the entire output list data_files = [ ('data',manpagebase, manpages), @@ -220,16 +235,18 @@ def find_scripts(): """ Find IPython's scripts. """ - scripts = ['IPython/kernel/scripts/ipengine', - 'IPython/kernel/scripts/ipcontroller', - 'IPython/kernel/scripts/ipcluster', - 'scripts/ipython', - 'scripts/ipythonx', - 'scripts/ipython-wx', - 'scripts/pycolor', - 'scripts/irunner', - 'scripts/iptest', - ] + kernel_scripts = pjoin('IPython','kernel','scripts') + main_scripts = pjoin('IPython','scripts') + scripts = [pjoin(kernel_scripts, 'ipengine'), + pjoin(kernel_scripts, 'ipcontroller'), + pjoin(kernel_scripts, 'ipcluster'), + pjoin(main_scripts, 'ipython'), + pjoin(main_scripts, 'ipythonx'), + pjoin(main_scripts, 'ipython-wx'), + pjoin(main_scripts, 'pycolor'), + pjoin(main_scripts, 'irunner'), + pjoin(main_scripts, 'iptest') + ] # Script to be run by the windows binary installer after the default setup # routine, to add shortcuts and similar windows-only things. Windows @@ -239,7 +256,7 @@ def find_scripts(): if len(sys.argv) > 2 and ('sdist' in sys.argv or 'bdist_rpm' in sys.argv): print >> sys.stderr,"ERROR: bdist_wininst must be run alone. Exiting." sys.exit(1) - scripts.append('scripts/ipython_win_post_install.py') + scripts.append(pjoin(main_scripts,'ipython_win_post_install.py')) return scripts