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:

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

[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:

[buildout]
extends = https://dist.plone.org/release/6.0.7/versions.cfg
parts =
    instance
    test

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

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

[test]
recipe = zc.recipe.testrunner
eggs =
    Plone
    Products.CMFPlone[test]

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

[versions]
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
5 Likes

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:

4 Likes