Migrate of erp5_base-related source files to ZODB Components
@nexedi This is about migrating 65 files (Documents, Interfaces, Mixins, Unit Tests and Tools) from filesystem to ZODB Components. The reason I have created this MR is to discuss the following important points:
Import statements will have to be changed in projects. For example:
Products.ERP5.Document.Personwill have to be changed to
erp5.component.document.Personand modules doing such import at top-level will have to be migrated to ZODB Components too.
This is necessary because import of Products modules and their registrations are done at a very early stage when starting Zope (even before
erp5.componentmodule is created). I currently don't see a way to do otherwise but any idea is welcome (I can provide a shell script to update imports so I don't think it's such a big problem though).
Filesystem Interfaces are registered in
Products.ERP5Type.interfaces. To have the same mechanism with ZODB Components, this would require loading all Interfaces at startup/reset which is obviously not a good idea. This means that the following common pattern:
from Products.ERP5Type import interfaces class Foo: zope.interface.implements(interfaces.IFoo,)will have to be changed to (and for the same reason as above, this module will have to be migrated to ZODB Component):
from erp5.component.interface.IFoo import IFoo class Foo: zope.interface.implements(IFoo,)