Skip to content

Commit

Permalink
only require gnureadline on CPython
Browse files Browse the repository at this point in the history
NOTE: python_implementation does not exist in any PEP, but setuptools does not have the correct 'platform_python_implementation' implemented.
  • Loading branch information
minrk committed Sep 10, 2015
1 parent 45110c6 commit 82652ec
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,8 @@ def run(self):
# but requires pip >= 6. pip < 6 ignores these.
extras_require.update({
':sys_platform != "win32"': ['pexpect'],
':sys_platform == "darwin"': ['appnope', 'gnureadline'],
':sys_platform == "darwin"': ['appnope'],
':sys_platform == "darwin" and python_implementation == "CPython"': ['gnureadline'],
'terminal:sys_platform == "win32"': ['pyreadline>=2'],
'test:python_version == "2.7"': ['mock'],
})
Expand All @@ -213,7 +214,17 @@ def run(self):
extras_require['test'].append('mock')

if sys.platform == 'darwin':
install_requires.extend(['appnope', 'gnureadline'])
install_requires.extend(['appnope'])
have_readline = False
try:
import readline
except ImportError:
pass
else:
if 'libedit' not in readline.__doc__:
have_readline = True
if not have_readline:
install_requires.extend(['gnureadline'])

if sys.platform.startswith('win'):
extras_require['terminal'].append('pyreadline>=2.0')
Expand Down

0 comments on commit 82652ec

Please sign in to comment.