amazon-ion / ion-python

A Python implementation of Amazon Ion.
https://amazon-ion.github.io/ion-docs/
Apache License 2.0
261 stars 51 forks source link

Clean Code to Remove Python 2 bits #219

Open rmarrowstone opened 1 year ago

rmarrowstone commented 1 year ago

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 commented 1 year ago

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.

joe1234wu commented 1 year ago

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?

rmarrowstone commented 1 year ago

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.