From: Daira Hopwood Date: Tue, 7 Oct 2014 18:11:13 +0000 (+0100) Subject: Only allow pyOpenSSL >= 0.14 if it is already installed. fixes #2193 X-Git-Tag: allmydata-tahoe-1.10.1a1~120 X-Git-Url: https://git.rkrishnan.org/something?a=commitdiff_plain;h=18ffc29f4949b6098b8b89e6e89c89923121cda2;p=tahoe-lafs%2Ftahoe-lafs.git Only allow pyOpenSSL >= 0.14 if it is already installed. fixes #2193 Signed-off-by: Daira Hopwood --- diff --git a/src/allmydata/_auto_deps.py b/src/allmydata/_auto_deps.py index fa396cb7..1b326ed9 100644 --- a/src/allmydata/_auto_deps.py +++ b/src/allmydata/_auto_deps.py @@ -35,7 +35,6 @@ install_requires = [ # library, we need to update this declaration here. # "foolscap >= 0.6.3", - "pyOpenSSL", # Needed for SFTP. pyasn1 is needed by twisted.conch in Twisted >= 9.0. # pycrypto 2.2 doesn't work due to https://bugs.launchpad.net/pycrypto/+bug/620253 @@ -153,6 +152,48 @@ else: ('pyasn1-modules', 'pyasn1_modules'), ] +# If pyOpenSSL >= 0.14 is *already* installed, then accept it, otherwise +# require pyOpenSSL 0.13 or 0.13.1. +# See for why +# we don't rely on pkg_resources to tell us the installed pyOpenSSL version number. + +_can_use_pyOpenSSL_0_14 = False +try: + import OpenSSL + pyOpenSSL_ver = OpenSSL.__version__.split('.') + if int(pyOpenSSL_ver[0]) > 0 or int(pyOpenSSL_ver[1]) >= 14: + _can_use_pyOpenSSL_0_14 = True +except Exception: + pass + +if _can_use_pyOpenSSL_0_14: + install_requires += [ + # pyOpenSSL >= 0.13 is needed in order to fix + # . + "pyOpenSSL >= 0.13", + + # ... and now all the new stuff that pyOpenSSL 0.14 transitively + # depends on. We specify these explicitly because setuptools is + # bad at correctly resolving indirect dependencies (e.g. see + # ). + # + "cryptography", + "cffi >= 0.8", # latest cryptography depends on this version + "six >= 1.4.1", # latest cryptography depends on this version + "pycparser", # cffi depends on this + ] + + package_imports += [ + ('cryptography', 'cryptography'), + ('cffi', 'cffi'), + ('six', 'six'), + ('pycparser', 'pycparser'), + ] +else: + install_requires += [ + "pyOpenSSL == 0.13, == 0.13.1", + ] + # These are suppressed globally: