mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-30 12:11:32 +08:00
Merge with upstream.
This commit is contained in:
commit
177a90b66c
53
IPython/testing/iptest.py
Normal file
53
IPython/testing/iptest.py
Normal file
@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""IPython Test Suite Runner.
|
||||
"""
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
|
||||
from nose.core import TestProgram
|
||||
import nose.plugins.builtin
|
||||
|
||||
from IPython.testing.plugin.ipdoctest import IPythonDoctest
|
||||
|
||||
def main():
|
||||
"""Run the IPython test suite.
|
||||
"""
|
||||
|
||||
warnings.filterwarnings('ignore',
|
||||
'This will be removed soon. Use IPython.testing.util instead')
|
||||
|
||||
|
||||
# construct list of plugins, omitting the existing doctest plugin
|
||||
plugins = [IPythonDoctest()]
|
||||
for p in nose.plugins.builtin.plugins:
|
||||
plug = p()
|
||||
if plug.name == 'doctest':
|
||||
continue
|
||||
|
||||
#print 'adding plugin:',plug.name # dbg
|
||||
plugins.append(plug)
|
||||
|
||||
argv = sys.argv + ['--doctest-tests','--doctest-extension=txt',
|
||||
'--detailed-errors',
|
||||
|
||||
# We add --exe because of setuptools' imbecility (it
|
||||
# blindly does chmod +x on ALL files). Nose does the
|
||||
# right thing and it tries to avoid executables,
|
||||
# setuptools unfortunately forces our hand here. This
|
||||
# has been discussed on the distutils list and the
|
||||
# setuptools devs refuse to fix this problem!
|
||||
'--exe',
|
||||
]
|
||||
|
||||
has_ip = False
|
||||
for arg in sys.argv:
|
||||
if 'IPython' in arg:
|
||||
has_ip = True
|
||||
break
|
||||
|
||||
if not has_ip:
|
||||
argv.append('IPython')
|
||||
|
||||
TestProgram(argv=argv,plugins=plugins)
|
56
setup.py
56
setup.py
@ -88,28 +88,39 @@ if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
|
||||
"cd docs/man && gzip -9c pycolor.1 > pycolor.1.gz"),
|
||||
]
|
||||
|
||||
# Only build the docs is sphinx is present
|
||||
# Only build the docs if sphinx is present
|
||||
try:
|
||||
import sphinx
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
pass
|
||||
# BEG: This is disabled as I am not sure what to depend on.
|
||||
# I actually don't think we should be automatically building
|
||||
# the docs for people.
|
||||
# The do_sphinx scripts builds html and pdf, so just one
|
||||
# target is enough to cover all manual generation
|
||||
# to_update.append(
|
||||
# ('docs/manual/ipython.pdf',
|
||||
# ['IPython/Release.py','docs/source/ipython.rst'],
|
||||
# "cd docs && python do_sphinx.py")
|
||||
# )
|
||||
# The Makefile calls the do_sphinx scripts to build html and pdf, so
|
||||
# just one target is enough to cover all manual generation
|
||||
|
||||
# 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']
|
||||
# Inculde all the reST sources
|
||||
pjoin = os.path.join
|
||||
for dirpath,dirnames,filenames in os.walk('docs/source'):
|
||||
if dirpath in ['_static','_templates']:
|
||||
continue
|
||||
docdeps += [ pjoin(dirpath,f) for f in filenames
|
||||
if f.endswith('.txt') ]
|
||||
# and the examples
|
||||
for dirpath,dirnames,filenames in os.walk('docs/example'):
|
||||
docdeps += [ pjoin(dirpath,f) for f in filenames
|
||||
if not f.endswith('~') ]
|
||||
# then, make them all dependencies for the main PDF (the html will get
|
||||
# auto-generated as well).
|
||||
to_update.append(
|
||||
('docs/dist/ipython.pdf',
|
||||
docdeps,
|
||||
"cd docs && make dist")
|
||||
)
|
||||
|
||||
[ target_update(*t) for t in to_update ]
|
||||
|
||||
# Build the docs
|
||||
os.system('cd docs && make dist')
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Find all the packages, package data, scripts and data_files
|
||||
@ -137,23 +148,22 @@ if 'setuptools' in sys.modules:
|
||||
'ipcontroller = IPython.kernel.scripts.ipcontroller:main',
|
||||
'ipengine = IPython.kernel.scripts.ipengine:main',
|
||||
'ipcluster = IPython.kernel.scripts.ipcluster:main',
|
||||
'ipythonx = IPython.frontend.wx.ipythonx:main'
|
||||
'ipythonx = IPython.frontend.wx.ipythonx:main',
|
||||
'iptest = IPython.testing.iptest:main',
|
||||
]
|
||||
}
|
||||
setup_args["extras_require"] = dict(
|
||||
setup_args['extras_require'] = dict(
|
||||
kernel = [
|
||||
"zope.interface>=3.4.1",
|
||||
"Twisted>=8.0.1",
|
||||
"foolscap>=0.2.6"
|
||||
'zope.interface>=3.4.1',
|
||||
'Twisted>=8.0.1',
|
||||
'foolscap>=0.2.6'
|
||||
],
|
||||
doc=['Sphinx>=0.3','pygments'],
|
||||
doc='Sphinx>=0.3',
|
||||
test='nose>=0.10.1',
|
||||
security=["pyOpenSSL>=0.6"]
|
||||
security='pyOpenSSL>=0.6'
|
||||
)
|
||||
# Allow setuptools to handle the scripts
|
||||
scripts = []
|
||||
# eggs will lack docs, examples
|
||||
data_files = []
|
||||
else:
|
||||
# package_data of setuptools was introduced to distutils in 2.4
|
||||
cfgfiles = filter(isfile, glob('IPython/UserConfig/*'))
|
||||
|
@ -115,6 +115,7 @@ def find_packages():
|
||||
add_package(packages, 'kernel', config=True, tests=True, scripts=True)
|
||||
add_package(packages, 'kernel.core', config=True, tests=True)
|
||||
add_package(packages, 'testing', tests=True)
|
||||
add_package(packages, 'testing.plugin', tests=False)
|
||||
add_package(packages, 'tools', tests=True)
|
||||
add_package(packages, 'UserConfig')
|
||||
return packages
|
||||
@ -223,8 +224,10 @@ def find_scripts():
|
||||
'IPython/kernel/scripts/ipcluster',
|
||||
'scripts/ipython',
|
||||
'scripts/ipythonx',
|
||||
'scripts/ipython-wx',
|
||||
'scripts/pycolor',
|
||||
'scripts/irunner',
|
||||
'scripts/iptest',
|
||||
]
|
||||
|
||||
# Script to be run by the windows binary installer after the default setup
|
||||
|
Loading…
Reference in New Issue
Block a user