nerdocs / pydifact

A python EDIFACT library.
MIT License
154 stars 45 forks source link

Small tweaks to allow Python 3.5 compatibility #35

Closed theangryangel closed 3 years ago

theangryangel commented 3 years ago

I'm working on a project which is (for now) pinned to Python 3.5, and I was hoping to use pydifact.

I just had to replace the fstrings with format calls instead, everything else so far seems fine (test suite passes, etc.)

As-per the docs I did run black as well, which has formatted code I did not write. I can back out these changes if you would like.

nerdoc commented 3 years ago

Hmmm. Python 3.5 has no support any more. So, as this is intended as future release (pydifact is alpha ATM), I see it problematic to use older, unsupported versions of Python and support them too... Why is it pinned to an old version? Would it be a possibility to use a separate branch for that? I'd really like to keep up with newer, faster features of Python... What do you say?

theangryangel commented 3 years ago

As much as I would love to upgrade Python, the project I was ultimately looking to use this is in within an Odoo 12.0 installation (Odoo is a monolithic ERP written in Python, where support is "limited" to the version specified at each new major release - 12.0 released at 3.5, 13.0 at 3.6, and so on).

Technically you can run Odoo under newer version of Python than specified. Practically this leads to issues like this which in a monolith that's running an entire business is a hell of a problem to wake up to on a Monday, so we tend to be conservative and pin to the officially supported versions.

There are plans to take this project from 12.0 to 14.0 (which would allow me to upgrade from Python 3.5), but there's a lot of moving parts to that, and it's not happening any time soon.

I'd love to contribute changes I add (i.e. #18), rather than fork or look for other solutions, but it would all be 3.5 compatible at the moment.

If that's not a direction you want this library to go in, that's no problem and I totally understand :)

nerdoc commented 3 years ago

Ok, I understand. And I think pydifact will be there for a longer time, as I'll use it in a long term project. But the real "start" will be in "a future, (not) far from now" - meaning - I don't really know. And I think at that time the active Python version will be 5.0 ;-) So ok, I'll have a look at it and will pull it - it's a small "scrifice" for having more people on an open source project. Thanks anyway.

nerdoc commented 3 years ago

Yes, looks all good. Thanks for making the black reformatting an extra commit - i'm surely ok with that. If not you, I'd have been the next one who'd have done that, so no matter.

nerdoc commented 3 years ago

oh, and maybe I'll open an issue, to remind me of the old Python3.5 compatibility. If you don't need it any more, please tell me.