ion-python icon indicating copy to clipboard operation
ion-python copied to clipboard

Clean Code to Remove Python 2 bits

Open rmarrowstone opened this issue 2 years ago • 3 comments

Python2 has been past EOL for almost 3 years (was Jan 1 2020, time of writing Dec 1 2022). This library has not supported it for some time now.

There is significant amounts of code dedicated to supporting Python2, uses of six and __future__ come to mind.

Additionally we are not taking advantage of language (or std) constructs like enums and namedtuples.

rmarrowstone avatar Dec 01 '22 19:12 rmarrowstone

I have completed the work in my workspace and put together a draft PR. It is currently failing to build due to Python 3.6 being past EOL.

rmarrowstone avatar Dec 05 '22 19:12 rmarrowstone

the current latest released 0.10.0 including util/Enum clean up https://github.com/amazon-ion/ion-python/commit/918beb6cfb4c5e75f7db7ba17a1f9957c973bc93#diff-64a7cfc9fffd84955daea70f5f88d19e282e962d8ca504beaecaa4391ee75800

but the ionhash https://github.com/amazon-ion/ion-hash-python/blob/master/ionhash/hasher.py#L25 is still using it, broken in PY3.

are we planning to release another version?

joe1234wu avatar Apr 27 '23 01:04 joe1234wu

We had not been, but I agree we ought to. I will also create a GH issue to cull the custom enum from ion-hash-python. Sorry about that.

rmarrowstone avatar May 03 '23 18:05 rmarrowstone