Update setup.py
Fixes two KeyErrors on Debian Jessie and gets rid of an unnecessary list comprehension for readability.
This commit is contained in:
parent
b304872b68
commit
ceef2811bf
23
setup.py
23
setup.py
|
@ -9,7 +9,6 @@ except ImportError:
|
||||||
haveSetuptools = False
|
haveSetuptools = False
|
||||||
|
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
|
|
||||||
from src.version import softwareVersion
|
from src.version import softwareVersion
|
||||||
|
|
||||||
packageManager = {
|
packageManager = {
|
||||||
|
@ -128,13 +127,17 @@ def detectPrereqs(missing=False):
|
||||||
|
|
||||||
|
|
||||||
def prereqToPackages():
|
def prereqToPackages():
|
||||||
print "You can install the requirements by running, as root:"
|
print "You can install the requirements by running, as sudo or root:"
|
||||||
print "%s %s" % (
|
if detectPrereqs(True):
|
||||||
packageManager[detectOS()], " ".join(
|
print "%s %s" % (packageManager[detectOS()],
|
||||||
packageName[x][detectOS()] for x in detectPrereqs(True)))
|
" ".join(detectPrereqs(True)))
|
||||||
|
|
||||||
for package in detectPrereqs(True):
|
for package in detectPrereqs(True):
|
||||||
|
try:
|
||||||
if packageName[package]['optional']:
|
if packageName[package]['optional']:
|
||||||
print packageName[package]['description']
|
print packageName[package]['description']
|
||||||
|
except KeyError:
|
||||||
|
pass
|
||||||
|
|
||||||
def compilerToPackages():
|
def compilerToPackages():
|
||||||
if not detectOS() in compiling:
|
if not detectOS() in compiling:
|
||||||
|
@ -146,20 +149,23 @@ def compilerToPackages():
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
detectOS.result = None
|
detectOS.result = None
|
||||||
detectPrereqs.result = None
|
detectPrereqs.result = None
|
||||||
if detectPrereqs(True) != [] and detectOS() in packageManager:
|
if detectPrereqs(True) and detectOS() in packageManager:
|
||||||
if detectOS() is not None:
|
if detectOS() is not None:
|
||||||
print "It looks like you're using %s. " \
|
print "It looks like you're using %s. " \
|
||||||
"It is highly recommended to use the package manager " \
|
"It is highly recommended to use the package manager " \
|
||||||
"instead of setuptools." % (detectOS())
|
"instead of setuptools." % (detectOS())
|
||||||
prereqToPackages()
|
prereqToPackages()
|
||||||
for module in detectPrereqs(True):
|
for module in detectPrereqs(True):
|
||||||
|
try:
|
||||||
if not packageName[module]['optional']:
|
if not packageName[module]['optional']:
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
except KeyError:
|
||||||
|
print('Checking %s' % module)
|
||||||
if not haveSetuptools:
|
if not haveSetuptools:
|
||||||
print "It looks like you're missing setuptools."
|
print "It looks like you're missing setuptools."
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
if detectPrereqs(True) != []:
|
if detectPrereqs(True):
|
||||||
print "Press Return to continue"
|
print "Press Return to continue"
|
||||||
try:
|
try:
|
||||||
nothing = raw_input()
|
nothing = raw_input()
|
||||||
|
@ -178,7 +184,7 @@ if __name__ == "__main__":
|
||||||
|
|
||||||
try:
|
try:
|
||||||
dist = setup(
|
dist = setup(
|
||||||
name='pybitmessage',
|
name='PyBitmessage',
|
||||||
version=softwareVersion,
|
version=softwareVersion,
|
||||||
description="Reference client for Bitmessage: "
|
description="Reference client for Bitmessage: "
|
||||||
"a P2P communications protocol",
|
"a P2P communications protocol",
|
||||||
|
@ -227,4 +233,3 @@ if __name__ == "__main__":
|
||||||
print "It looks like building the package failed.\n" \
|
print "It looks like building the package failed.\n" \
|
||||||
"You may be missing a C++ compiler and the OpenSSL headers."
|
"You may be missing a C++ compiler and the OpenSSL headers."
|
||||||
compilerToPackages()
|
compilerToPackages()
|
||||||
|
|
||||||
|
|
Reference in New Issue
Block a user