bobjacobsen / python-openlcb

MIT License
2 stars 1 forks source link

Confirm lowest Python version for compatibility #1

Closed Poikilos closed 4 months ago

Poikilos commented 5 months ago

The pyproject.toml file can specify that a certain Python version is required like so:

[project]
requires-python = ">= 3.10"

I can include that in a pull request.

The readme mentions Python 3.10. However, if there is a lower version that will work and is intended to be supported, the lowest should be put there. If the program is known to require 3.10 or above, I suggest confirm that in a comment to close this issue. Otherwise I could do further testing.

bobjacobsen commented 5 months ago

As I understand it, Python 3.10 is the first that includes the "match" statement which is used in about a half-dozen places in the code.

Poikilos commented 5 months ago

I see, thanks. That is correct: https://docs.python.org/3/whatsnew/3.10.html#syntax-and-operations. The match statement makes some nice readable code so requiring 3.10 seems desirable unless someone has a special requirement in the future.

Poikilos commented 5 months ago

We'd like this to work with Python 3.8. We got a call last week with someone pointing out that our DEPOT software doesn't work in Windows 7 due to us using Python 3.11, and @myciodan says "a surprising number of [train enthusiasts] use Windows 7. To be fair, its superior..." There are many people avoiding later versions of Windows due to bugs, compatibility, interface, privacy, ads on the start menu and weather widget, etc. I primarily use Linux but upgrade my Windows machines only to ensure I keep getting security patches. Other users may still refuse to upgrade regardless, and it is not too bad if the computer is not connected to the internet.

It will be tricky to get DEPOT itself to work in Windows 7 due to having to downgrade some dependencies, but in general both others and us will probably have to support Windows 7 for the foreseeable future for computers that are only turned on offline and only used for train layouts, and will probably sit in the same place for many years.

Though I like the match statement, for the sake of these Windows 7 users I would like to work on changing these statements so the project is compatible with Python 3.8.

bobjacobsen commented 5 months ago

I think that all makes sense for the main library. It looks like there are about eight match statements in the openlcb/ code.

Can we still require python3.10 for the conformance-checking code? That's of more limited interest. Using match statements makes the steering code somewhat more readable.