Skip to content

Commit

Permalink
setup.py: Fails the script if nothing installed
Browse files Browse the repository at this point in the history
This fails the installation when readline is not built-in and no custom
packages will be installed.

Closes pombredanne#1
  • Loading branch information
yzgyyang committed Jul 24, 2018
1 parent d5ada69 commit f38b0ed
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
import os
import sys
from setuptools import setup

from distutils import sysconfig

long_description = """anyreadline tries to do the right thing and installs either
readline on MacOSX or pyreadline or Windows.
Or does nothing on Linux which comes in general with readline built-in"""
pyreadline for Windows or gnureadline for other platforms if the stdlib version
wasn't built in."""

sysplat = str(sys.platform).lower()
have_readline = sysconfig.get_config_var('HAVE_LIBREADLINE')

install_requires = ['setuptools']
if 'darwin' in sysplat:
install_requires += ['gnureadline']
if 'win32' in sysplat:
install_requires += ['pyreadline']
if not have_readline:
install_requires = ['setuptools']
if 'win32' in sysplat:
install_requires += ['pyreadline']
else:
install_requires += ['gnureadline']

setup(
name = name,
Expand Down

0 comments on commit f38b0ed

Please sign in to comment.