From 1d34a16aae8524775a74ba3d44fa619e4ed6b183 2006-02-01 19:29:22 From: vivainio Date: 2006-02-01 19:29:22 Subject: [PATCH] changed setup to support easy_install ipython==dev --- diff --git a/eggsetup.py b/eggsetup.py index 4139b8d..6931cf2 100755 --- a/eggsetup.py +++ b/eggsetup.py @@ -1,55 +1,19 @@ #!/usr/bin/env python -# -*- coding: utf-8 -*- -"""Setup script for IPython. +"""Wrapper to build IPython as an egg (setuptools format).""" -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.""" +import os +import sys -#***************************************************************************** -# Copyright (C) 2001-2005 Fernando Perez -# -# Distributed under the terms of the BSD License. The full license is in -# the file COPYING, distributed as part of this software. -#***************************************************************************** +# Add my local path to sys.path +home = os.environ['HOME'] +sys.path.insert(0,'%s/usr/local/lib/python%s/site-packages' % + (home,sys.version[:3])) -import sys, os -from glob import glob -from setupext import install_data_ext +# now, import setuptools and call the actual setup +import setuptools +print sys.argv +#sys.argv=['','bdist_egg'] +execfile('setup.py') -isfile = os.path.isfile - -if os.path.exists('MANIFEST'): os.remove('MANIFEST') - -from setuptools import setup - - -execfile(os.path.join('IPython','Release.py')) - -cfgfiles = filter(isfile, glob('IPython/UserConfig/*')) - - -# Call the setup() routine which does most of the work -setup(name = name, - version = version, - description = description, - long_description = long_description, - author = authors['Fernando'][0], - author_email = authors['Fernando'][1], - url = url, - download_url = download_url, - license = license, - platforms = platforms, - keywords = keywords, - packages = ['IPython', 'IPython.Extensions'], - cmdclass = {'install_data': install_data_ext}, - data_files = [ - ('lib', 'IPython/UserConfig', cfgfiles)], - # egg options - entry_points = { - 'console_scripts': [ - 'ipython = IPython.ipapi:launch_new_instance', - 'pycolor = IPython.PyColorize:main' - ], - } - ) +# clean up the junk left around by setuptools +os.system('rm -rf ipython.egg-info build') diff --git a/setup.py b/setup.py index 971bd98..8a47cea 100755 --- a/setup.py +++ b/setup.py @@ -125,6 +125,30 @@ if 'bdist_wininst' in sys.argv: sys.exit(1) scriptfiles.append('scripts/ipython_win_post_install.py') +datafiles = [('data', docdirbase, docfiles), + ('data', os.path.join(docdirbase, 'examples'), + examfiles), + ('data', os.path.join(docdirbase, 'manual'), + manfiles), + ('data', manpagebase, manpages), + ('lib', 'IPython/UserConfig', cfgfiles)] + +if 'setuptools' in sys.modules: + # setuptools config for egg building + egg_extra_kwds = { + 'entry_points': { + 'console_scripts': [ + 'ipython = IPython.ipapi:launch_new_instance', + 'pycolor = IPython.PyColorize:main' + ]} + } + scriptfiles = [] + # eggs will lack docs, examples + datafiles = [('lib', 'IPython/UserConfig', cfgfiles)] +else: + egg_extra_kwds = {} + + # Call the setup() routine which does most of the work setup(name = name, version = version, @@ -139,12 +163,9 @@ setup(name = name, keywords = keywords, packages = ['IPython', 'IPython.Extensions'], scripts = scriptfiles, + cmdclass = {'install_data': install_data_ext}, - data_files = [('data', docdirbase, docfiles), - ('data', os.path.join(docdirbase, 'examples'), - examfiles), - ('data', os.path.join(docdirbase, 'manual'), - manfiles), - ('data', manpagebase, manpages), - ('lib', 'IPython/UserConfig', cfgfiles)] + data_files = datafiles, + # extra params needed for eggs + **egg_extra_kwds )