Skip to content

Commit

Permalink
Made setup.py pep8 compliant
Browse files Browse the repository at this point in the history
  • Loading branch information
acganesh committed Sep 3, 2015
1 parent 66b0e13 commit 7496e42
Showing 1 changed file with 21 additions and 10 deletions.
31 changes: 21 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,25 @@ def configuration(parent_package='', top_path=None):
scipy_min_version = '0.9'
numpy_min_version = '1.6.1'


def is_scipy_installed():
try:
import scipy
return parse_version(scipy.__version__) >= parse_version(scipy_min_version)
return parse_version(scipy.__version__) >= parse_version(
scipy_min_version)
except ImportError:
return False


def is_numpy_installed():
try:
import numpy
return parse_version(numpy.__version__) >= parse_version(numpy_min_version)
return parse_version(numpy.__version__) >= parse_version(
numpy_min_version)
except ImportError:
return False


def setup_package():
metadata = dict(name=DISTNAME,
maintainer=MAINTAINER,
Expand Down Expand Up @@ -180,15 +185,21 @@ def setup_package():
metadata['version'] = VERSION
else:
if is_numpy_installed() is False:
raise ImportError("An up-to-date version of Numerical Python (NumPy) is not installed.\n"
"scikit-learn requires NumPy >= {0}.\n".format(numpy_min_version)+
"Installation instructions are available on scikit-learn website: "
"http://scikit-learn.org/stable/install.html\n")
raise ImportError("An up-to-date version of Numerical Python "
"(NumPy) is not installed.\n"
"scikit-learn requires NumPy >= {0}.\n"
.format(numpy_min_version) +
"Installation instructions are available "
"on the scikit-learn website: "
"http://scikit-learn.org/stable/install.html\n")
if is_scipy_installed() is False:
raise ImportError("An up-to-date version of Scientific Python (SciPy) is not installed.\n"
"scikit-learn requires SciPy >= {0}.\n".format(scipy_min_version)+
"Installation instructions are available on scikit-learn website: "
"http://scikit-learn.org/stable/install.html\n")
raise ImportError("An up-to-date version of Scientific Python "
"(SciPy) is not installed.\n"
"scikit-learn requires SciPy >= {0}.\n"
.format(scipy_min_version) +
"Installation instructions are available "
"on the scikit-learn website: "
"http://scikit-learn.org/stable/install.html\n")
from numpy.distutils.core import setup

metadata['configuration'] = configuration
Expand Down

0 comments on commit 7496e42

Please sign in to comment.