Plone 6 on Python 3.10

Hi all,

for the ones interested on this topic, getting Plone to run on Python 3.10, please have a look at: plone-6.0-python-3.10 #109 [Jenkins]

Fear not, although it says that +500 tests failed, it is actually much more tests than that, but they can not even run because of an import failure on a single package:

  File "/home/jenkins/.buildout/eggs/cp310/robotframework-3.1.2-py3.10.egg/robot/utils/robottypes3.py", line 16, in <module>
    from collections import Mapping, UserString

this Mapping seems to no longer be valid on python 3.10 :man_shrugging:t4: not sure if robotframework has a newer version... well actually quite a few, from 3.1.2 we could jump to 4.1.3 :sweat_smile: I see that the minimum version should be 4.1.2 otherwise they not claim support for Python 3.10

If someone wants to try that, you have this jenkins job for it: plone-6.0-python-3.10 [Jenkins]

Now that we can at least run jenkins jobs on 3.10 we can add the PR jobs as well, so we don't keep merging things on master just for testing :grinning_face_with_smiling_eyes:

Anyway, happy hacking!

2 Likes

It is deprecated from Python 3.3, so we can change to from collections.abc import Mapping without any problem because we support from python 3.7 and we have no python 2 support.

Python 3.5.3 (default, Nov  4 2021, 15:29:10) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections.abc import Mapping
>>> from collections import Mapping
>>>
Python 3.7.3 (default, Jan 22 2021, 20:04:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Mapping
__main__:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
Python 3.9.9 (main, Dec  6 2021, 10:03:49) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from collections import Mapping
<stdin>:1: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working

Being able to test on 3.10 is good news. Thank you Gil!

I half remember that I tried a newer robotframework version one or two years ago and ran into too many problems, probably indicating that some test setup in Plone needs to change. But I don't remember details.

Anyway, it is probably better to wait with tackling a robotframework upgrade until after the Plone Classic ES6 stuff is approved and merged, because lots of robot tests needed fixes for that. But if someone wants to have an initial try, that would be fine, also on Python 3.7-3.9.

And yes, the collections versus collections.abc import fix may need to be done in various packages, also outside of robotframework. For starters, Plone 6 on Py 3.10 cannot start currently because pyScss has this wrong import, and development on this package has stalled for a long time. But with ES6, the package is no longer used, so that helps. When I temporarily worked around this bug a few weeks ago, I think I got Plone to start and could create a Plone Site. So the basis should be okay.

1 Like