~ipython-dev/ipython/module-reorg

« back to all changes in this revision

Viewing changes to setupexe.py

  • Committer: Fernando Perez
  • Date: 2009-08-02 06:01:22 UTC
  • mto: (1152.1.56 trunk-lp)
  • mto: This revision was merged to the branch mainline in revision 1242.
  • Revision ID: fernando.perez@berkeley.edu-20090802060122-rpmmnrz4xaipuhhf
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.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/usr/bin/env python
2
 
# -*- coding: utf-8 -*-
3
 
r"""Setup script for exe distribution of IPython (does not require python).
4
 
 
5
 
- Requires py2exe
6
 
 
7
 
- install pyreadline *package dir* in ipython root directory by running:
8
 
  
9
 
svn co http://ipython.scipy.org/svn/ipython/pyreadline/branches/maintenance_1.3/pyreadline/  
10
 
wget http://ipython.scipy.org/svn/ipython/pyreadline/branches/maintenance_1.3/readline.py
11
 
 
12
 
OR (if you want the latest trunk):  
13
 
  
14
 
svn co http://ipython.scipy.org/svn/ipython/pyreadline/trunk/pyreadline
15
 
 
16
 
- Create the distribution in 'dist' by running "python exesetup.py py2exe"
17
 
 
18
 
- Run ipython.exe to go.
19
 
 
20
 
"""
21
 
 
22
 
#*****************************************************************************
23
 
#       Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
24
 
#
25
 
#  Distributed under the terms of the BSD License.  The full license is in
26
 
#  the file COPYING, distributed as part of this software.
27
 
#*****************************************************************************
28
 
 
29
 
# Stdlib imports
30
 
import os
31
 
import sys
32
 
 
33
 
from glob import glob
34
 
 
35
 
 
36
 
# A few handy globals
37
 
isfile = os.path.isfile
38
 
pjoin = os.path.join
39
 
 
40
 
from distutils.core import setup
41
 
from distutils import dir_util
42
 
import py2exe
43
 
 
44
 
# update the manuals when building a source dist
45
 
# Release.py contains version, authors, license, url, keywords, etc.
46
 
execfile(pjoin('IPython','Release.py'))
47
 
 
48
 
# A little utility we'll need below, since glob() does NOT allow you to do
49
 
# exclusion on multiple endings!
50
 
def file_doesnt_endwith(test,endings):
51
 
    """Return true if test is a file and its name does NOT end with any
52
 
    of the strings listed in endings."""
53
 
    if not isfile(test):
54
 
        return False
55
 
    for e in endings:
56
 
        if test.endswith(e):
57
 
            return False
58
 
    return True
59
 
 
60
 
 
61
 
egg_extra_kwds = {}
62
 
 
63
 
# Call the setup() routine which does most of the work
64
 
setup(name             = name,
65
 
    options   = {
66
 
    'py2exe': {
67
 
        'packages' : ['IPython', 'IPython.Extensions', 'IPython.external',
68
 
                      'pyreadline'],
69
 
        'excludes' : ["Tkconstants","Tkinter","tcl",'IPython.igrid','wx',
70
 
                      'wxPython','igrid', 'PyQt4', 'zope', 'Zope', 'Zope2',
71
 
                      '_curses','enthought.traits','gtk','qt', 'pydb','idlelib',                      
72
 
                      ]
73
 
                    
74
 
                     }
75
 
    },
76
 
    version          = version,
77
 
    description      = description,
78
 
    long_description = long_description,
79
 
    author           = authors['Fernando'][0],
80
 
    author_email     = authors['Fernando'][1],
81
 
    url              = url,
82
 
    download_url     = download_url,
83
 
    license          = license,
84
 
    platforms        = platforms,
85
 
    keywords         = keywords,
86
 
    console          = ['ipykit.py'],
87
 
    
88
 
    # extra params needed for eggs
89
 
    **egg_extra_kwds                        
90
 
    )
91
 
 
92
 
minimal_conf = """
93
 
import IPython.ipapi
94
 
ip = IPython.ipapi.get()
95
 
 
96
 
ip.load('ipy_kitcfg')
97
 
import ipy_profile_sh
98
 
"""
99
 
 
100
 
if not os.path.isdir("dist/_ipython"):
101
 
    print "Creating simple _ipython dir"
102
 
    os.mkdir("dist/_ipython")
103
 
    open("dist/_ipython/ipythonrc.ini","w").write("# intentionally blank\n")
104
 
    open("dist/_ipython/ipy_user_conf.py","w").write(minimal_conf)
105
 
    if os.path.isdir('bin'):
106
 
        dir_util.copy_tree('bin','dist/bin')