Merging upstream changes from inputhook branch.

These changes are being propagated from trunk->module-reorg->inputhook
to me.
This commit is contained in:
Brian Granger 2009-08-04 12:29:37 -07:00
commit e10677aaff
3 changed files with 109 additions and 12 deletions

View File

@ -24,6 +24,7 @@ import os
import os.path as path
import sys
import subprocess
import tempfile
import time
import warnings
@ -50,6 +51,7 @@ def test_for(mod):
have_curses = test_for('_curses')
have_wx = test_for('wx')
have_wx_aui = test_for('wx.aui')
have_zi = test_for('zope.interface')
have_twisted = test_for('twisted')
have_foolscap = test_for('foolscap')
@ -69,8 +71,9 @@ def make_exclude():
pjoin('IPython', 'frontend', 'process', 'winprocess.py'),
pjoin('IPython_doctest_plugin'),
pjoin('IPython', 'extensions', 'ipy_'),
pjoin('IPython', 'extensions', 'clearcmd'),
pjoin('IPython', 'extensions', 'PhysicalQInput'),
pjoin('IPython', 'extensions', 'PhysicalQInteractive'),
pjoin('IPython', 'extensions', 'InterpreterPasteInput'),
pjoin('IPython', 'extensions', 'scitedirector'),
pjoin('IPython', 'extensions', 'numeric_formats'),
pjoin('IPython', 'testing', 'attic'),
@ -88,6 +91,9 @@ def make_exclude():
if not have_gtk or not have_gobject:
EXCLUDE.append(pjoin('IPython', 'lib', 'inputhookgtk'))
if not have_wx_aui:
EXCLUDE.append(pjoin('IPython', 'gui', 'wx', 'wxIPython'))
if not have_objc:
EXCLUDE.append(pjoin('IPython', 'frontend', 'cocoa'))
@ -109,6 +115,27 @@ def make_exclude():
if not have_pexpect:
EXCLUDE.append(pjoin('IPython', 'scripts', 'irunner'))
# This is scary. We still have things in frontend and testing that
# are being tested by nose that use twisted. We need to rethink
# how we are isolating dependencies in testing.
if not (have_twisted and have_zi and have_foolscap):
EXCLUDE.append(pjoin('IPython', 'frontend', 'asyncfrontendbase'))
EXCLUDE.append(pjoin('IPython', 'frontend', 'prefilterfrontend'))
EXCLUDE.append(pjoin('IPython', 'frontend', 'frontendbase'))
EXCLUDE.append(pjoin('IPython', 'frontend', 'linefrontendbase'))
EXCLUDE.append(pjoin('IPython', 'frontend', 'tests',
'test_linefrontend'))
EXCLUDE.append(pjoin('IPython', 'frontend', 'tests',
'test_frontendbase'))
EXCLUDE.append(pjoin('IPython', 'frontend', 'tests',
'test_prefilterfrontend'))
EXCLUDE.append(pjoin('IPython', 'frontend', 'tests',
'test_asyncfrontendbase')),
EXCLUDE.append(pjoin('IPython', 'testing', 'parametric'))
EXCLUDE.append(pjoin('IPython', 'testing', 'util'))
EXCLUDE.append(pjoin('IPython', 'testing', 'tests',
'test_decorators_trial'))
# Skip shell always because of a bug in FakeModule.
EXCLUDE.append(pjoin('IPython', 'core', 'shell'))
@ -118,6 +145,7 @@ def make_exclude():
return EXCLUDE
#-----------------------------------------------------------------------------
# Functions and classes
#-----------------------------------------------------------------------------
@ -196,9 +224,29 @@ class IPTester(object):
# Assemble call
self.call_args = self.runner+self.params
def run(self):
"""Run the stored commands"""
return subprocess.call(self.call_args)
if sys.platform == 'win32':
def run(self):
"""Run the stored commands"""
# On Windows, cd to temporary directory to run tests. Otherwise,
# Twisted's trial may not be able to execute 'trial IPython', since
# it will confuse the IPython module name with the ipython
# execution scripts, because the windows file system isn't case
# sensitive.
# We also use os.system instead of subprocess.call, because I was
# having problems with subprocess and I just don't know enough
# about win32 to debug this reliably. Os.system may be the 'old
# fashioned' way to do it, but it works just fine. If someone
# later can clean this up that's fine, as long as the tests run
# reliably in win32.
curdir = os.getcwd()
os.chdir(tempfile.gettempdir())
stat = os.system(' '.join(self.call_args))
os.chdir(curdir)
return stat
else:
def run(self):
"""Run the stored commands"""
return subprocess.call(self.call_args)
def make_runners():
@ -244,7 +292,7 @@ def run_iptestall():
t_start = time.time()
for name,runner in runners.iteritems():
print '*'*77
print 'IPython test set:', name
print 'IPython test group:',name
res = runner.run()
if res:
failed[name] = res
@ -255,14 +303,14 @@ def run_iptestall():
# summarize results
print
print '*'*77
print 'Ran %s test sets in %.3fs' % (nrunners, t_tests)
print 'Ran %s test groups in %.3fs' % (nrunners, t_tests)
print
if not failed:
print 'OK'
else:
# If anything went wrong, point out what command to rerun manually to
# see the actual errors and individual summary
print 'ERROR - %s out of %s test sets failed.' % (nfail, nrunners)
print 'ERROR - %s out of %s test groups failed.' % (nfail, nrunners)
for name in failed:
failed_runner = runners[name]
print '-'*40
@ -283,4 +331,4 @@ def main():
if __name__ == '__main__':
main()
main()

View File

@ -78,14 +78,38 @@ if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
#('docs/magic.tex',
#['IPython/Magic.py'],
#"cd doc && ./update_magic.sh" ),
('docs/man/ipcluster.1.gz',
['docs/man/ipcluster.1'],
'cd docs/man && gzip -9c ipcluster.1 > ipcluster.1.gz'),
('docs/man/ipcontroller.1.gz',
['docs/man/ipcontroller.1'],
'cd docs/man && gzip -9c ipcontroller.1 > ipcontroller.1.gz'),
('docs/man/ipengine.1.gz',
['docs/man/ipengine.1'],
'cd docs/man && gzip -9c ipengine.1 > ipengine.1.gz'),
('docs/man/ipython.1.gz',
['docs/man/ipython.1'],
"cd docs/man && gzip -9c ipython.1 > ipython.1.gz"),
'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
('docs/man/ipython-wx.1.gz',
['docs/man/ipython-wx.1'],
'cd docs/man && gzip -9c ipython-wx.1 > ipython-wx.1.gz'),
('docs/man/ipythonx.1.gz',
['docs/man/ipythonx.1'],
'cd docs/man && gzip -9c ipythonx.1 > ipythonx.1.gz'),
('docs/man/irunner.1.gz',
['docs/man/irunner.1'],
'cd docs/man && gzip -9c irunner.1 > irunner.1.gz'),
('docs/man/pycolor.1.gz',
['docs/man/pycolor.1'],
"cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz"),
'cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz'),
]
# Only build the docs if sphinx is present

View File

@ -57,7 +57,7 @@ def file_doesnt_endwith(test,endings):
# Basic project information
#---------------------------------------------------------------------------
# Release.py contains version, authors, license, url, keywords, etc.
# release.py contains version, authors, license, url, keywords, etc.
execfile(pjoin('IPython','core','release.py'))
# Create a dict with the basic information
@ -227,6 +227,31 @@ def find_data_files():
return data_files
def make_man_update_target(manpage):
"""Return a target_update-compliant tuple for the given manpage.
Parameters
----------
manpage : string
Name of the manpage, must include the section number (trailing number).
Example
-------
>>> make_man_update_target('ipython.1') #doctest: +NORMALIZE_WHITESPACE
('docs/man/ipython.1.gz',
['docs/man/ipython.1'],
'cd docs/man && gzip -9c ipython.1 > ipython.1.gz')
"""
man_dir = pjoin('docs', 'man')
manpage_gz = manpage + '.gz'
manpath = pjoin(man_dir, manpage)
manpath_gz = pjoin(man_dir, manpage_gz)
gz_cmd = ( "cd %(man_dir)s && gzip -9c %(manpage)s > %(manpage_gz)s" %
locals() )
return (manpath_gz, [manpath], gz_cmd)
#---------------------------------------------------------------------------
# Find scripts
#---------------------------------------------------------------------------