Experiment: Plone 6.0.7 on Python 3.12.0

Just gave yesterdays final release of Python 3.12 a try.

NOTE: I just share my experience here and there's no warranty that it works for your configuration. Do not use this in productive environments unless you know what your're doing as there's no official Zope/Plone release supporting Python 3.12 yet.

Install Python 3.12 on Apple M1 with MacOS Sonoma 14.0 using pyenv (homebrew):

    $ brew upgrade pyenv
    $ pyenv install 3.12.0
    $ pyenv virtualenv 3.12.0 py-3.12-experimental # optional

If you have the following error:

ginstall: cannot stat 'Modules/_ssl.cpython-312-darwin.so': No such file or directory

see 3.12 fails to build on M1 macbook - Modules/_ssl.cpython-312-darwin.so': No such file or directory · Issue #2805 · pyenv/pyenv · GitHub

Install Plone (Classic-UI) with Buildout

Make sure you use the pyenv version above in your project folder with

    $ cd <project_folder>
    $ pyenv local 3.12.0 # or py-3.12-experimental if created above
    $ pip install -r https://dist.plone.org/release/6.0.7/requirements.txt

Create minimal buildout.cfg:

extends = https://dist.plone.org/release/6.0.7/versions.cfg
parts = instance

recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
eggs = Plone

install and run instance:

    $ buildout
    $ bin/instance fg

and if you go to http://localhost:8080/ in your browser you should see the Plone welcome screen.

Update for tests

Adding a [test] part to the buildout configuration needs some version pins and a source checkout of robotframework-browser (Because of the grpcio-tools version pin). See updated minimal buildout.cfg below:

extends = https://dist.plone.org/release/6.0.7/versions.cfg
parts =

# needed for tests
extensions =
sources = sources
sources-dir = src
auto-checkout = robotframework-browser

recipe = plone.recipe.zope2instance
user = admin:admin
http-address = 8080
eggs = Plone

recipe = zc.recipe.testrunner
eggs =

robotframework-browser = git https://github.com/MarketSquare/robotframework-browser.git branch=main

grpcio-tools = 1.59.0
robotframework-assertion-engine = 2.0.0
# robotframework-browser = 17.5.1 -> need checkout
robotframework-pythonlibcore = 4.2.0
click = 8.1.7

Now you can run

    $ bin/test -s Products.CMFPlone

Great, I started working on the same and created a PR: Add support for Python 3.12 by pbauer · Pull Request #890 · plone/buildout.coredev · GitHub

The only python-tests failing locally are in plone.restapi because of the removed assertDictContainsSubset

1 Like

Cool ... so a plone-6.1-py-3.12 Jenkins job would be nice too ... @gforcada ?

Jobs are there and PRs for plone.api and plone.restapi as well :+1: