From 2c8c96beb5dd205542214853cd7c301eda3bd354 2009-08-02 06:01:22 From: Fernando Perez Date: 2009-08-02 06:01:22 Subject: [PATCH] Continue tool cleanup. Removed redundant setup_bdist_egg, since setupegg can be used for the same purpose. Removed setupexe which depended on ipykit, since that is already gone. --- diff --git a/setup_bdist_egg.py b/setup_bdist_egg.py deleted file mode 100755 index 6736e39..0000000 --- a/setup_bdist_egg.py +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env python -"""Wrapper to build IPython as an egg (setuptools format).""" - -import os -import sys - -# 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])) - -# now, import setuptools and build the actual egg -import setuptools - -sys.argv=['','bdist_egg'] -execfile('setup.py') - -# clean up the junk left around by setuptools -os.system('rm -rf ipython.egg-info') diff --git a/setupegg.py b/setupegg.py index 0924b19..8ed1c35 100755 --- a/setupegg.py +++ b/setupegg.py @@ -5,8 +5,6 @@ import sys # now, import setuptools and call the actual setup import setuptools -# print sys.argv -#sys.argv=['','bdist_egg'] execfile('setup.py') # clean up the junk left around by setuptools diff --git a/setupexe.py b/setupexe.py deleted file mode 100644 index ef38539..0000000 --- a/setupexe.py +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -r"""Setup script for exe distribution of IPython (does not require python). - -- Requires py2exe - -- install pyreadline *package dir* in ipython root directory by running: - -svn co http://ipython.scipy.org/svn/ipython/pyreadline/branches/maintenance_1.3/pyreadline/ -wget http://ipython.scipy.org/svn/ipython/pyreadline/branches/maintenance_1.3/readline.py - -OR (if you want the latest trunk): - -svn co http://ipython.scipy.org/svn/ipython/pyreadline/trunk/pyreadline - -- Create the distribution in 'dist' by running "python exesetup.py py2exe" - -- Run ipython.exe to go. - -""" - -#***************************************************************************** -# 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. -#***************************************************************************** - -# Stdlib imports -import os -import sys - -from glob import glob - - -# A few handy globals -isfile = os.path.isfile -pjoin = os.path.join - -from distutils.core import setup -from distutils import dir_util -import py2exe - -# update the manuals when building a source dist -# Release.py contains version, authors, license, url, keywords, etc. -execfile(pjoin('IPython','Release.py')) - -# A little utility we'll need below, since glob() does NOT allow you to do -# exclusion on multiple endings! -def file_doesnt_endwith(test,endings): - """Return true if test is a file and its name does NOT end with any - of the strings listed in endings.""" - if not isfile(test): - return False - for e in endings: - if test.endswith(e): - return False - return True - - -egg_extra_kwds = {} - -# Call the setup() routine which does most of the work -setup(name = name, - options = { - 'py2exe': { - 'packages' : ['IPython', 'IPython.Extensions', 'IPython.external', - 'pyreadline'], - 'excludes' : ["Tkconstants","Tkinter","tcl",'IPython.igrid','wx', - 'wxPython','igrid', 'PyQt4', 'zope', 'Zope', 'Zope2', - '_curses','enthought.traits','gtk','qt', 'pydb','idlelib', - ] - - } - }, - 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, - console = ['ipykit.py'], - - # extra params needed for eggs - **egg_extra_kwds - ) - -minimal_conf = """ -import IPython.ipapi -ip = IPython.ipapi.get() - -ip.load('ipy_kitcfg') -import ipy_profile_sh -""" - -if not os.path.isdir("dist/_ipython"): - print "Creating simple _ipython dir" - os.mkdir("dist/_ipython") - open("dist/_ipython/ipythonrc.ini","w").write("# intentionally blank\n") - open("dist/_ipython/ipy_user_conf.py","w").write(minimal_conf) - if os.path.isdir('bin'): - dir_util.copy_tree('bin','dist/bin') diff --git a/tools/mkrel.py b/tools/mkrel.py index 2ef9c19..533e75a 100755 --- a/tools/mkrel.py +++ b/tools/mkrel.py @@ -30,8 +30,8 @@ c("python2.6 ./setup.py bdist_rpm --binary-only --release=py26 " "--python=/usr/bin/python2.6") # Build eggs -c('python2.5 ./eggsetup.py bdist_egg') -c('python2.6 ./eggsetup.py bdist_egg') +c('python2.5 ./setupegg.py bdist_egg') +c('python2.6 ./setupegg.py bdist_egg') # Call the windows build separately, so that the extra Windows scripts don't # get pulled into Unix builds (setup.py has code which checks for diff --git a/tools/toollib.py b/tools/toollib.py index 50355ce..206bd7a 100644 --- a/tools/toollib.py +++ b/tools/toollib.py @@ -14,8 +14,8 @@ cd = os.chdir def c(cmd): """Run system command, raise SystemExit if it returns an error.""" print "$",cmd - #stat = os.system(cmd) - stat = 0 # Uncomment this and comment previous to run in debug mode + stat = os.system(cmd) + #stat = 0 # Uncomment this and comment previous to run in debug mode if stat: raise SystemExit("Command %s failed with code: %s" % (cmd, stat))