plone / Products.CMFPlone

The core of the Plone content management system
https://plone.org
GNU General Public License v2.0
255 stars 191 forks source link

CMFPlone is not initialised when using editable pip install #4002

Closed mauritsvanrees closed 2 months ago

mauritsvanrees commented 2 months ago

You can try this out with https://github.com/plone/buildout.coredev/pull/945. Checkout the branch of that PR, run make install and make zope-start and try to create a Plone instance. This will fail with KeyError: 'Unicode Whitespace splitter' because the initialize function is not called.

So what is going on?

So we should add five:registerPackage to the configure.zcml of Products.CMFPlone. Then it works. I will do that in 6.0 and 6.1.

mauritsvanrees commented 2 months ago

And if, like me, you are wondering how this actually works with Buildout, this is the pretty print of Products.__path__ in that case (Plone 6.1):

['/Users/maurits/community/plone-coredev/6.1/src/Products.CMFPlone/Products',
 '/Users/maurits/shared-eggs/cp312/Products.isurlinportal-3.0.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.PortalTransforms-4.1.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Zope-5.10-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.CMFPlacefulWorkflow-3.0.4-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.statusmessages-5.0.6-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.SiteErrorLog-6.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.PlonePAS-8.0.4-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.MimetypesRegistry-3.0.1-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.ExtendedPathIndex-4.0.1-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.DCWorkflow-3.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.CMFEditions-4.0.3-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.GenericSetup-3.0.2-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.CMFCore-3.5-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.ZCatalog-7.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.CMFDynamicViewFTI-7.0.2-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.PluggableAuthService-3.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.BTreeFolder2-5.1-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.PythonScripts-5.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.ExternalMethod-5.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.ZopeVersionControl-4.1-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.CMFUid-4.2-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.CMFDiffTool-4.0.4-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.MailHost-5.2-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.StandardCacheManagers-5.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.DateRecurringIndex-3.0.1-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.Sessions-5.0-py3.12.egg/Products',
 '/Users/maurits/shared-eggs/cp312/Products.PluginRegistry-2.0-py3.12.egg/Products']

So there the Products path is not one directory, but multiple.

Meanwhile I have PRs ready for Plone 6.0 and 6.1.

thet commented 2 months ago

Super explanation on the Products initialization phase!