##// END OF EJS Templates
Backport PR #8805: only require gnureadline on CPython...
Min RK -
Show More
@@ -200,9 +200,11 b' install_requires = ['
200 # Platform-specific dependencies:
200 # Platform-specific dependencies:
201 # This is the correct way to specify these,
201 # This is the correct way to specify these,
202 # but requires pip >= 6. pip < 6 ignores these.
202 # but requires pip >= 6. pip < 6 ignores these.
203
203 extras_require.update({
204 extras_require.update({
204 ':sys_platform != "win32"': ['pexpect'],
205 ':sys_platform != "win32"': ['pexpect'],
205 ':sys_platform == "darwin"': ['appnope', 'gnureadline'],
206 ':sys_platform == "darwin"': ['appnope'],
207 ':sys_platform == "darwin" and platform_python_implementation == "CPython"': ['gnureadline'],
206 'terminal:sys_platform == "win32"': ['pyreadline>=2'],
208 'terminal:sys_platform == "win32"': ['pyreadline>=2'],
207 'test:python_version == "2.7"': ['mock'],
209 'test:python_version == "2.7"': ['mock'],
208 })
210 })
@@ -213,13 +215,31 b" if not any(arg.startswith('bdist') for arg in sys.argv):"
213 extras_require['test'].append('mock')
215 extras_require['test'].append('mock')
214
216
215 if sys.platform == 'darwin':
217 if sys.platform == 'darwin':
216 install_requires.extend(['appnope', 'gnureadline'])
218 install_requires.extend(['appnope'])
219 have_readline = False
220 try:
221 import readline
222 except ImportError:
223 pass
224 else:
225 if 'libedit' not in readline.__doc__:
226 have_readline = True
227 if not have_readline:
228 install_requires.extend(['gnureadline'])
217
229
218 if sys.platform.startswith('win'):
230 if sys.platform.startswith('win'):
219 extras_require['terminal'].append('pyreadline>=2.0')
231 extras_require['terminal'].append('pyreadline>=2.0')
220 else:
232 else:
221 install_requires.append('pexpect')
233 install_requires.append('pexpect')
222
234
235 # workaround pypa/setuptools#147, where setuptools misspells
236 # platform_python_implementation as python_implementation
237 if 'setuptools' in sys.modules:
238 for key in list(extras_require):
239 if 'platform_python_implementation' in key:
240 new_key = key.replace('platform_python_implementation', 'python_implementation')
241 extras_require[new_key] = extras_require.pop(key)
242
223 everything = set()
243 everything = set()
224 for key, deps in extras_require.items():
244 for key, deps in extras_require.items():
225 if ':' not in key:
245 if ':' not in key:
General Comments 0
You need to be logged in to leave comments. Login now