##// END OF EJS Templates
Pin Jedi dependency.
Damian Yurzola -
Show More
@@ -1,265 +1,265 b''
1 1 #!/usr/bin/env python3
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-2011, IPython Development Team.
11 11 # Copyright (c) 2001-2007, Fernando Perez <fernando.perez@colorado.edu>
12 12 # Copyright (c) 2001, Janko Hauser <jhauser@zscout.de>
13 13 # Copyright (c) 2001, Nathaniel Gray <n8gray@caltech.edu>
14 14 #
15 15 # Distributed under the terms of the Modified BSD License.
16 16 #
17 17 # The full license is in the file COPYING.rst, distributed with this software.
18 18 #-----------------------------------------------------------------------------
19 19
20 20 from __future__ import print_function
21 21
22 22 import os
23 23 import sys
24 24
25 25 # **Python version check**
26 26 #
27 27 # This check is also made in IPython/__init__, don't forget to update both when
28 28 # changing Python version requirements.
29 29 if sys.version_info < (3, 7):
30 30 pip_message = 'This may be due to an out of date pip. Make sure you have pip >= 9.0.1.'
31 31 try:
32 32 import pip
33 33 pip_version = tuple([int(x) for x in pip.__version__.split('.')[:3]])
34 34 if pip_version < (9, 0, 1) :
35 35 pip_message = 'Your pip version is out of date, please install pip >= 9.0.1. '\
36 36 'pip {} detected.'.format(pip.__version__)
37 37 else:
38 38 # pip is new enough - it must be something else
39 39 pip_message = ''
40 40 except Exception:
41 41 pass
42 42
43 43
44 44 error = """
45 45 IPython 7.17+ supports Python 3.7 and above, following NEP 29.
46 46 When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
47 47 Python 3.3 and 3.4 were supported up to IPython 6.x.
48 48 Python 3.5 was supported with IPython 7.0 to 7.9.
49 49 Python 3.6 was supported with IPython up to 7.16.
50 50
51 51 See IPython `README.rst` file for more information:
52 52
53 53 https://github.com/ipython/ipython/blob/master/README.rst
54 54
55 55 Python {py} detected.
56 56 {pip}
57 57 """.format(py=sys.version_info, pip=pip_message )
58 58
59 59 print(error, file=sys.stderr)
60 60 sys.exit(1)
61 61
62 62 # At least we're on the python version we need, move on.
63 63
64 64 # BEFORE importing distutils, remove MANIFEST. distutils doesn't properly
65 65 # update it when the contents of directories change.
66 66 if os.path.exists('MANIFEST'): os.remove('MANIFEST')
67 67
68 68 from distutils.core import setup
69 69
70 70 # Our own imports
71 71 from setupbase import target_update
72 72
73 73 from setupbase import (
74 74 setup_args,
75 75 find_packages,
76 76 find_package_data,
77 77 check_package_data_first,
78 78 find_entry_points,
79 79 build_scripts_entrypt,
80 80 find_data_files,
81 81 git_prebuild,
82 82 install_symlinked,
83 83 install_lib_symlink,
84 84 install_scripts_for_symlink,
85 85 unsymlink,
86 86 )
87 87
88 88 isfile = os.path.isfile
89 89 pjoin = os.path.join
90 90
91 91 #-------------------------------------------------------------------------------
92 92 # Handle OS specific things
93 93 #-------------------------------------------------------------------------------
94 94
95 95 if os.name in ('nt','dos'):
96 96 os_name = 'windows'
97 97 else:
98 98 os_name = os.name
99 99
100 100 # Under Windows, 'sdist' has not been supported. Now that the docs build with
101 101 # Sphinx it might work, but let's not turn it on until someone confirms that it
102 102 # actually works.
103 103 if os_name == 'windows' and 'sdist' in sys.argv:
104 104 print('The sdist command is not available under Windows. Exiting.')
105 105 sys.exit(1)
106 106
107 107
108 108 #-------------------------------------------------------------------------------
109 109 # Things related to the IPython documentation
110 110 #-------------------------------------------------------------------------------
111 111
112 112 # update the manuals when building a source dist
113 113 if len(sys.argv) >= 2 and sys.argv[1] in ('sdist','bdist_rpm'):
114 114
115 115 # List of things to be updated. Each entry is a triplet of args for
116 116 # target_update()
117 117 to_update = [
118 118 ('docs/man/ipython.1.gz',
119 119 ['docs/man/ipython.1'],
120 120 'cd docs/man && gzip -9c ipython.1 > ipython.1.gz'),
121 121 ]
122 122
123 123
124 124 [ target_update(*t) for t in to_update ]
125 125
126 126 #---------------------------------------------------------------------------
127 127 # Find all the packages, package data, and data_files
128 128 #---------------------------------------------------------------------------
129 129
130 130 packages = find_packages()
131 131 package_data = find_package_data()
132 132
133 133 data_files = find_data_files()
134 134
135 135 setup_args['packages'] = packages
136 136 setup_args['package_data'] = package_data
137 137 setup_args['data_files'] = data_files
138 138
139 139 #---------------------------------------------------------------------------
140 140 # custom distutils commands
141 141 #---------------------------------------------------------------------------
142 142 # imports here, so they are after setuptools import if there was one
143 143 from distutils.command.sdist import sdist
144 144
145 145 setup_args['cmdclass'] = {
146 146 'build_py': \
147 147 check_package_data_first(git_prebuild('IPython')),
148 148 'sdist' : git_prebuild('IPython', sdist),
149 149 'symlink': install_symlinked,
150 150 'install_lib_symlink': install_lib_symlink,
151 151 'install_scripts_sym': install_scripts_for_symlink,
152 152 'unsymlink': unsymlink,
153 153 }
154 154
155 155
156 156 #---------------------------------------------------------------------------
157 157 # Handle scripts, dependencies, and setuptools specific things
158 158 #---------------------------------------------------------------------------
159 159
160 160 # For some commands, use setuptools. Note that we do NOT list install here!
161 161 # If you want a setuptools-enhanced install, just run 'setupegg.py install'
162 162 needs_setuptools = {'develop', 'release', 'bdist_egg', 'bdist_rpm',
163 163 'bdist', 'bdist_dumb', 'bdist_wininst', 'bdist_wheel',
164 164 'egg_info', 'easy_install', 'upload', 'install_egg_info',
165 165 }
166 166
167 167 if len(needs_setuptools.intersection(sys.argv)) > 0:
168 168 import setuptools
169 169
170 170 # This dict is used for passing extra arguments that are setuptools
171 171 # specific to setup
172 172 setuptools_extra_args = {}
173 173
174 174 # setuptools requirements
175 175
176 176 extras_require = dict(
177 177 parallel = ['ipyparallel'],
178 178 qtconsole = ['qtconsole'],
179 179 doc = ['Sphinx>=1.3'],
180 180 test = ['nose>=0.10.1', 'requests', 'testpath', 'pygments', 'nbformat', 'ipykernel', 'numpy>=1.14'],
181 181 terminal = [],
182 182 kernel = ['ipykernel'],
183 183 nbformat = ['nbformat'],
184 184 notebook = ['notebook', 'ipywidgets'],
185 185 nbconvert = ['nbconvert'],
186 186 )
187 187
188 188 install_requires = [
189 'setuptools>=18.5',
190 'jedi>=0.10',
191 'decorator',
192 'pickleshare',
193 'traitlets>=4.2',
194 'prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1',
195 'pygments',
196 'backcall',
189 "setuptools>=18.5",
190 "jedi>=0.16,<0.18.0",
191 "decorator",
192 "pickleshare",
193 "traitlets>=4.2",
194 "prompt_toolkit>=2.0.0,<3.1.0,!=3.0.0,!=3.0.1",
195 "pygments",
196 "backcall",
197 197 ]
198 198
199 199 # Platform-specific dependencies:
200 200 # This is the correct way to specify these,
201 201 # but requires pip >= 6. pip < 6 ignores these.
202 202
203 203 extras_require.update(
204 204 {
205 205 ':sys_platform != "win32"': ["pexpect>4.3"],
206 206 ':sys_platform == "darwin"': ["appnope"],
207 207 ':sys_platform == "win32"': ["colorama"],
208 208 }
209 209 )
210 210 # FIXME: re-specify above platform dependencies for pip < 6
211 211 # These would result in non-portable bdists.
212 212 if not any(arg.startswith('bdist') for arg in sys.argv):
213 213 if sys.platform == 'darwin':
214 214 install_requires.extend(['appnope'])
215 215
216 216 if not sys.platform.startswith("win"):
217 217 install_requires.append("pexpect>4.3")
218 218
219 219 # workaround pypa/setuptools#147, where setuptools misspells
220 220 # platform_python_implementation as python_implementation
221 221 if 'setuptools' in sys.modules:
222 222 for key in list(extras_require):
223 223 if 'platform_python_implementation' in key:
224 224 new_key = key.replace('platform_python_implementation', 'python_implementation')
225 225 extras_require[new_key] = extras_require.pop(key)
226 226
227 227 everything = set()
228 228 for key, deps in extras_require.items():
229 229 if ':' not in key:
230 230 everything.update(deps)
231 231 extras_require['all'] = list(sorted(everything))
232 232
233 233 if 'setuptools' in sys.modules:
234 234 setuptools_extra_args['python_requires'] = '>=3.7'
235 235 setuptools_extra_args['zip_safe'] = False
236 236 setuptools_extra_args['entry_points'] = {
237 237 'console_scripts': find_entry_points(),
238 238 'pygments.lexers': [
239 239 'ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer',
240 240 'ipython = IPython.lib.lexers:IPythonLexer',
241 241 'ipython3 = IPython.lib.lexers:IPython3Lexer',
242 242 ],
243 243 }
244 244 setup_args['extras_require'] = extras_require
245 245 setup_args['install_requires'] = install_requires
246 246
247 247 else:
248 248 # scripts has to be a non-empty list, or install_scripts isn't called
249 249 setup_args['scripts'] = [e.split('=')[0].strip() for e in find_entry_points()]
250 250
251 251 setup_args['cmdclass']['build_scripts'] = build_scripts_entrypt
252 252
253 253 #---------------------------------------------------------------------------
254 254 # Do the actual setup now
255 255 #---------------------------------------------------------------------------
256 256
257 257 setup_args.update(setuptools_extra_args)
258 258
259 259
260 260
261 261 def main():
262 262 setup(**setup_args)
263 263
264 264 if __name__ == '__main__':
265 265 main()
General Comments 0
You need to be logged in to leave comments. Login now