m-lundberg / simple-pid

A simple and easy to use PID controller in Python
MIT License
767 stars 209 forks source link

Drop Python 2.7 and <3.6 support? #57

Open rnestler opened 2 years ago

rnestler commented 2 years ago

In https://github.com/m-lundberg/simple-pid/commit/990019811041005c6dee23e495f330e3e96d7a0a CI was changed to only test with Python > 3.6.

So would it make sense to drop support for Python 2.7 and Python < 3.5 completely? This would allow / need the following things:

m-lundberg commented 1 year ago

Hi!

I agree that we can drop official support for older versions of Python that are past their end-of-life. I started doing some of the changes in my recent commit.

However, this drop of support is mostly saying that there are no longer any guarantees that this library will work in the older versions (it's not tested in CI), but in practice it will probably keep working in Python 2.7 as well going forward. I see no point in deliberately breaking working code, even for versions of Python which are no longer officially supported. The maintenance overhead is negligible (it's a small library).

For this reason, the workaround around time.monotonic() will stay for now. It also helps when trying to use this library on other platforms where time.monotonic() is not available (see for example #67).

I need to think about using inline type annotations instead of the .pyi file. Inline type annotations also make the code more verbose.

I removed tox.ini completely for now since I personally never used it, and tests are run for different versions of Python in CI now anyway. If someone thinks it should be added back, please comment or create an issue about it.

I will keep this issue open for now to allow for discussion or additional suggestions before anything is set in stone.