Thumbor 7 will remove support for Python 2, requiring Python 3.6+. Previous versions of Thumbor do not support Python 3. That means that Debian Buster is required (T216815).
There are a number of breaking changes in Thumbor 7 (https://github.com/thumbor/thumbor/releases/tag/7.0.0a5), mostly around replacing callbacks with async/await.
Thumbor 7 will also allow extensions to easily add new handlers, which may obsolete some of our custom code.
Migration plan of porting the project to Python 3.7:
- The following items must be checked more precisely. If they exist in the thumbor-plugins project, they must be definitely fixed before the migartion:
- using // instead of / when dividing integers
- using new-style classes
- separating binary data and strings
- using the iterator-methods on dictionaries
- incorrect imports
- relative imports problem
- indentation
- rounding behavior
- reorganizations and renamings
- binding method
- We decided to use 2to3 fixer, since it exists in Python 3.7 version. So the second step is to run the fixer and make the code Python3 compatible.
- The last step is to update all the dependencies to necessary versions which are compatible with Python 3.7 and rewrite the code according to new features of the dependencies if it is necessary. We will also need to update the setup.py file to denote Python 3 compatibility.