diff options
author | mattsb42-aws <bullocm@amazon.com> | 2018-02-06 23:22:48 -0800 |
---|---|---|
committer | mattsb42-aws <bullocm@amazon.com> | 2018-02-09 11:12:29 -0800 |
commit | 9306d4b04006b52772208b2b84ad6117f9ee7288 (patch) | |
tree | ef0816afdfa2f439b91d4466866ea4ef2ab287c4 /setup.py | |
parent | 1fba74577361e941151c46f2c9b23923a23b1a0a (diff) | |
download | pysnmp-git-9306d4b04006b52772208b2b84ad6117f9ee7288.tar.gz |
initial migration to backend-selecting crypto
Diffstat (limited to 'setup.py')
-rw-r--r-- | setup.py | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -54,11 +54,17 @@ if sys.version_info[:2] < (2, 4): print("ERROR: this package requires Python 2.4 or later!") sys.exit(1) +py_version = sys.version_info[:2] +if py_version < (2, 7) or (py_version >= (3, 0) and py_version < (3, 4)): + crypto_lib = 'pycryptodomex' +else: + crypto_lib = 'cryptography' + try: from setuptools import setup params = { - 'install_requires': ['pyasn1>=0.2.3', 'pysmi', 'pycryptodomex'], + 'install_requires': ['pyasn1>=0.2.3', 'pysmi', crypto_lib], 'zip_safe': True } @@ -72,7 +78,7 @@ except ImportError: params = {} if sys.version_info[:2] > (2, 4): - params['requires'] = ['pyasn1(>=0.2.3)', 'pysmi', 'pycryptodomex'] + params['requires'] = ['pyasn1(>=0.2.3)', 'pysmi', crypto_lib] doclines = [x.strip() for x in (__doc__ or '').split('\n') if x] @@ -101,6 +107,7 @@ params.update({ 'pysnmp.carrier.twisted.dgram', 'pysnmp.carrier.asyncio', 'pysnmp.carrier.asyncio.dgram', + 'pysnmp.crypto', 'pysnmp.entity', 'pysnmp.entity.rfc3413', 'pysnmp.entity.rfc3413.oneliner', |