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