##// END OF EJS Templates
Fixing minor typo in setup.py
Brian E Granger -
Show More
@@ -1,173 +1,174 b''
1 1 #!/usr/bin/env python
2 2 # -*- coding: utf-8 -*-
3 3 """Setup script for IPython.
4 4
5 5 Under Posix environments it works like a typical setup.py script.
6 6 Under Windows, the command sdist is not supported, since IPython
7 7 requires utilities which are not available under Windows."""
8 8
9 9 #-------------------------------------------------------------------------------
10 10 # Copyright (C) 2008 The IPython Development Team
11 11 #
12 12 # Distributed under the terms of the BSD License. The full license is in
13 13 # the file COPYING, distributed as part of this software.
14 14 #-------------------------------------------------------------------------------
15 15
16 16 #-------------------------------------------------------------------------------
17 17 # Imports
18 18 #-------------------------------------------------------------------------------
19 19
20 20 # Stdlib imports
21 21 import os
22 22 import sys
23 23
24 24 from glob import glob
25 25
26 26 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
27 27 # update it when the contents of directories change.
28 28 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
29 29
30 30 from distutils.core import setup
31 31
32 32 # Local imports
33 33 from IPython.genutils import target_update
34 34
35 35 from setupbase import (
36 36 setup_args,
37 37 find_packages,
38 38 find_package_data,
39 39 find_scripts,
40 40 find_data_files,
41 41 check_for_dependencies
42 42 )
43 43
44 44 isfile = os.path.isfile
45 45
46 46 #-------------------------------------------------------------------------------
47 47 # Handle OS specific things
48 48 #-------------------------------------------------------------------------------
49 49
50 50 if os.name == 'posix':
51 51 os_name = 'posix'
52 52 elif os.name in ['nt','dos']:
53 53 os_name = 'windows'
54 54 else:
55 55 print 'Unsupported operating system:',os.name
56 56 sys.exit(1)
57 57
58 58 # Under Windows, 'sdist' has not been supported. Now that the docs build with
59 59 # Sphinx it might work, but let's not turn it on until someone confirms that it
60 60 # actually works.
61 61 if os_name == 'windows' and 'sdist' in sys.argv:
62 62 print 'The sdist command is not available under Windows. Exiting.'
63 63 sys.exit(1)
64 64
65 65 #-------------------------------------------------------------------------------
66 66 # Things related to the IPython documentation
67 67 #-------------------------------------------------------------------------------
68 68
69 69 # update the manuals when building a source dist
70 70 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
71 71 import textwrap
72 72
73 73 # List of things to be updated. Each entry is a triplet of args for
74 74 # target_update()
75 75 to_update = [
76 76 # FIXME - Disabled for now: we need to redo an automatic way
77 77 # of generating the magic info inside the rst.
78 78 #('doc/magic.tex',
79 79 #['IPython/Magic.py'],
80 80 #"cd doc && ./update_magic.sh" ),
81 81
82 82 ('doc/ipython.1.gz',
83 83 ['doc/ipython.1'],
84 84 "cd doc && gzip -9c ipython.1 > ipython.1.gz"),
85 85
86 86 ('doc/pycolor.1.gz',
87 87 ['doc/pycolor.1'],
88 88 "cd doc && gzip -9c pycolor.1 > pycolor.1.gz"),
89 89 ]
90 90
91 91 # Only build the docs is sphinx is present
92 92 try:
93 93 import sphinx
94 94 except ImportError:
95 95 pass
96 96 else:
97 pass
97 98 # BEG: This is disabled as I am not sure what to depend on.
98 99 # I actually don't think we should be automatically building
99 100 # the docs for people.
100 101 # The do_sphinx scripts builds html and pdf, so just one
101 102 # target is enough to cover all manual generation
102 103 # to_update.append(
103 104 # ('doc/manual/ipython.pdf',
104 105 # ['IPython/Release.py','doc/source/ipython.rst'],
105 106 # "cd docs && python do_sphinx.py")
106 )
107 # )
107 108 [ target_update(*t) for t in to_update ]
108 109
109 110 #---------------------------------------------------------------------------
110 111 # Find all the packages, package data, scripts and data_files
111 112 #---------------------------------------------------------------------------
112 113
113 114 packages = find_packages()
114 115 package_data = find_package_data()
115 116 scripts = find_scripts()
116 117 data_files = find_data_files()
117 118
118 119 #---------------------------------------------------------------------------
119 120 # Handle dependencies and setuptools specific things
120 121 #---------------------------------------------------------------------------
121 122
122 123 # This dict is used for passing extra arguments that are setuptools
123 124 # specific to setup
124 125 setuptools_extra_args = {}
125 126
126 127 if 'setuptools' in sys.modules:
127 128 setuptools_extra_args['zip_safe'] = False
128 129 setuptools_extra_args['entry_points'] = {
129 130 'console_scripts': [
130 131 'ipython = IPython.ipapi:launch_new_instance',
131 132 'pycolor = IPython.PyColorize:main',
132 133 'ipcontroller = IPython.kernel.scripts.ipcontroller:main',
133 134 'ipengine = IPython.kernel.scripts.ipengine:main',
134 135 'ipcluster = IPython.kernel.scripts.ipcluster:main'
135 136 ]
136 137 }
137 138 setup_args["extras_require"] = dict(
138 139 kernel = [
139 140 "zope.interface>=3.4.1",
140 141 "Twisted>=8.0.1",
141 142 "foolscap>=0.2.6"
142 143 ],
143 144 doc=['Sphinx>=0.3','pygments'],
144 145 test='nose>=0.10.1',
145 146 security=["pyOpenSSL>=0.6"]
146 147 )
147 148 # Allow setuptools to handle the scripts
148 149 scripts = []
149 150 # eggs will lack docs, examples
150 151 data_files = []
151 152 else:
152 153 # package_data of setuptools was introduced to distutils in 2.4
153 154 cfgfiles = filter(isfile, glob('IPython/UserConfig/*'))
154 155 if sys.version_info < (2,4):
155 156 data_files.append(('lib', 'IPython/UserConfig', cfgfiles))
156 157 # If we are running without setuptools, call this function which will
157 158 # check for dependencies an inform the user what is needed. This is
158 159 # just to make life easy for users.
159 160 check_for_dependencies()
160 161
161 162
162 163 #---------------------------------------------------------------------------
163 164 # Do the actual setup now
164 165 #---------------------------------------------------------------------------
165 166
166 167 setup_args['packages'] = packages
167 168 setup_args['package_data'] = package_data
168 169 setup_args['scripts'] = scripts
169 170 setup_args['data_files'] = data_files
170 171 setup_args.update(setuptools_extra_args)
171 172
172 173 if __name__ == '__main__':
173 174 setup(**setup_args)
General Comments 0
You need to be logged in to leave comments. Login now