OctoPrint
OctoPrint copied to clipboard
Drop Python 3.7 (EOL)
- [X] Your changes are not possible to do through a plugin and relevant to a large audience (ideally all users of OctoPrint)
- [X] If your changes are large or otherwise disruptive: You have made sure your changes don't interfere with current development by talking it through with the maintainers, e.g. through a Brainstorming ticket
- [X] Your PR targets OctoPrint's
devel
branch if it's a completely new feature, ormaintenance
if it's a bug fix or improvement of existing functionality for the current stable version (no PRs againstmaster
or anything else please) - [X] Your PR was opened from a custom branch on your repository
(no PRs from your version of
master
,maintenance
, ordevel
please), e.g.dev/my_new_feature
orfix/my_bugfix
- [X] Your PR only contains relevant changes: no unrelated files, no dead code, ideally only one commit - rebase and squash your PR if necessary!
- [X] Your changes follow the existing coding style
- [X] If your changes include style sheets: You have modified the
.less
source files, not the.css
files (those are generated withlessc
) - [X] You have tested your changes (please state how!) - ideally you have added unit tests
- [X] You have run the existing unit tests against your changes and nothing broke
- [X] You have added yourself to the
AUTHORS.md
file :)
What does this PR do and why is it necessary?
Python 3.7 has reached its End of Life state. It's no longer maintained. Newer versions provide bug fixes and improvements that can make the code easier to maintain. More information on Python versions lifecycle here:
https://devguide.python.org/versions/
How was it tested? How can it be tested by the reviewer?
- I ran the tests locally;
- I ran all the CI workflows in my fork;
- I made a new test for removed workaround needed for 3.7;
- I checked that the bug needed the workaround is fixed in version 3.8 using Python online compiler;
Any background context you want to provide?
What's new in Python 3.8: https://docs.python.org/3/whatsnew/3.8.html
What are the relevant tickets if any?
None
Screenshots (if appropriate)
The workaround for datetime.fromtimestamp
is no longer needed.
Further notes
Since the PR reduces the range of supported Python versions by OctoPrint, I'd consider this as breaking changes targeting next major version of the product (OctoPrint 2.0)
This is not the kind of change we can do without any sort of discussion. 60% of active OctoPrint installs still use Python 3.7 because that's the version on Debian Buster and they don't re-flash their OS that often. We definitely can't do this right now, and not without some kind of communication to users to upgrade their Python version.
We definitely can't do this right now
I understand. But when you will be ready for this change, the work will already be done. Consider this as a gift to the future version of yourself, @cp2004 🎁
I converted this to draft status, since as already mentioned that is something we cannot currently merge, and it will be some time before that changes, during which this certainly will become outdated and require more work to be up-to-date again.
Thank you in any case!