##// END OF EJS Templates
update copyright to 2011/20xx-2011...
update copyright to 2011/20xx-2011 Closes #1033 (rebased to prevent recursive merge). Closes #2. 459 *.py files in : 39 empty files 176 files without copyright 36 have copyright but don't cite the dev team 208 have copyright and cite the dev team ----------------------------------------- 0 not up to date (cite dev team but not right year) FYI, list of files that don't have copyright (and are not empty..) [ 'IPython/config/profile/cluster/ipython_config.py', 'IPython/config/profile/math/ipython_config.py', 'IPython/config/profile/pylab/ipython_config.py', 'IPython/config/profile/pysh/ipython_config.py', 'IPython/config/profile/python3/ipython_config.py', 'IPython/config/profile/sympy/ipython_config.py', 'IPython/core/shadowns.py', 'IPython/core/tests/refbug.py', 'IPython/core/tests/simpleerr.py', 'IPython/core/tests/tclass.py', 'IPython/core/tests/test_application.py', 'IPython/core/tests/test_autocall.py', 'IPython/core/tests/test_completer.py', 'IPython/core/tests/test_fakemodule.py', 'IPython/core/tests/test_formatters.py', 'IPython/core/tests/test_handlers.py', 'IPython/core/tests/test_history.py', 'IPython/core/tests/test_imports.py', 'IPython/core/tests/test_iplib.py', 'IPython/core/tests/test_logger.py', 'IPython/core/tests/test_magic.py', 'IPython/core/tests/test_plugin.py', 'IPython/core/tests/test_prefilter.py', 'IPython/core/tests/test_profile.py', 'IPython/core/tests/test_run.py', 'IPython/core/tests/test_splitinput.py', 'IPython/deathrow/astyle.py', 'IPython/deathrow/dtutils.py', 'IPython/deathrow/Gnuplot2.py', 'IPython/deathrow/GnuplotInteractive.py', 'IPython/deathrow/GnuplotRuntime.py', 'IPython/deathrow/gui/wx/ipshell_nonblocking.py', 'IPython/deathrow/gui/wx/ipython_history.py', 'IPython/deathrow/gui/wx/thread_ex.py', 'IPython/deathrow/ibrowse.py', 'IPython/deathrow/igrid.py', 'IPython/deathrow/ipipe.py', 'IPython/deathrow/ipy_defaults.py', 'IPython/deathrow/ipy_kitcfg.py', 'IPython/deathrow/ipy_legacy.py', 'IPython/deathrow/ipy_p4.py', 'IPython/deathrow/ipy_profile_none.py', 'IPython/deathrow/ipy_profile_numpy.py', 'IPython/deathrow/ipy_profile_scipy.py', 'IPython/deathrow/ipy_profile_sh.py', 'IPython/deathrow/ipy_traits_completer.py', 'IPython/deathrow/ipy_vimserver.py', 'IPython/deathrow/numeric_formats.py', 'IPython/deathrow/oldfrontend/process/__init__.py', 'IPython/deathrow/oldfrontend/wx/ipythonx.py', 'IPython/deathrow/scitedirector.py', 'IPython/deathrow/tests/test_prefilter.py', 'IPython/deathrow/twshell.py', 'IPython/extensions/__init__.py', 'IPython/extensions/autoreload.py', 'IPython/extensions/storemagic.py', 'IPython/extensions/tests/test_autoreload.py', 'IPython/external/__init__.py', 'IPython/external/argparse/__init__.py', 'IPython/external/decorator/__init__.py', 'IPython/external/decorators/__init__.py', 'IPython/external/decorators/_decorators.py', 'IPython/external/decorators/_numpy_testing_noseclasses.py', 'IPython/external/decorators/_numpy_testing_utils.py', 'IPython/external/guid/__init__.py', 'IPython/external/Itpl/__init__.py', 'IPython/external/mglob/__init__.py', 'IPython/external/mglob/_mglob.py', 'IPython/external/path/__init__.py', 'IPython/external/path/_path.py', 'IPython/external/pexpect/__init__.py', 'IPython/external/pyparsing/__init__.py', 'IPython/external/qt.py', 'IPython/external/qt_for_kernel.py', 'IPython/external/simplegeneric/__init__.py', 'IPython/external/simplegeneric/_simplegeneric.py', 'IPython/frontend/html/notebook/__init__.py', 'IPython/frontend/html/notebook/tests/test_kernelsession.py', 'IPython/frontend/qt/base_frontend_mixin.py', 'IPython/frontend/qt/console/ansi_code_processor.py', 'IPython/frontend/qt/console/bracket_matcher.py', 'IPython/frontend/qt/console/call_tip_widget.py', 'IPython/frontend/qt/console/completion_lexer.py', 'IPython/frontend/qt/console/completion_widget.py', 'IPython/frontend/qt/console/console_widget.py', 'IPython/frontend/qt/console/history_console_widget.py', 'IPython/frontend/qt/console/ipython_widget.py', 'IPython/frontend/qt/console/kill_ring.py', 'IPython/frontend/qt/console/mainwindow.py', 'IPython/frontend/qt/console/pygments_highlighter.py', 'IPython/frontend/qt/console/qtconsoleapp.py', 'IPython/frontend/qt/console/rich_ipython_widget.py', 'IPython/frontend/qt/console/styles.py', 'IPython/frontend/qt/console/tests/test_ansi_code_processor.py', 'IPython/frontend/qt/console/tests/test_completion_lexer.py', 'IPython/frontend/qt/console/tests/test_kill_ring.py', 'IPython/frontend/qt/kernelmanager.py', 'IPython/frontend/qt/rich_text.py', 'IPython/frontend/qt/svg.py', 'IPython/frontend/qt/util.py', 'IPython/kernel/__init__.py', 'IPython/lib/clipboard.py', 'IPython/lib/display.py', 'IPython/lib/irunner.py', 'IPython/lib/security.py', 'IPython/lib/tests/test_imports.py', 'IPython/lib/tests/test_irunner.py', 'IPython/lib/tests/test_irunner_pylab_magic.py', 'IPython/lib/tests/test_security.py', 'IPython/nbformat/v1/tests/nbexamples.py', 'IPython/nbformat/v1/tests/test_json.py', 'IPython/nbformat/v1/tests/test_nbbase.py', 'IPython/nbformat/v2/tests/nbexamples.py', 'IPython/nbformat/v2/tests/test_json.py', 'IPython/nbformat/v2/tests/test_nbbase.py', 'IPython/nbformat/v2/tests/test_nbpy.py', 'IPython/quarantine/clearcmd.py', 'IPython/quarantine/envpersist.py', 'IPython/quarantine/ext_rescapture.py', 'IPython/quarantine/ipy_app_completers.py', 'IPython/quarantine/ipy_completers.py', 'IPython/quarantine/ipy_editors.py', 'IPython/quarantine/ipy_exportdb.py', 'IPython/quarantine/ipy_extutil.py', 'IPython/quarantine/ipy_fsops.py', 'IPython/quarantine/ipy_gnuglobal.py', 'IPython/quarantine/ipy_jot.py', 'IPython/quarantine/ipy_lookfor.py', 'IPython/quarantine/ipy_profile_doctest.py', 'IPython/quarantine/ipy_pydb.py', 'IPython/quarantine/ipy_rehashdir.py', 'IPython/quarantine/ipy_render.py', 'IPython/quarantine/ipy_server.py', 'IPython/quarantine/ipy_signals.py', 'IPython/quarantine/ipy_synchronize_with.py', 'IPython/quarantine/ipy_system_conf.py', 'IPython/quarantine/ipy_which.py', 'IPython/quarantine/ipy_winpdb.py', 'IPython/quarantine/ipy_workdir.py', 'IPython/quarantine/jobctrl.py', 'IPython/quarantine/ledit.py', 'IPython/quarantine/win32clip.py', 'IPython/testing/mkdoctests.py', 'IPython/testing/plugin/dtexample.py', 'IPython/testing/plugin/ipdoctest.py', 'IPython/testing/plugin/iptest.py', 'IPython/testing/plugin/setup.py', 'IPython/testing/plugin/show_refs.py', 'IPython/testing/plugin/simple.py', 'IPython/testing/plugin/simplevars.py', 'IPython/testing/plugin/test_ipdoctest.py', 'IPython/testing/plugin/test_refs.py', 'IPython/testing/skipdoctest.py', 'IPython/testing/tests/test_decorators.py', 'IPython/utils/autoattr.py', 'IPython/utils/nested_context.py', 'IPython/utils/pickleshare.py', 'IPython/utils/py3compat.py', 'IPython/utils/PyColorize.py', 'IPython/utils/rlineimpl.py', 'IPython/utils/strdispatch.py', 'IPython/utils/tempdir.py', 'IPython/utils/tests/test_imports.py', 'IPython/utils/tests/test_wildcard.py', 'IPython/utils/upgradedir.py', 'IPython/zmq/completer.py', 'IPython/zmq/displayhook.py', 'IPython/zmq/entry_point.py', 'IPython/zmq/frontend.py', 'IPython/zmq/iostream.py', 'IPython/zmq/ipkernel.py', 'IPython/zmq/log.py', 'IPython/zmq/parentpoller.py', 'IPython/zmq/pykernel.py', 'IPython/zmq/pylab/backend_inline.py', 'IPython/zmq/zmqshell.py' ]

File last commit:

r4955:a924f50c
r5390:c82649ea
Show More
setup2.py
272 lines | 9.9 KiB | text/x-python | PythonLexer
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Setup script for IPython.
Under Posix environments it works like a typical setup.py script.
Under Windows, the command sdist is not supported, since IPython
requires utilities which are not available under Windows."""
#-----------------------------------------------------------------------------
# Copyright (c) 2008-2011, IPython Development Team.
# Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
# Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
# Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Minimal Python version sanity check
#-----------------------------------------------------------------------------
import sys
# This check is also made in IPython/__init__, don't forget to update both when
# changing Python version requirements.
if sys.version[0:3] < '2.6':
error = """\
ERROR: 'IPython requires Python Version 2.6 or above.'
Exiting."""
print >> sys.stderr, error
sys.exit(1)
# At least we're on the python version we need, move on.
#-------------------------------------------------------------------------------
# Imports
#-------------------------------------------------------------------------------
# Stdlib imports
import os
import shutil
from glob import glob
# BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
# update it when the contents of directories change.
if os.path.exists('MANIFEST'): os.remove('MANIFEST')
from distutils.core import setup
# Our own imports
from IPython.utils.path import target_update
from setupbase import (
setup_args,
find_packages,
find_package_data,
find_scripts,
find_data_files,
check_for_dependencies,
record_commit_info,
)
from setupext import setupext
isfile = os.path.isfile
pjoin = os.path.join
#-----------------------------------------------------------------------------
# Function definitions
#-----------------------------------------------------------------------------
def cleanup():
"""Clean up the junk left around by the build process"""
if "develop" not in sys.argv:
try:
shutil.rmtree('ipython.egg-info')
except:
try:
os.unlink('ipython.egg-info')
except:
pass
#-------------------------------------------------------------------------------
# Handle OS specific things
#-------------------------------------------------------------------------------
if os.name == 'posix':
os_name = 'posix'
elif os.name in ['nt','dos']:
os_name = 'windows'
else:
print 'Unsupported operating system:',os.name
sys.exit(1)
# Under Windows, 'sdist' has not been supported. Now that the docs build with
# Sphinx it might work, but let's not turn it on until someone confirms that it
# actually works.
if os_name == 'windows' and 'sdist' in sys.argv:
print 'The sdist command is not available under Windows. Exiting.'
sys.exit(1)
#-------------------------------------------------------------------------------
# Things related to the IPython documentation
#-------------------------------------------------------------------------------
# update the manuals when building a source dist
if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
import textwrap
# List of things to be updated. Each entry is a triplet of args for
# target_update()
to_update = [
# FIXME - Disabled for now: we need to redo an automatic way
# of generating the magic info inside the rst.
#('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/iplogger.1.gz',
['docs/man/iplogger.1'],
'cd docs/man && gzip -9c iplogger.1 > iplogger.1.gz'),
('docs/man/ipython.1.gz',
['docs/man/ipython.1'],
'cd docs/man && gzip -9c ipython.1 > ipython.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'),
]
# Only build the docs if sphinx is present
try:
import sphinx
except ImportError:
pass
else:
# 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/core/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 html docs
to_update.append(
('docs/dist/index.html',
docdeps,
"cd docs && make dist")
)
[ target_update(*t) for t in to_update ]
#---------------------------------------------------------------------------
# Find all the packages, package data, and data_files
#---------------------------------------------------------------------------
packages = find_packages()
package_data = find_package_data()
data_files = find_data_files()
#---------------------------------------------------------------------------
# Handle scripts, dependencies, and setuptools specific things
#---------------------------------------------------------------------------
# For some commands, use setuptools. Note that we do NOT list install here!
# If you want a setuptools-enhanced install, just run 'setupegg.py install'
needs_setuptools = set(('develop', 'release', 'bdist_egg', 'bdist_rpm',
'bdist', 'bdist_dumb', 'bdist_wininst', 'install_egg_info',
'egg_info', 'easy_install', 'upload',
))
if sys.platform == 'win32':
# Depend on setuptools for install on *Windows only*
# If we get script-installation working without setuptools,
# then we can back off, but until then use it.
# See Issue #369 on GitHub for more
needs_setuptools.add('install')
if len(needs_setuptools.intersection(sys.argv)) > 0:
import setuptools
# This dict is used for passing extra arguments that are setuptools
# specific to setup
setuptools_extra_args = {}
if 'setuptools' in sys.modules:
setuptools_extra_args['zip_safe'] = False
setuptools_extra_args['entry_points'] = find_scripts(True)
setup_args['extras_require'] = dict(
parallel = 'pyzmq>=2.1.4',
zmq = 'pyzmq>=2.1.4',
doc = 'Sphinx>=0.3',
test = 'nose>=0.10.1',
notebook = 'tornado>=2.0'
)
requires = setup_args.setdefault('install_requires', [])
setupext.display_status = False
if not setupext.check_for_readline():
if sys.platform == 'darwin':
requires.append('readline')
elif sys.platform.startswith('win') and sys.maxsize < 2**32:
# only require pyreadline on 32b Windows, due to 64b bug in pyreadline:
# https://bugs.launchpad.net/pyreadline/+bug/787574
requires.append('pyreadline')
else:
pass
# do we want to install readline here?
# Script to be run by the windows binary installer after the default setup
# routine, to add shortcuts and similar windows-only things. Windows
# post-install scripts MUST reside in the scripts/ dir, otherwise distutils
# doesn't find them.
if 'bdist_wininst' in sys.argv:
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)
setup_args['scripts'] = [pjoin('scripts','ipython_win_post_install.py')]
setup_args['options'] = {"bdist_wininst":
{"install_script":
"ipython_win_post_install.py"}}
else:
# 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.
check_for_dependencies()
setup_args['scripts'] = find_scripts(False)
#---------------------------------------------------------------------------
# Do the actual setup now
#---------------------------------------------------------------------------
setup_args['cmdclass'] = {'build_py': record_commit_info('IPython')}
setup_args['packages'] = packages
setup_args['package_data'] = package_data
setup_args['data_files'] = data_files
setup_args.update(setuptools_extra_args)
def main():
setup(**setup_args)
cleanup()
if __name__ == '__main__':
main()