mwasilak / txThings

CoAP library for Twisted
94 stars 43 forks source link

Python 3 compatibility #19

Closed phillipberndt closed 6 years ago

phillipberndt commented 6 years ago

This PR adds the missing bits for Python 3 support to the feature-python3 branch, and rebases the whole thing onto the current master branch.

I only run the tests from test_coap.py as I do not have your endpoints from test_communication.py available. However, I have used this branch for about two weeks now to communicate with both CoAP servers and clients, both in Python 2 and Python 3, and haven't run into any difficulties so far.

Tests:

$ pytest2 -k coap
============================= test session starts ==============================
platform linux2 -- Python 2.7.12, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /tmp/tmp-6185/txThings, inifile:
collected 8 items                                                              

test_coap.py .......                                                     [100%]

============================== 1 tests deselected ==============================
==================== 7 passed, 1 deselected in 0.09 seconds ====================
$ pytest3 -k coap
============================= test session starts ==============================
platform linux -- Python 3.5.2, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /tmp/tmp-6185/txThings, inifile:
collected 8 items                                                              

test_coap.py .......                                                     [100%]

============================== 1 tests deselected ==============================
==================== 7 passed, 1 deselected in 0.13 seconds ====================
$ 

(I developed this change at Amazon; kind thanks to my employer for allowing me to contribute it back upstream :-))

mwasilak commented 6 years ago

Phillip, thank you for your contribution. I think it can be a good starting point for a new minor version. Due to my work schedule I can look into that after February. Draft road map:

  1. Fixing examples from /examples directory
  2. Adressing open issues
  3. Fixing tests if broken
  4. Publishing to PyPI

Best Regards