etingof / pysnmp

Python SNMP library
http://snmplabs.com/pysnmp/
BSD 2-Clause "Simplified" License
576 stars 198 forks source link

Install pycrpytodome when installing for Windows #29

Closed johnthagen closed 7 years ago

johnthagen commented 7 years ago

With the switch to pycryptodome (#19), pycyptodome provides binary wheel distributions for Windows.

It shouldn't be a problem to always install pycryptodome on Windows, though technically there are only wheels for 2.7, 3.3, 3.4, and 3.5. I suspect it's unlikely that someone on Windows is using a version of Python other than those.

https://github.com/etingof/pysnmp/blob/master/setup.py#L77-L88

        if sys.platform.lower()[:3] != 'win':
            params['requires'].append('pycryptodome')

if sys.platform.lower()[:3] == 'win':
    try:
        import Crypto
    except ImportError:
        sys.stderr.write("""WARNING! WARNING! WARNING!
PyCrypto binaries are required for SNMPv3 encryption to work.
You may wish to grab them from http://www.voidspace.org.uk/python/modules.shtml
and install into your system.
""")
etingof commented 7 years ago

Thank you for the heads up! Fixed in 06d58e3f93c8afe2ba1734c075876c7409b94704.

johnthagen commented 7 years ago

Looks like there is still a check for Windows and then pycryptodome is not installed (the lines directly above this commit). Is that intentional?

etingof commented 7 years ago

No, that was not intentional. Fixed in 4501a2597af29c27c5913c81ceaa813a46b85ee6. Appreciate your attention!

johnthagen commented 7 years ago

Looks great!