plone / plone.app.contenttypes

Dexterity-based content types for Plone
https://pypi.org/project/plone.app.contenttypes
14 stars 48 forks source link

Upgrades and migration: fix dependencies to Archetypes #99

Closed thet closed 10 years ago

thet commented 10 years ago

the upgrades and migration modules in plone.app.contenttypes depend on Archetype based imports. There is a zcml condition, which checks the availability of Archetypes for the migration subpackage, but that is logically wrong since Arnhem sprint, where we also provide dexterity migrations in this subpackage: https://github.com/plone/plone.app.contenttypes/blob/3fc9addfc309e1245c0a91481620576a49ff86bb/plone/app/contenttypes/configure.zcml#L45 The upgrades module imports from the migration subpackage and therefore depends on Archetypes: https://github.com/plone/plone.app.contenttypes/blob/3fc9addfc309e1245c0a91481620576a49ff86bb/plone/app/contenttypes/upgrades.py#L2

plone.app.contenttypes should not break, if Archetypes is not available.

bosim commented 10 years ago

Traceback:

bash-3.2$ bin/instance fg
bin/instance fg
2014-02-12 10:13:45 INFO ZServer HTTP server started at Wed Feb 12 10:13:45 2014
    Hostname: 0.0.0.0
    Port: 8080
2014-02-12 10:13:47 WARNING ZODB.blob (86767) Blob dir /Users/bo/Clients/plone5/var/blobstorage/ has insecure mode setting
Traceback (most recent call last):
  File "/Users/bo/Clients/plone5/plips/../parts/instance/bin/interpreter", line 269, in <module>
    exec(compile(__file__f.read(), __file__, "exec"))
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
    run()
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/Zope2/Startup/run.py", line 22, in run
    starter.prepare()
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/Zope2/Startup/__init__.py", line 86, in prepare
    self.startZope()
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/Zope2/Startup/__init__.py", line 262, in startZope
    Zope2.startup()
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/Zope2/__init__.py", line 47, in startup
    _startup()
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/Zope2/App/startup.py", line 118, in startup
    load_zcml()
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/Zope2/App/startup.py", line 52, in load_zcml
    load_site()
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/Zope2/App/zcml.py", line 46, in load_site
    _context = xmlconfig.file(site_zcml)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 649, in file
    include(context, name, package)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/Users/bo/.buildout/eggs/Zope2-2.13.21-py2.7.egg/OFS/metaconfigure.py", line 46, in loadProducts
    xmlconfig.include(_context, zcml, package=product)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 706, in finish
    actions = self.handler(context, **args)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 548, in include
    processxmlfile(f, context)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 380, in processxmlfile
    parser.parse(src)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 210, in feed
    self._parser.Parse(data, isFinal)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/sax/expatreader.py", line 352, in end_element_ns
    self._cont_handler.endElementNS(pair, None)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/xmlconfig.py", line 359, in endElementNS
    self.context.end()
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 558, in end
    self.stack.pop().finish()
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 705, in finish
    args = toargs(context, *self.argdata)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 1397, in toargs
    args[str(name)] = field.fromUnicode(s)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/fields.py", line 137, in fromUnicode
    value = self.context.resolve(name)
  File "/Users/bo/.buildout/eggs/zope.configuration-3.7.4-py2.7.egg/zope/configuration/config.py", line 179, in resolve
    mod = __import__(mname, *_import_chickens)
  File "/Users/bo/Clients/plone5/src/plone.app.contenttypes/plone/app/contenttypes/upgrades.py", line 2, in <module>
    from plone.app.contenttypes.migration.dxmigration import DXOldEventMigrator
  File "/Users/bo/Clients/plone5/src/plone.app.contenttypes/plone/app/contenttypes/migration/dxmigration.py", line 3, in <module>
    from Products.contentmigration.basemigrator.migrator import CMFItemMigrator
  File "/Users/bo/.buildout/eggs/Products.contentmigration-2.1.6-py2.7.egg/Products/contentmigration/basemigrator/migrator.py", line 45, in <module>
    from Products.Archetypes.interfaces import IReferenceable
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File "/Users/bo/Clients/plone5/parts/instance/etc/site.zcml", line 16.2-16.23
    ZopeXMLConfigurationError: File "/Users/bo/Clients/plone5/src/Products.CMFPlone/Products/CMFPlone/configure.zcml", line 15.2-15.46
    ZopeXMLConfigurationError: File "/Users/bo/Clients/plone5/src/plone.app.contenttypes/plone/app/contenttypes/configure.zcml", line 43.2-43.34
    ZopeXMLConfigurationError: File "/Users/bo/Clients/plone5/src/plone.app.contenttypes/plone/app/contenttypes/upgrades.zcml", line 5.2-12.8
    ImportError: No module named Archetypes.interfaces