Package: zope.component
zope.componentNoteThis package is intended to be independently reusable in any Python
project. It is maintained by theZope Toolkit project.This package represents the core of the Zope Component Architecture.
Together with thezope.interfacepackage, it provides facilities for
defining, registering and looking up components.Please seehttps://zopecomponent.readthedocs.io/en/latest/for the
documentation.Changes6.0 (2023-04-14)Drop support for Python 2.7, 3.5, 3.6.5.1.0 (2023-01-03)Fix crash when the environment variablePYTHONOPTIMIZEDis set to2and docstrings are set toNoneby the interpreter.
(#67)Add support for Python 3.10 and 3.11.5.0.1 (2021-07-09)Fix unregistering utilities on old persistent adapter registries.
Previously this could raiseTypeError. Seeissue 62.5.0.0 (2021-03-19)Remove backwards compatibility imports that were emitting
deprecation warnings. This affects certain imports fromzope.component.interfaces(which should be imported fromzope.interface.interfaces) as well as certain imports fromzope.component.registery(import fromzope.interface.registry), and the entirezope.component.hookablemodule. Seeissue 59.Respect permission value for utility factory registrations
(#54)Add support for Python 3.9Fix the<subscriber>ZCML directive to allow a missingprovides=attribute when afactory=is given and the Python
object has been decorated with@implementerand implements a
single interface. This has been documented, but hasn’t worked
before. Seeissue 9.MakePersistentAdapterRegistryuse persistent objects
(PersistentMappingandPersistentList) for its internal data
structures instead of plain dicts and lists. This helps make it
scalable to larger registry sizes.This requires zope.interface 5.3.0a1 or later.New registries (and their primary users,PersistentComponentsand
zope.site’sLocalSiteManager) take full advantage of this
automatically. For existing persistent registries to take advantage
of this, you must call theirrebuild()method and commit the
transaction.Seeissue 51.Fixzope.interface.interface.provideInterfaceand the various
search and query methods to use the current site manager instead of
always using the global site manager. (provideInterfaceis
called implicitly when registering components from ZCML.) The search
and query methods continue to return interfaces registered in base
site managers.Seeissue 10.4.6.2 (2020-07-03)Improve the documentation, both published and in docstrings. SeePR
49.4.6.1 (2020-03-23)Ensure the resolution order ofBaseGlobalComponentsis
consistent. Seeissue 45.4.6.0 (2019-11-12)Add support for Python 3.8.Drop support for Python 3.4.Fix tests on Python 2 following changes in ZODB 5.5.0.4.5.0 (2018-10-10)Add support for Python 3.7.Always installzope.hookableas a dependency (thehookextra is now empty).zope.hookablerespects the PURE_PYTHON
environment variable, and has an optional C extension.Make accessing names that have been moved tozope.interfaceproduce aDeprecationWarning.4.4.1 (2017-09-26)Remove obsolete call ofsearchInterfacefrominterfaceToName. Seehttps://github.com/zopefoundation/zope.component/issues/324.4.0 (2017-07-25)Add support for Python 3.6.Drop support for Python 3.3.Drop support for “setup.py test”.Code coverage reports are nowproduced and hosted by coveralls.io, and
PRs must keep them at 100%.Internal test code inzope.component.testfileshas been adjusted
and in some cases removed.4.3.0 (2016-08-26)When testingPURE_PYTHONenvironments undertox, avoid poisoning
the user’s global wheel cache.Drop support for Python 2.6 and 3.2.Add support for Python 3.5.4.2.2 (2015-06-04)Fix test cases for PyPy and PyPy3.4.2.1 (2014-03-19)Add support for Python 3.4.4.2.0 (2014-02-05)Updateboostrap.pyto version 2.2.Reset the cachedadapter_hooksatzope.testing.cleanup.cleanUptime (LP1100501).Implement ability to specify adapter and utility names in Python. Use
the@zope.component.named(name)decorator to specify the name.4.1.0 (2013-02-28)Change “ZODB3” depdendency to “persistent”.toxnow runs all tests for Python 3.2 and 3.3.Enable buildout for Python 3.Fix new failing tests.4.0.2 (2012-12-31)Flesh out PyPI Trove classifiers.4.0.1 (2012-11-21)Add support for Python 3.3.4.0.0 (2012-07-02)Add PyPy and Python 3.2 support:Security support omitted untilzope.securityported.Persistent registry support omitted untilZODBported (orpersistentfactored out).Bring unit test coverage to 100%.Remove the long-deprecatedlayerargument to thezope.component.zcml.viewandzope.component.zcml.resourceZCML directives.Add support for continuous integration usingtoxandjenkins.Got tests to run usingsetup.py test.AddSphinxdocumentation.Addsetup.py docsalias (installsSphinxand dependencies).Addsetup.py devalias (runssetup.py developplus installsnoseandcoverage).3.12.1 (2012-04-02)Wrapwith site(foo)in try/finally (LP768151).3.12.0 (2011-11-16)Add convenience function zope.component.hooks.site (a contextmanager),
so one can writewith site(foo): ....3.11.0 (2011-09-22)Move code fromzope.component.registrywhich implements a basic
nonperistent component registry tozope.interface.registry.  This code
was moved fromzope.componentintozope.interfaceto make porting
systems (such as Pyramid) that rely only on a basic component registry to
Python 3 possible without needing to port the entirety of thezope.componentpackage.  Backwards compatibility import shims have been
left behind inzope.component, so this change will not break any
existing code.Move interfaces fromzope.component.interfacestozope.interface.interfaces:ComponentLookupError,Invalid,IObjectEvent,ObjectEvent,IComponentLookup,IRegistration,IUtilityRegistration,IAdapterRegistration,ISubscriptionAdapterRegistration,IHandlerRegistration,IRegistrationEvent,RegistrationEvent,IRegistered,Registered,IUnregistered,Unregistered,IComponentRegistry, andIComponents.  Backwards compatibility shims
left in place.Depend onzope.interface>= 3.8.0.3.10.0 (2010-09-25)Remove thedocsextra and thesphinxdocrecipe.Create asecurityextra to move security-related dependencies out of thetestextra.Use the newzope.testrunnerpackage for tests.Add a basic test for theconfigure.zcmlfile provided.3.9.5 (2010-07-09)Fix test requirements specification.3.9.4 (2010-04-30)Prefer the standard librarydoctestto the one fromzope.testing.3.9.3 (2010-03-08)The ZCML directives provided byzope.componentnow register the
components in the registry returned bygetSiteManagerinstead of the
global registry. This change allows the hooking of thegetSiteManagermethod before the load of a ZCML file to register the components in a
custom registry.3.9.2 (2010-01-22)Fix a bug introduced by recent refactoring, where passingCheckerPublictosecurityAdapterFactorywrongly wrapped the factory
into aLocatingUntrustedAdapterFactory.3.9.1 (2010-01-21)Modify the tests to avoid allowing the tested testrunner to be influenced
by options of the outer testrunner, such a the-voption.3.9.0 (2010-01-21)Add testlayer support. It is now possible to load a ZCML file within
tests more easily. Seesrc/zope/component/testlayer.pyandsrc/zope/component/testlayer.txt.3.8.0 (2009-11-16)Remove the dependencies onzope.proxyandzope.securityfrom the
zcml extra:zope.componentno longer has a hard dependency on them;
the support for security proxied components ZCML registrations is enabled
only ifzope.securityandzope.proxyare available.Move theIPossibleSiteandISiteinterfaces here fromzope.locationas they are dealing withzope.component’s concept of
a site, but not with location.Move thezope.site.hooksfunctionality tozope.component.hooksas it
isn’t actually dealing withzope.site’s concept of a site.3.7.1 (2009-07-24)Fix a problem, wherequeryNextUtilitycould fail if the context could
not be adapted to aIComponentLookup.Fix 2 related bugs:When a utility is registered and there was previously a utility
registered for the same interface and name, then the old utility is
unregistered.  The 2 bugs related to this:There was noUnregisteredfor the implicit unregistration. Now
there is.The old utility was still held and returned bygetAllUtilitiesRegisteredFor.  In other words, it was still
considered registered, eeven though it wasn’t.  A particularly
negative consequence of this is that the utility is held in memory
or in the database even though it isn’t used.3.7.0 (2009-05-21)Ensure thatHookableTestsare run by the testrunner.Addzope:viewandzope:resourceimplementations intozope.component.zcml(dependency loaded withzope.component [zcml]).3.6.0 (2009-03-12)IMPORTANT: the interfaces that were defined in thezope.component.bbb.interfacesand deprecated for years are
now (re)moved. However, some packages, including part of zope
framework were still using those interfaces. They will be adapted
for this change. If you were using some of those interfaces, you
need to adapt your code as well:MoveIViewandIDefaultViewNametozope.publisher.interfaces.MoveIResourcetozope.app.publisher.interfaces.RemoveIContextDependent,IPresentation,IPresentationRequest,IResourceFactory, andIViewFactorycompletely.If you usedIViewFactoryin context ofzope.app.form, there’s nowIWidgetFactoryin thezope.app.form.interfacesinstead.MovegetNextUtility/queryNextUtilityfunctions here fromzope.site(they were inzope.app.componenteven earlier).Add a pure-Pythonhookableimplementation, for use whenzope.hookableis not present.Remove use ofzope.deferredimportby breaking import cycles.Cleanup package documentation and changelog a bit. Add sphinx-based
documentation building command to the buildout.Remove deprecated code.Change package’s mailing list address to zope-dev at zope.org, because
zope3-dev at zope.org is now retired.3.5.1 (2008-07-25)Fix bug introduced in 3.5.0:<utilityfactory="...">no longer supported
interfaces declared in Python and always wanted an explicitprovides="..."attribute.https://bugs.launchpad.net/zope3/+bug/2518653.5.0 (2008-07-25)Support registration of utilities via factories through the component
registry and return factory information in the registration information.
Fixeshttps://bugs.launchpad.net/zope3/+bug/240631Optimizeun/registerUtilityby storing an optimized data structure for
efficient retrieval of already registered utilities. This avoids looping over
all utilities when registering a new one.3.4.0 (2007-09-29)No further changes since 3.4.0a1.3.4.0a1 (2007-04-22)Corresponds tozope.componentfrom Zope 3.4.0a1.In the Zope 3.3.x series,zope.componentwas simplified yet once
more.  Seehttp://wiki.zope.org/zope3/LocalComponentManagementSimplificationfor the proposal describing the changes.3.2.0.2 (2006-04-15)Fix packaging bug:package_dirmust be arelativepath.3.2.0.1 (2006-04-14)Packaging change: suppress inclusion ofsetup.cfginsdistbuilds.3.2.0 (2006-01-05)Corresponds to the verison of thezope.componentpackage shipped as part
of the Zope 3.2.0 release.Deprecated services and related APIs. The adapter and utility registries
are now available directly via the site manager’s ‘adapters’ and ‘utilities’
attributes, respectively.  Services are accessible, but deprecated, and
will be removed in Zope 3.3.Deprecated all presentation-related APIs, including all view-related
API functions. Use the adapter API functions instead.
Seehttp://dev.zope.org/Zope3/ImplementViewsAsAdapters`Deprecatedcontextdependentpackage:  site managers are now looked up
via a thread global, set during URL traversal.  Thecontextargument
is now always optional, and should no longer be passed.3.0.0 (2004-11-07)Corresponds to the verison of thezope.componentpackage shipped as part of
the Zope X3.0.0 release.