From a6295dcc0f15e415267542a5b6074536320618a1 Mon Sep 17 00:00:00 2001 From: Scott King Date: Sun, 7 May 2017 01:54:59 -0600 Subject: [PATCH] Update setup.py --- setup.py | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/setup.py b/setup.py index 5a2b24dd..0b5a5ee2 100644 --- a/setup.py +++ b/setup.py @@ -131,7 +131,6 @@ def prereqToPackages(): if detectPrereqs(True): print "%s %s" % (packageManager[detectOS()], " ".join(detectPrereqs(True))) - for package in detectPrereqs(True): try: if packageName[package]['optional']: @@ -139,28 +138,31 @@ def prereqToPackages(): except KeyError: pass + def compilerToPackages(): if not detectOS() in compiling: return - print "You can install the requirements by running, as root:" - print "%s %s" % ( - packageManager[detectOS()], compiling[detectOS()]) + print "You can install the requirements by running, as sudo or root:" + if compiling[detectOS()]: + print "%s %s" % (packageManager[detectOS()], + compiling[detectOS()]) + if __name__ == "__main__": detectOS.result = None detectPrereqs.result = None if detectPrereqs(True) and detectOS() in packageManager: - if detectOS() is not None: + if detectOS() is not None and detectOS.result != "Windows": print "It looks like you're using %s. " \ "It is highly recommended to use the package manager " \ "instead of setuptools." % (detectOS()) - prereqToPackages() - for module in detectPrereqs(True): - try: - if not packageName[module]['optional']: - sys.exit() - except KeyError: - print('Checking %s' % module) + prereqToPackages() + for module in detectPrereqs(True): + try: + if not packageName[module]['optional']: + sys.exit() + except KeyError: + print 'Checking %s' % module if not haveSetuptools: print "It looks like you're missing setuptools." sys.exit()