diff --git a/CHANGES.rst b/CHANGES.rst index 42f1217..f28d97d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,7 +1,7 @@ Changelog ========= -3.2.4 (unreleased) +3.3.0 (unreleased) ------------------ Breaking changes: @@ -10,7 +10,9 @@ Breaking changes: New features: -- *add item here* +- Do not depend on Products.Archetypes anymore. + If Archetypes is present it still registers the adapters. + [jensens] Bug fixes: diff --git a/plone/app/iterate/at.zcml b/plone/app/iterate/at.zcml new file mode 100644 index 0000000..e6b938f --- /dev/null +++ b/plone/app/iterate/at.zcml @@ -0,0 +1,15 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/plone/app/iterate/configure.zcml b/plone/app/iterate/configure.zcml index 5b5f395..7d15fdc 100644 --- a/plone/app/iterate/configure.zcml +++ b/plone/app/iterate/configure.zcml @@ -65,15 +65,7 @@ factory=".profiles.HiddenProfiles" /> - - - - - - - - + diff --git a/plone/app/iterate/copier.py b/plone/app/iterate/copier.py index 70e0fa3..ef6dc0b 100644 --- a/plone/app/iterate/copier.py +++ b/plone/app/iterate/copier.py @@ -22,7 +22,7 @@ ################################################################## """ -$Id: copier.py 1824 2007-02-08 17:59:41Z hazmat $ +Archtypes specific copier, dexterity folder has its own! """ from Acquisition import aq_base diff --git a/plone/app/iterate/dexterity/copier.py b/plone/app/iterate/dexterity/copier.py index 7e6c82b..19bec8a 100644 --- a/plone/app/iterate/dexterity/copier.py +++ b/plone/app/iterate/dexterity/copier.py @@ -16,15 +16,10 @@ from zope.annotation.interfaces import IAnnotations from zope.event import notify from zope.interface import implementer +from zope.intid.interfaces import IIntIds from zope.schema import getFieldsInOrder -try: - from zope.intid.interfaces import IIntIds -except ImportError: - from zope.app.intid.interfaces import IIntIds - - @implementer(interfaces.IObjectCopier) class ContentCopier(copier.ContentCopier): diff --git a/plone/app/iterate/dexterity/relation.py b/plone/app/iterate/dexterity/relation.py index fa3b054..8c2eca1 100644 --- a/plone/app/iterate/dexterity/relation.py +++ b/plone/app/iterate/dexterity/relation.py @@ -5,12 +5,7 @@ from zope.annotation.interfaces import IAttributeAnnotatable from zope.component import getUtility from zope.interface import implementer - - -try: - from zope.intid.interfaces import IIntIds -except ImportError: - from zope.app.intid.interfaces import IIntIds +from zope.intid.interfaces import IIntIds @implementer(IStagingRelationValue, IAttributeAnnotatable) diff --git a/plone/app/iterate/dexterity/utils.py b/plone/app/iterate/dexterity/utils.py index ad7bada..2ec7357 100644 --- a/plone/app/iterate/dexterity/utils.py +++ b/plone/app/iterate/dexterity/utils.py @@ -4,12 +4,7 @@ from plone.app.iterate.dexterity import ITERATE_RELATION_NAME from zc.relation.interfaces import ICatalog from zope import component - - -try: - from zope.intid.interfaces import IIntIds -except ImportError: - from zope.app.intid.interfaces import IIntIds +from zope.intid.interfaces import IIntIds def get_relations(context): diff --git a/plone/app/iterate/interfaces.py b/plone/app/iterate/interfaces.py index 1656454..3262538 100644 --- a/plone/app/iterate/interfaces.py +++ b/plone/app/iterate/interfaces.py @@ -27,12 +27,23 @@ from plone.app.iterate import PloneMessageFactory as _ from plone.locking.interfaces import LockType from plone.locking.interfaces import MAX_TIMEOUT -from Products.Archetypes.interfaces import IReference from zope import schema from zope.component.interfaces import IObjectEvent from zope.interface import Attribute from zope.interface import Interface +import pkg_resources + + +try: + pkg_resources.get_distribution('Products.Archetypes') +except pkg_resources.DistributionNotFound: + + class IReference(Interface): + pass +else: + from Products.Archetypes.interfaces import IReference + ################################ # Marker interface diff --git a/plone/app/iterate/policy.py b/plone/app/iterate/policy.py index f7109f0..fc34ebd 100644 --- a/plone/app/iterate/policy.py +++ b/plone/app/iterate/policy.py @@ -21,7 +21,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ################################################################## """ -A Default Checkin Checkout Policy For Content +Archetypes Checkin Checkout Policy For Content """ diff --git a/plone/app/iterate/relation.py b/plone/app/iterate/relation.py index bc96439..bcfa0b1 100644 --- a/plone/app/iterate/relation.py +++ b/plone/app/iterate/relation.py @@ -21,7 +21,7 @@ # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ################################################################## """ -$Id: relation.py 1392 2006-06-20 01:02:17Z hazmat $ +Archetypes speicifc implementation for relation handling """ from interfaces import ICheckinCheckoutReference diff --git a/plone/app/iterate/testing.py b/plone/app/iterate/testing.py index cd0484b..0cefdbf 100644 --- a/plone/app/iterate/testing.py +++ b/plone/app/iterate/testing.py @@ -8,6 +8,16 @@ from plone.app.testing.layers import IntegrationTesting from plone.testing import z2 +import pkg_resources + + +try: + pkg_resources.get_distribution('Products.Archtypes') +except pkg_resources.DistributionNotFound: + HAS_AT = False +else: + HAS_AT = True + ADMIN = { 'id': 'admin', @@ -42,14 +52,15 @@ class PloneAppIterateLayer(PloneSandboxLayer): def setUpZope(self, app, configurationContext): """Setup Zope with Addons.""" - import Products.ATContentTypes - self.loadZCML(package=Products.ATContentTypes) - z2.installProduct(app, 'Products.ATContentTypes') + if HAS_AT: + import Products.ATContentTypes + self.loadZCML(package=Products.ATContentTypes) + z2.installProduct(app, 'Products.ATContentTypes') - z2.installProduct(app, 'Products.Archetypes') - z2.installProduct(app, 'Products.ATContentTypes') - z2.installProduct(app, 'plone.app.blob') - z2.installProduct(app, 'plone.app.collection') + z2.installProduct(app, 'Products.Archetypes') + z2.installProduct(app, 'Products.ATContentTypes') + z2.installProduct(app, 'plone.app.blob') + z2.installProduct(app, 'plone.app.collection') import plone.app.iterate self.loadZCML(package=plone.app.iterate) @@ -59,8 +70,9 @@ def setUpPloneSite(self, portal): # restore default workflow applyProfile(portal, 'Products.CMFPlone:testfixture') - # add default content - applyProfile(portal, 'Products.ATContentTypes:content') + if HAS_AT: + # add default content + applyProfile(portal, 'Products.ATContentTypes:content') applyProfile(portal, 'plone.app.iterate:default') applyProfile(portal, 'plone.app.iterate:test') diff --git a/setup.py b/setup.py index fc8f810..7b27d68 100644 --- a/setup.py +++ b/setup.py @@ -57,13 +57,16 @@ 'zope.lifecycleevent', 'zope.schema', 'zope.viewlet', - 'Zope2', ], extras_require={ + 'archetypes': [ + 'Products.Archetypes', + ], 'test': [ 'plone.app.testing', 'plone.app.contenttypes', - 'plone.app.robotframework' + 'plone.app.robotframework', + 'Products.Archetypes', ] }, entry_points="""