PearsonEducation / Alarmageddon

Full-stack monitoring and alerting Python library.
Other
15 stars 10 forks source link

Python 3 Support #34

Closed scotthellman closed 4 years ago

scotthellman commented 4 years ago

Adds support for Python 3 (nominally 3.4+, as that's what fabric supports, but for full disclosure: I only tested against 3.7)

The changes fall into 5 broad categories

  1. Automatic changes suggested by the 2to3 utility
  2. Fixing logic around checks involving None and numbers - Python2 allows this, Python3 does not.
  3. Removal of pytest-localserver, as in Python 3 our tests using it were sporadically failing and the areas where we used it were easily monkeypatched over.
  4. Fabric API changes - namely, there is now a Connection object that we pass around.
  5. Updating Jinja to address a security vulnerability. Pycrypto also has a vulnerability, but there's no easy resolution to it so I've left that as future work.

The unit tests pass in both Python 2.7 and 3.7. Additionally, I have successfully run one of our real-world Alarmageddon scripts in both 2.7 and 3.7.

I've also bumped the version to 1.1.0. Once this is merged, I think we should immediately tag the commit and publish to pypi.