Closed eheinz closed 7 years ago
Repository health decreased by 0.05% when pulling d220845 on setaris:python3 into 934c5d4 on crs4:develop.
Hi eheinz,
thanks for your work.
I like your approach, since it doesn't add requirements to the library which in our case can be avoided.
I think there is still some work to do to achieve the goal. I launched the tests using python3.4 and a lot of them failed, mostly because of the problem with the function load_message_profile
which fails (I wrote a comment for that).
There are also problem issues that I list here:
print
statements need to be converted to the python3 functionmllp
module also fails in the tests because of the same problem as the load_message_profile
function: the socket functions send bytes
so the str
objects need to be encoded/decoded in python3 (have a look at the 4th point herebase_datatypes
module has a problem at line 149: the cmp
key for sorted
function is not valid anymore in Python 3. It should be substituted with key=functools.cmp_to_key(_sort_highlights)
from __future__ import unicode_literals
to use unicode
also in python 2 (I have to investigate deeply this last, I'm new to Python 3 and versions compatibility).hl7apy_profile_parser
).travis.yml
file should be updated to include tests also for Python3Since this is a deep change for the library, I'd rather merge your changes in a new branch that I will open. Maybe you can update your pull request to fix the first 3 points and, when the tests are ok both for python 2 and 3, I will merge your changes in the new branch.
Thanks again, Vittorio
I think this MR can be closed now since #23 was merged.
As @JonathonReinhart suggested, I'm closing it after #23
This pull request adds support for python 3. I chose to use the try/except approach rather than adding any external dependencies like six or python-future. I also leveraged the added support for unicode literals in python 3.3 (which substantially reduced the amount of code that needed to be altered). As a result, it works on python 3.3+.