We have had a couple of discussions about this on Discord, and a good solution is yet to be agreed on.
Relevant conversation between and @kantlivelong and I: Discord
OctoPrint will drop Python 2 support with the release of 2.0, which while slated for this year has been delayed. No official word on a new date, if you watch OctoPrint on Air Gina gives a good explanation.
The thoughts we have come up with so far are:
- Block update by specifying
python_requires: >=3.6 in setup.py. Downside is that users will constantly be prompted for an update that they can't apply.
- In a previous release, defined as the last that supports Python 2 remove the software update hook if users are on Python 2. Downside here is that bugs can't be fixed because Py 2 users can't update anymore
- Similar to above, but swap the software update config to a Python 2 branch/repo that would allow for updates. Downside here is a lot more work from the maintainer.
- Check the plugin repository on updates to check the Python compatibility string is still valid. Would require a change in OctoPrint, and wouldn't work for all plugins.
Yeah, it's a difficult one that we haven't really found a good way around. Python 3 users are currently at ~23%, see https://data.octoprint.org