METADATA 41 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129
  1. Metadata-Version: 2.1
  2. Name: zope.interface
  3. Version: 6.2
  4. Summary: Interfaces for Python
  5. Home-page: https://github.com/zopefoundation/zope.interface
  6. Author: Zope Foundation and Contributors
  7. Author-email: zope-dev@zope.org
  8. License: ZPL 2.1
  9. Keywords: interface,components,plugins
  10. Classifier: Development Status :: 5 - Production/Stable
  11. Classifier: Intended Audience :: Developers
  12. Classifier: License :: OSI Approved :: Zope Public License
  13. Classifier: Operating System :: OS Independent
  14. Classifier: Programming Language :: Python
  15. Classifier: Programming Language :: Python :: 3
  16. Classifier: Programming Language :: Python :: 3.7
  17. Classifier: Programming Language :: Python :: 3.8
  18. Classifier: Programming Language :: Python :: 3.9
  19. Classifier: Programming Language :: Python :: 3.10
  20. Classifier: Programming Language :: Python :: 3.11
  21. Classifier: Programming Language :: Python :: 3.12
  22. Classifier: Programming Language :: Python :: Implementation :: CPython
  23. Classifier: Programming Language :: Python :: Implementation :: PyPy
  24. Classifier: Framework :: Zope :: 3
  25. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  26. Requires-Python: >=3.7
  27. License-File: LICENSE.txt
  28. Requires-Dist: setuptools
  29. Provides-Extra: docs
  30. Requires-Dist: Sphinx ; extra == 'docs'
  31. Requires-Dist: repoze.sphinx.autointerface ; extra == 'docs'
  32. Requires-Dist: sphinx-rtd-theme ; extra == 'docs'
  33. Provides-Extra: test
  34. Requires-Dist: coverage >=5.0.3 ; extra == 'test'
  35. Requires-Dist: zope.event ; extra == 'test'
  36. Requires-Dist: zope.testing ; extra == 'test'
  37. Provides-Extra: testing
  38. Requires-Dist: coverage >=5.0.3 ; extra == 'testing'
  39. Requires-Dist: zope.event ; extra == 'testing'
  40. Requires-Dist: zope.testing ; extra == 'testing'
  41. ====================
  42. ``zope.interface``
  43. ====================
  44. .. image:: https://img.shields.io/pypi/v/zope.interface.svg
  45. :target: https://pypi.python.org/pypi/zope.interface/
  46. :alt: Latest Version
  47. .. image:: https://img.shields.io/pypi/pyversions/zope.interface.svg
  48. :target: https://pypi.org/project/zope.interface/
  49. :alt: Supported Python versions
  50. .. image:: https://github.com/zopefoundation/zope.interface/actions/workflows/tests.yml/badge.svg
  51. :target: https://github.com/zopefoundation/zope.interface/actions/workflows/tests.yml
  52. .. image:: https://readthedocs.org/projects/zopeinterface/badge/?version=latest
  53. :target: https://zopeinterface.readthedocs.io/en/latest/
  54. :alt: Documentation Status
  55. This package is intended to be independently reusable in any Python
  56. project. It is maintained by the `Zope Toolkit project
  57. <https://zopetoolkit.readthedocs.io/>`_.
  58. This package provides an implementation of "object interfaces" for Python.
  59. Interfaces are a mechanism for labeling objects as conforming to a given
  60. API or contract. So, this package can be considered as implementation of
  61. the `Design By Contract`_ methodology support in Python.
  62. .. _Design By Contract: http://en.wikipedia.org/wiki/Design_by_contract
  63. For detailed documentation, please see https://zopeinterface.readthedocs.io/en/latest/
  64. =========
  65. Changes
  66. =========
  67. 6.2 (2024-02-16)
  68. ================
  69. - Add preliminary support for Python 3.13 as of 3.13a3.
  70. - Add support to use the pipe (``|``) syntax for ``typing.Union``.
  71. (`#280 <https://github.com/zopefoundation/zope.interface/issues/280>`_)
  72. 6.1 (2023-10-05)
  73. ================
  74. - Build Linux binary wheels for Python 3.12.
  75. - Add support for Python 3.12.
  76. - Fix building of the docs for non-final versions.
  77. 6.0 (2023-03-17)
  78. ================
  79. - Build Linux binary wheels for Python 3.11.
  80. - Drop support for Python 2.7, 3.5, 3.6.
  81. - Fix test deprecation warning on Python 3.11.
  82. - Add preliminary support for Python 3.12 as of 3.12a5.
  83. - Drop:
  84. + `zope.interface.implements`
  85. + `zope.interface.implementsOnly`
  86. + `zope.interface.classProvides`
  87. 5.5.2 (2022-11-17)
  88. ==================
  89. - Add support for building arm64 wheels on macOS.
  90. 5.5.1 (2022-11-03)
  91. ==================
  92. - Add support for final Python 3.11 release.
  93. 5.5.0 (2022-10-10)
  94. ==================
  95. - Add support for Python 3.10 and 3.11 (as of 3.11.0rc2).
  96. - Add missing Trove classifier showing support for Python 3.9.
  97. - Add some more entries to ``zope.interface.interfaces.__all__``.
  98. - Disable unsafe math optimizations in C code. See `pull request 262
  99. <https://github.com/zopefoundation/zope.interface/pull/262>`_.
  100. 5.4.0 (2021-04-15)
  101. ==================
  102. - Make the C implementation of the ``__providedBy__`` descriptor stop
  103. ignoring all errors raised when accessing the instance's
  104. ``__provides__``. Now it behaves like the Python version and only
  105. catches ``AttributeError``. The previous behaviour could lead to
  106. crashing the interpreter in cases of recursion and errors. See
  107. `issue 239 <https://github.com/zopefoundation/zope.interface/issues>`_.
  108. - Update the ``repr()`` and ``str()`` of various objects to be shorter
  109. and more informative. In many cases, the ``repr()`` is now something
  110. that can be evaluated to produce an equal object. For example, what
  111. was previously printed as ``<implementedBy builtins.list>`` is now
  112. shown as ``classImplements(list, IMutableSequence, IIterable)``. See
  113. `issue 236 <https://github.com/zopefoundation/zope.interface/issues/236>`_.
  114. - Make ``Declaration.__add__`` (as in ``implementedBy(Cls) +
  115. ISomething``) try harder to preserve a consistent resolution order
  116. when the two arguments share overlapping pieces of the interface
  117. inheritance hierarchy. Previously, the right hand side was always
  118. put at the end of the resolution order, which could easily produce
  119. invalid orders. See `issue 193
  120. <https://github.com/zopefoundation/zope.interface/issues/193>`_.
  121. 5.3.0 (2020-03-21)
  122. ==================
  123. - No changes from 5.3.0a1
  124. 5.3.0a1 (2021-03-18)
  125. ====================
  126. - Improve the repr of ``zope.interface.Provides`` to remove ambiguity
  127. about what is being provided. This is especially helpful diagnosing
  128. IRO issues.
  129. - Allow subclasses of ``BaseAdapterRegistry`` (including
  130. ``AdapterRegistry`` and ``VerifyingAdapterRegistry``) to have
  131. control over the data structures. This allows persistent
  132. implementations such as those based on ZODB to choose more scalable
  133. options (e.g., BTrees instead of dicts). See `issue 224
  134. <https://github.com/zopefoundation/zope.interface/issues/224>`_.
  135. - Fix a reference counting issue in ``BaseAdapterRegistry`` that could
  136. lead to references to interfaces being kept around even when all
  137. utilities/adapters/subscribers providing that interface have been
  138. removed. This is mostly an issue for persistent implementations.
  139. Note that this only corrects the issue moving forward, it does not
  140. solve any already corrupted reference counts. See `issue 227
  141. <https://github.com/zopefoundation/zope.interface/issues/227>`_.
  142. - Add the method ``BaseAdapterRegistry.rebuild()``. This can be used
  143. to fix the reference counting issue mentioned above, as well as to
  144. update the data structures when custom data types have changed.
  145. - Add the interface method ``IAdapterRegistry.subscribed()`` and
  146. implementation ``BaseAdapterRegistry.subscribed()`` for querying
  147. directly registered subscribers. See `issue 230
  148. <https://github.com/zopefoundation/zope.interface/issues/230>`_.
  149. - Add the maintenance method
  150. ``Components.rebuildUtilityRegistryFromLocalCache()``. Most users
  151. will not need this, but it can be useful if the ``Components.utilities``
  152. registry is suspected to be out of sync with the ``Components``
  153. object itself (this might happen to persistent ``Components``
  154. implementations in the face of bugs).
  155. - Fix the ``Provides`` and ``ClassProvides`` descriptors to stop
  156. allowing redundant interfaces (those already implemented by the
  157. underlying class or meta class) to produce an inconsistent
  158. resolution order. This is similar to the change in ``@implementer``
  159. in 5.1.0, and resolves inconsistent resolution orders with
  160. ``zope.proxy`` and ``zope.location``. See `issue 207
  161. <https://github.com/zopefoundation/zope.interface/issues/207>`_.
  162. 5.2.0 (2020-11-05)
  163. ==================
  164. - Add documentation section ``Persistency and Equality``
  165. (`#218 <https://github.com/zopefoundation/zope.interface/issues/218>`_).
  166. - Create arm64 wheels.
  167. - Add support for Python 3.9.
  168. 5.1.2 (2020-10-01)
  169. ==================
  170. - Make sure to call each invariant only once when validating invariants.
  171. Previously, invariants could be called multiple times because when an
  172. invariant is defined in an interface, it's found by in all interfaces
  173. inheriting from that interface. See `pull request 215
  174. <https://github.com/zopefoundation/zope.interface/pull/215/>`_.
  175. 5.1.1 (2020-09-30)
  176. ==================
  177. - Fix the method definitions of ``IAdapterRegistry.subscribe``,
  178. ``subscriptions`` and ``subscribers``. Previously, they all were
  179. defined to accept a ``name`` keyword argument, but subscribers have
  180. no names and the implementation of that interface did not accept
  181. that argument. See `issue 208
  182. <https://github.com/zopefoundation/zope.interface/issues/208>`_.
  183. - Fix a potential reference leak in the C optimizations. Previously,
  184. applications that dynamically created unique ``Specification``
  185. objects (e.g., used ``@implementer`` on dynamic classes) could
  186. notice a growth of small objects over time leading to increased
  187. garbage collection times. See `issue 216
  188. <https://github.com/zopefoundation/zope.interface/issues/216>`_.
  189. .. caution::
  190. This leak could prevent interfaces used as the bases of
  191. other interfaces from being garbage collected. Those interfaces
  192. will now be collected.
  193. One way in which this would manifest was that ``weakref.ref``
  194. objects (and things built upon them, like
  195. ``Weak[Key|Value]Dictionary``) would continue to have access to
  196. the original object even if there were no other visible
  197. references to Python and the original object *should* have been
  198. collected. This could be especially problematic for the
  199. ``WeakKeyDictionary`` when combined with dynamic or local
  200. (created in the scope of a function) interfaces, since interfaces
  201. are hashed based just on their name and module name. See the
  202. linked issue for an example of a resulting ``KeyError``.
  203. Note that such potential errors are not new, they are just once
  204. again a possibility.
  205. 5.1.0 (2020-04-08)
  206. ==================
  207. - Make ``@implementer(*iface)`` and ``classImplements(cls, *iface)``
  208. ignore redundant interfaces. If the class already implements an
  209. interface through inheritance, it is no longer redeclared
  210. specifically for *cls*. This solves many instances of inconsistent
  211. resolution orders, while still allowing the interface to be declared
  212. for readability and maintenance purposes. See `issue 199
  213. <https://github.com/zopefoundation/zope.interface/issues/199>`_.
  214. - Remove all bare ``except:`` statements. Previously, when accessing
  215. special attributes such as ``__provides__``, ``__providedBy__``,
  216. ``__class__`` and ``__conform__``, this package wrapped such access
  217. in a bare ``except:`` statement, meaning that many errors could pass
  218. silently; typically this would result in a fallback path being taken
  219. and sometimes (like with ``providedBy()``) the result would be
  220. non-sensical. This is especially true when those attributes are
  221. implemented with descriptors. Now, only ``AttributeError`` is
  222. caught. This makes errors more obvious.
  223. Obviously, this means that some exceptions will be propagated
  224. differently than before. In particular, ``RuntimeError`` raised by
  225. Acquisition in the case of circular containment will now be
  226. propagated. Previously, when adapting such a broken object, a
  227. ``TypeError`` would be the common result, but now it will be a more
  228. informative ``RuntimeError``.
  229. In addition, ZODB errors like ``POSKeyError`` could now be
  230. propagated where previously they would ignored by this package.
  231. See `issue 200 <https://github.com/zopefoundation/zope.interface/issues/200>`_.
  232. - Require that the second argument (*bases*) to ``InterfaceClass`` is
  233. a tuple. This only matters when directly using ``InterfaceClass`` to
  234. create new interfaces dynamically. Previously, an individual
  235. interface was allowed, but did not work correctly. Now it is
  236. consistent with ``type`` and requires a tuple.
  237. - Let interfaces define custom ``__adapt__`` methods. This implements
  238. the other side of the :pep:`246` adaptation protocol: objects being
  239. adapted could already implement ``__conform__`` if they know about
  240. the interface, and now interfaces can implement ``__adapt__`` if
  241. they know about particular objects. There is no performance penalty
  242. for interfaces that do not supply custom ``__adapt__`` methods.
  243. This includes the ability to add new methods, or override existing
  244. interface methods using the new ``@interfacemethod`` decorator.
  245. See `issue 3 <https://github.com/zopefoundation/zope.interface/issues/3>`_.
  246. - Make the internal singleton object returned by APIs like
  247. ``implementedBy`` and ``directlyProvidedBy`` for objects that
  248. implement or provide no interfaces more immutable. Previously an
  249. internal cache could be mutated. See `issue 204
  250. <https://github.com/zopefoundation/zope.interface/issues/204>`_.
  251. 5.0.2 (2020-03-30)
  252. ==================
  253. - Ensure that objects that implement no interfaces (such as direct
  254. subclasses of ``object``) still include ``Interface`` itself in
  255. their ``__iro___`` and ``__sro___``. This fixes adapter registry
  256. lookups for such objects when the adapter is registered for
  257. ``Interface``. See `issue 197
  258. <https://github.com/zopefoundation/zope.interface/issues/197>`_.
  259. 5.0.1 (2020-03-21)
  260. ==================
  261. - Ensure the resolution order for ``InterfaceClass`` is consistent.
  262. See `issue 192 <https://github.com/zopefoundation/zope.interface/issues/192>`_.
  263. - Ensure the resolution order for ``collections.OrderedDict`` is
  264. consistent on CPython 2. (It was already consistent on Python 3 and PyPy).
  265. - Fix the handling of the ``ZOPE_INTERFACE_STRICT_IRO`` environment
  266. variable. Previously, ``ZOPE_INTERFACE_STRICT_RO`` was read, in
  267. contrast with the documentation. See `issue 194
  268. <https://github.com/zopefoundation/zope.interface/issues/194>`_.
  269. 5.0.0 (2020-03-19)
  270. ==================
  271. - Make an internal singleton object returned by APIs like
  272. ``implementedBy`` and ``directlyProvidedBy`` immutable. Previously,
  273. it was fully mutable and allowed changing its ``__bases___``. That
  274. could potentially lead to wrong results in pathological corner
  275. cases. See `issue 158
  276. <https://github.com/zopefoundation/zope.interface/issues/158>`_.
  277. - Support the ``PURE_PYTHON`` environment variable at runtime instead
  278. of just at wheel build time. A value of 0 forces the C extensions to
  279. be used (even on PyPy) failing if they aren't present. Any other
  280. value forces the Python implementation to be used, ignoring the C
  281. extensions. See `PR 151 <https://github.com/zopefoundation/zope.interface/pull/151>`_.
  282. - Cache the result of ``__hash__`` method in ``InterfaceClass`` as a
  283. speed optimization. The method is called very often (i.e several
  284. hundred thousand times during Plone 5.2 startup). Because the hash value never
  285. changes it can be cached. This improves test performance from 0.614s
  286. down to 0.575s (1.07x faster). In a real world Plone case a reindex
  287. index came down from 402s to 320s (1.26x faster). See `PR 156
  288. <https://github.com/zopefoundation/zope.interface/pull/156>`_.
  289. - Change the C classes ``SpecificationBase`` and its subclass
  290. ``ClassProvidesBase`` to store implementation attributes in their structures
  291. instead of their instance dictionaries. This eliminates the use of
  292. an undocumented private C API function, and helps make some
  293. instances require less memory. See `PR 154 <https://github.com/zopefoundation/zope.interface/pull/154>`_.
  294. - Reduce memory usage in other ways based on observations of usage
  295. patterns in Zope (3) and Plone code bases.
  296. - Specifications with no dependents are common (more than 50%) so
  297. avoid allocating a ``WeakKeyDictionary`` unless we need it.
  298. - Likewise, tagged values are relatively rare, so don't allocate a
  299. dictionary to hold them until they are used.
  300. - Use ``__slots___`` or the C equivalent ``tp_members`` in more
  301. common places. Note that this removes the ability to set arbitrary
  302. instance variables on certain objects.
  303. See `PR 155 <https://github.com/zopefoundation/zope.interface/pull/155>`_.
  304. The changes in this release resulted in a 7% memory reduction after
  305. loading about 6,000 modules that define about 2,200 interfaces.
  306. .. caution::
  307. Details of many private attributes have changed, and external use
  308. of those private attributes may break. In particular, the
  309. lifetime and default value of ``_v_attrs`` has changed.
  310. - Remove support for hashing uninitialized interfaces. This could only
  311. be done by subclassing ``InterfaceClass``. This has generated a
  312. warning since it was first added in 2011 (3.6.5). Please call the
  313. ``InterfaceClass`` constructor or otherwise set the appropriate
  314. fields in your subclass before attempting to hash or sort it. See
  315. `issue 157 <https://github.com/zopefoundation/zope.interface/issues/157>`_.
  316. - Remove unneeded override of the ``__hash__`` method from
  317. ``zope.interface.declarations.Implements``. Watching a reindex index
  318. process in ZCatalog with on a Py-Spy after 10k samples the time for
  319. ``.adapter._lookup`` was reduced from 27.5s to 18.8s (~1.5x faster).
  320. Overall reindex index time shrunk from 369s to 293s (1.26x faster).
  321. See `PR 161
  322. <https://github.com/zopefoundation/zope.interface/pull/161>`_.
  323. - Make the Python implementation closer to the C implementation by
  324. ignoring all exceptions, not just ``AttributeError``, during (parts
  325. of) interface adaptation. See `issue 163
  326. <https://github.com/zopefoundation/zope.interface/issues/163>`_.
  327. - Micro-optimization in ``.adapter._lookup`` , ``.adapter._lookupAll``
  328. and ``.adapter._subscriptions``: By loading ``components.get`` into
  329. a local variable before entering the loop a bytcode "LOAD_FAST 0
  330. (components)" in the loop can be eliminated. In Plone, while running
  331. all tests, average speedup of the "owntime" of ``_lookup`` is ~5x.
  332. See `PR 167
  333. <https://github.com/zopefoundation/zope.interface/pull/167>`_.
  334. - Add ``__all__`` declarations to all modules. This helps tools that
  335. do auto-completion and documentation and results in less cluttered
  336. results. Wildcard ("*") are not recommended and may be affected. See
  337. `issue 153
  338. <https://github.com/zopefoundation/zope.interface/issues/153>`_.
  339. - Fix ``verifyClass`` and ``verifyObject`` for builtin types like
  340. ``dict`` that have methods taking an optional, unnamed argument with
  341. no default value like ``dict.pop``. On PyPy3, the verification is
  342. strict, but on PyPy2 (as on all versions of CPython) those methods
  343. cannot be verified and are ignored. See `issue 118
  344. <https://github.com/zopefoundation/zope.interface/issues/118>`_.
  345. - Update the common interfaces ``IEnumerableMapping``,
  346. ``IExtendedReadMapping``, ``IExtendedWriteMapping``,
  347. ``IReadSequence`` and ``IUniqueMemberWriteSequence`` to no longer
  348. require methods that were removed from Python 3 on Python 3, such as
  349. ``__setslice___``. Now, ``dict``, ``list`` and ``tuple`` properly
  350. verify as ``IFullMapping``, ``ISequence`` and ``IReadSequence,``
  351. respectively on all versions of Python.
  352. - Add human-readable ``__str___`` and ``__repr___`` to ``Attribute``
  353. and ``Method``. These contain the name of the defining interface
  354. and the attribute. For methods, it also includes the signature.
  355. - Change the error strings raised by ``verifyObject`` and
  356. ``verifyClass``. They now include more human-readable information
  357. and exclude extraneous lines and spaces. See `issue 170
  358. <https://github.com/zopefoundation/zope.interface/issues/170>`_.
  359. .. caution:: This will break consumers (such as doctests) that
  360. depended on the exact error messages.
  361. - Make ``verifyObject`` and ``verifyClass`` report all errors, if the
  362. candidate object has multiple detectable violations. Previously they
  363. reported only the first error. See `issue
  364. <https://github.com/zopefoundation/zope.interface/issues/171>`_.
  365. Like the above, this will break consumers depending on the exact
  366. output of error messages if more than one error is present.
  367. - Add ``zope.interface.common.collections``,
  368. ``zope.interface.common.numbers``, and ``zope.interface.common.io``.
  369. These modules define interfaces based on the ABCs defined in the
  370. standard library ``collections.abc``, ``numbers`` and ``io``
  371. modules, respectively. Importing these modules will make the
  372. standard library concrete classes that are registered with those
  373. ABCs declare the appropriate interface. See `issue 138
  374. <https://github.com/zopefoundation/zope.interface/issues/138>`_.
  375. - Add ``zope.interface.common.builtins``. This module defines
  376. interfaces of common builtin types, such as ``ITextString`` and
  377. ``IByteString``, ``IDict``, etc. These interfaces extend the
  378. appropriate interfaces from ``collections`` and ``numbers``, and the
  379. standard library classes implement them after importing this module.
  380. This is intended as a replacement for third-party packages like
  381. `dolmen.builtins <https://pypi.org/project/dolmen.builtins/>`_.
  382. See `issue 138 <https://github.com/zopefoundation/zope.interface/issues/138>`_.
  383. - Make ``providedBy()`` and ``implementedBy()`` respect ``super``
  384. objects. For instance, if class ``Derived`` implements ``IDerived``
  385. and extends ``Base`` which in turn implements ``IBase``, then
  386. ``providedBy(super(Derived, derived))`` will return ``[IBase]``.
  387. Previously it would have returned ``[IDerived]`` (in general, it
  388. would previously have returned whatever would have been returned
  389. without ``super``).
  390. Along with this change, adapter registries will unpack ``super``
  391. objects into their ``__self___`` before passing it to the factory.
  392. Together, this means that ``component.getAdapter(super(Derived,
  393. self), ITarget)`` is now meaningful.
  394. See `issue 11 <https://github.com/zopefoundation/zope.interface/issues/11>`_.
  395. - Fix a potential interpreter crash in the low-level adapter
  396. registry lookup functions. See issue 11.
  397. - Adopt Python's standard `C3 resolution order
  398. <https://www.python.org/download/releases/2.3/mro/>`_ to compute the
  399. ``__iro__`` and ``__sro__`` of interfaces, with tweaks to support
  400. additional cases that are common in interfaces but disallowed for
  401. Python classes. Previously, an ad-hoc ordering that made no
  402. particular guarantees was used.
  403. This has many beneficial properties, including the fact that base
  404. interface and base classes tend to appear near the end of the
  405. resolution order instead of the beginning. The resolution order in
  406. general should be more predictable and consistent.
  407. .. caution::
  408. In some cases, especially with complex interface inheritance
  409. trees or when manually providing or implementing interfaces, the
  410. resulting IRO may be quite different. This may affect adapter
  411. lookup.
  412. The C3 order enforces some constraints in order to be able to
  413. guarantee a sensible ordering. Older versions of zope.interface did
  414. not impose similar constraints, so it was possible to create
  415. interfaces and declarations that are inconsistent with the C3
  416. constraints. In that event, zope.interface will still produce a
  417. resolution order equal to the old order, but it won't be guaranteed
  418. to be fully C3 compliant. In the future, strict enforcement of C3
  419. order may be the default.
  420. A set of environment variables and module constants allows
  421. controlling several aspects of this new behaviour. It is possible to
  422. request warnings about inconsistent resolution orders encountered,
  423. and even to forbid them. Differences between the C3 resolution order
  424. and the previous order can be logged, and, in extreme cases, the
  425. previous order can still be used (this ability will be removed in
  426. the future). For details, see the documentation for
  427. ``zope.interface.ro``.
  428. - Make inherited tagged values in interfaces respect the resolution
  429. order (``__iro__``), as method and attribute lookup does. Previously
  430. tagged values could give inconsistent results. See `issue 190
  431. <https://github.com/zopefoundation/zope.interface/issues/190>`_.
  432. - Add ``getDirectTaggedValue`` (and related methods) to interfaces to
  433. allow accessing tagged values irrespective of inheritance. See
  434. `issue 190
  435. <https://github.com/zopefoundation/zope.interface/issues/190>`_.
  436. - Ensure that ``Interface`` is always the last item in the ``__iro__``
  437. and ``__sro__``. This is usually the case, but if classes that do
  438. not implement any interfaces are part of a class inheritance
  439. hierarchy, ``Interface`` could be assigned too high a priority.
  440. See `issue 8 <https://github.com/zopefoundation/zope.interface/issues/8>`_.
  441. - Implement sorting, equality, and hashing in C for ``Interface``
  442. objects. In micro benchmarks, this makes those operations 40% to 80%
  443. faster. This translates to a 20% speed up in querying adapters.
  444. Note that this changes certain implementation details. In
  445. particular, ``InterfaceClass`` now has a non-default metaclass, and
  446. it is enforced that ``__module__`` in instances of
  447. ``InterfaceClass`` is read-only.
  448. See `PR 183 <https://github.com/zopefoundation/zope.interface/pull/183>`_.
  449. 4.7.2 (2020-03-10)
  450. ==================
  451. - Remove deprecated use of setuptools features. See `issue 30
  452. <https://github.com/zopefoundation/zope.interface/issues/30>`_.
  453. 4.7.1 (2019-11-11)
  454. ==================
  455. - Use Python 3 syntax in the documentation. See `issue 119
  456. <https://github.com/zopefoundation/zope.interface/issues/119>`_.
  457. 4.7.0 (2019-11-11)
  458. ==================
  459. - Drop support for Python 3.4.
  460. - Change ``queryTaggedValue``, ``getTaggedValue``,
  461. ``getTaggedValueTags`` in interfaces. They now include inherited
  462. values by following ``__bases__``. See `PR 144
  463. <https://github.com/zopefoundation/zope.interface/pull/144>`_.
  464. .. caution:: This may be a breaking change.
  465. - Add support for Python 3.8.
  466. 4.6.0 (2018-10-23)
  467. ==================
  468. - Add support for Python 3.7
  469. - Fix ``verifyObject`` for class objects with staticmethods on
  470. Python 3. See `issue 126
  471. <https://github.com/zopefoundation/zope.interface/issues/126>`_.
  472. 4.5.0 (2018-04-19)
  473. ==================
  474. - Drop support for 3.3, avoid accidental dependence breakage via setup.py.
  475. See `PR 110 <https://github.com/zopefoundation/zope.interface/pull/110>`_.
  476. - Allow registering and unregistering instance methods as listeners.
  477. See `issue 12 <https://github.com/zopefoundation/zope.interface/issues/12>`_
  478. and `PR 102 <https://github.com/zopefoundation/zope.interface/pull/102>`_.
  479. - Synchronize and simplify zope/__init__.py. See `issue 114
  480. <https://github.com/zopefoundation/zope.interface/issues/114>`_
  481. 4.4.3 (2017-09-22)
  482. ==================
  483. - Avoid exceptions when the ``__annotations__`` attribute is added to
  484. interface definitions with Python 3.x type hints. See `issue 98
  485. <https://github.com/zopefoundation/zope.interface/issues/98>`_.
  486. - Fix the possibility of a rare crash in the C extension when
  487. deallocating items. See `issue 100
  488. <https://github.com/zopefoundation/zope.interface/issues/100>`_.
  489. 4.4.2 (2017-06-14)
  490. ==================
  491. - Fix a regression storing
  492. ``zope.component.persistentregistry.PersistentRegistry`` instances.
  493. See `issue 85 <https://github.com/zopefoundation/zope.interface/issues/85>`_.
  494. - Fix a regression that could lead to the utility registration cache
  495. of ``Components`` getting out of sync. See `issue 93
  496. <https://github.com/zopefoundation/zope.interface/issues/93>`_.
  497. 4.4.1 (2017-05-13)
  498. ==================
  499. - Simplify the caching of utility-registration data. In addition to
  500. simplification, avoids spurious test failures when checking for
  501. leaks in tests with persistent registries. See `pull 84
  502. <https://github.com/zopefoundation/zope.interface/pull/84>`_.
  503. - Raise ``ValueError`` when non-text names are passed to adapter registry
  504. methods: prevents corruption of lookup caches.
  505. 4.4.0 (2017-04-21)
  506. ==================
  507. - Avoid a warning from the C compiler.
  508. (https://github.com/zopefoundation/zope.interface/issues/71)
  509. - Add support for Python 3.6.
  510. 4.3.3 (2016-12-13)
  511. ==================
  512. - Correct typos and ReST formatting errors in documentation.
  513. - Add API documentation for the adapter registry.
  514. - Ensure that the ``LICENSE.txt`` file is included in built wheels.
  515. - Fix C optimizations broken on Py3k. See the Python bug at:
  516. http://bugs.python.org/issue15657
  517. (https://github.com/zopefoundation/zope.interface/issues/60)
  518. 4.3.2 (2016-09-05)
  519. ==================
  520. - Fix equality testing of ``implementedBy`` objects and proxies.
  521. (https://github.com/zopefoundation/zope.interface/issues/55)
  522. 4.3.1 (2016-08-31)
  523. ==================
  524. - Support Components subclasses that are not hashable.
  525. (https://github.com/zopefoundation/zope.interface/issues/53)
  526. 4.3.0 (2016-08-31)
  527. ==================
  528. - Add the ability to sort the objects returned by ``implementedBy``.
  529. This is compatible with the way interface classes sort so they can
  530. be used together in ordered containers like BTrees.
  531. (https://github.com/zopefoundation/zope.interface/issues/42)
  532. - Make ``setuptools`` a hard dependency of ``setup.py``.
  533. (https://github.com/zopefoundation/zope.interface/issues/13)
  534. - Change a linear algorithm (O(n)) in ``Components.registerUtility`` and
  535. ``Components.unregisterUtility`` into a dictionary lookup (O(1)) for
  536. hashable components. This substantially improves the time taken to
  537. manipulate utilities in large registries at the cost of some
  538. additional memory usage. (https://github.com/zopefoundation/zope.interface/issues/46)
  539. 4.2.0 (2016-06-10)
  540. ==================
  541. - Add support for Python 3.5
  542. - Drop support for Python 2.6 and 3.2.
  543. 4.1.3 (2015-10-05)
  544. ==================
  545. - Fix installation without a C compiler on Python 3.5
  546. (https://github.com/zopefoundation/zope.interface/issues/24).
  547. 4.1.2 (2014-12-27)
  548. ==================
  549. - Add support for PyPy3.
  550. - Remove unittest assertions deprecated in Python3.x.
  551. - Add ``zope.interface.document.asReStructuredText``, which formats the
  552. generated text for an interface using ReST double-backtick markers.
  553. 4.1.1 (2014-03-19)
  554. ==================
  555. - Add support for Python 3.4.
  556. 4.1.0 (2014-02-05)
  557. ==================
  558. - Update ``boostrap.py`` to version 2.2.
  559. - Add ``@named(name)`` declaration, that specifies the component name, so it
  560. does not have to be passed in during registration.
  561. 4.0.5 (2013-02-28)
  562. ==================
  563. - Fix a bug where a decorated method caused false positive failures on
  564. ``verifyClass()``.
  565. 4.0.4 (2013-02-21)
  566. ==================
  567. - Fix a bug that was revealed by porting zope.traversing. During a loop, the
  568. loop body modified a weakref dict causing a ``RuntimeError`` error.
  569. 4.0.3 (2012-12-31)
  570. ==================
  571. - Fleshed out PyPI Trove classifiers.
  572. 4.0.2 (2012-11-21)
  573. ==================
  574. - Add support for Python 3.3.
  575. - Restored ability to install the package in the absence of ``setuptools``.
  576. - LP #1055223: Fix test which depended on dictionary order and failed randomly
  577. in Python 3.3.
  578. 4.0.1 (2012-05-22)
  579. ==================
  580. - Drop explicit ``DeprecationWarnings`` for "class advice" APIS (these
  581. APIs are still deprecated under Python 2.x, and still raise an exception
  582. under Python 3.x, but no longer cause a warning to be emitted under
  583. Python 2.x).
  584. 4.0.0 (2012-05-16)
  585. ==================
  586. - Automated build of Sphinx HTML docs and running doctest snippets via tox.
  587. - Deprecate the "class advice" APIs from ``zope.interface.declarations``:
  588. ``implements``, ``implementsOnly``, and ``classProvides``. In their place,
  589. prefer the equivalent class decorators: ``@implementer``,
  590. ``@implementer_only``, and ``@provider``. Code which uses the deprecated
  591. APIs will not work as expected under Py3k.
  592. - Remove use of '2to3' and associated fixers when installing under Py3k.
  593. The code is now in a "compatible subset" which supports Python 2.6, 2.7,
  594. and 3.2, including PyPy 1.8 (the version compatible with the 2.7 language
  595. spec).
  596. - Drop explicit support for Python 2.4 / 2.5 / 3.1.
  597. - Add support for PyPy.
  598. - Add support for continuous integration using ``tox`` and ``jenkins``.
  599. - Add 'setup.py dev' alias (runs ``setup.py develop`` plus installs
  600. ``nose`` and ``coverage``).
  601. - Add 'setup.py docs' alias (installs ``Sphinx`` and dependencies).
  602. - Replace all unittest coverage previously accomplished via doctests with
  603. unittests. The doctests have been moved into a ``docs`` section, managed
  604. as a Sphinx collection.
  605. - LP #910987: Ensure that the semantics of the ``lookup`` method of
  606. ``zope.interface.adapter.LookupBase`` are the same in both the C and
  607. Python implementations.
  608. - LP #900906: Avoid exceptions due to tne new ``__qualname__`` attribute
  609. added in Python 3.3 (see PEP 3155 for rationale). Thanks to Antoine
  610. Pitrou for the patch.
  611. 3.8.0 (2011-09-22)
  612. ==================
  613. - New module ``zope.interface.registry``. This is code moved from
  614. ``zope.component.registry`` which implements a basic nonperistent component
  615. registry as ``zope.interface.registry.Components``. This class was moved
  616. from ``zope.component`` to make porting systems (such as Pyramid) that rely
  617. only on a basic component registry to Python 3 possible without needing to
  618. port the entirety of the ``zope.component`` package. Backwards
  619. compatibility import shims have been left behind in ``zope.component``, so
  620. this change will not break any existing code.
  621. - New ``tests_require`` dependency: ``zope.event`` to test events sent by
  622. Components implementation. The ``zope.interface`` package does not have a
  623. hard dependency on ``zope.event``, but if ``zope.event`` is importable, it
  624. will send component registration events when methods of an instance of
  625. ``zope.interface.registry.Components`` are called.
  626. - New interfaces added to support ``zope.interface.registry.Components``
  627. addition: ``ComponentLookupError``, ``Invalid``, ``IObjectEvent``,
  628. ``ObjectEvent``, ``IComponentLookup``, ``IRegistration``,
  629. ``IUtilityRegistration``, ``IAdapterRegistration``,
  630. ``ISubscriptionAdapterRegistration``, ``IHandlerRegistration``,
  631. ``IRegistrationEvent``, ``RegistrationEvent``, ``IRegistered``,
  632. ``Registered``, ``IUnregistered``, ``Unregistered``,
  633. ``IComponentRegistry``, and ``IComponents``.
  634. - No longer Python 2.4 compatible (tested under 2.5, 2.6, 2.7, and 3.2).
  635. 3.7.0 (2011-08-13)
  636. ==================
  637. - Move changes from 3.6.2 - 3.6.5 to a new 3.7.x release line.
  638. 3.6.7 (2011-08-20)
  639. ==================
  640. - Fix sporadic failures on x86-64 platforms in tests of rich comparisons
  641. of interfaces.
  642. 3.6.6 (2011-08-13)
  643. ==================
  644. - LP #570942: Now correctly compare interfaces from different modules but
  645. with the same names.
  646. N.B.: This is a less intrusive / destabilizing fix than the one applied in
  647. 3.6.3: we only fix the underlying cmp-alike function, rather than adding
  648. the other "rich comparison" functions.
  649. - Revert to software as released with 3.6.1 for "stable" 3.6 release branch.
  650. 3.6.5 (2011-08-11)
  651. ==================
  652. - LP #811792: work around buggy behavior in some subclasses of
  653. ``zope.interface.interface.InterfaceClass``, which invoke ``__hash__``
  654. before initializing ``__module__`` and ``__name__``. The workaround
  655. returns a fixed constant hash in such cases, and issues a ``UserWarning``.
  656. - LP #804832: Under PyPy, ``zope.interface`` should not build its C
  657. extension. Also, prevent attempting to build it under Jython.
  658. - Add a tox.ini for easier xplatform testing.
  659. - Fix testing deprecation warnings issued when tested under Py3K.
  660. 3.6.4 (2011-07-04)
  661. ==================
  662. - LP 804951: InterfaceClass instances were unhashable under Python 3.x.
  663. 3.6.3 (2011-05-26)
  664. ==================
  665. - LP #570942: Now correctly compare interfaces from different modules but
  666. with the same names.
  667. 3.6.2 (2011-05-17)
  668. ==================
  669. - Moved detailed documentation out-of-line from PyPI page, linking instead to
  670. http://docs.zope.org/zope.interface .
  671. - Fixes for small issues when running tests under Python 3.2 using
  672. ``zope.testrunner``.
  673. - LP # 675064: Specify return value type for C optimizations module init
  674. under Python 3: undeclared value caused warnings, and segfaults on some
  675. 64 bit architectures.
  676. - setup.py now raises RuntimeError if you don't have Distutils installed when
  677. running under Python 3.
  678. 3.6.1 (2010-05-03)
  679. ==================
  680. - A non-ASCII character in the changelog made 3.6.0 uninstallable on
  681. Python 3 systems with another default encoding than UTF-8.
  682. - Fix compiler warnings under GCC 4.3.3.
  683. 3.6.0 (2010-04-29)
  684. ==================
  685. - LP #185974: Clear the cache used by ``Specificaton.get`` inside
  686. ``Specification.changed``. Thanks to Jacob Holm for the patch.
  687. - Add support for Python 3.1. Contributors:
  688. Lennart Regebro
  689. Martin v Loewis
  690. Thomas Lotze
  691. Wolfgang Schnerring
  692. The 3.1 support is completely backwards compatible. However, the implements
  693. syntax used under Python 2.X does not work under 3.X, since it depends on
  694. how metaclasses are implemented and this has changed. Instead it now supports
  695. a decorator syntax (also under Python 2.X)::
  696. class Foo:
  697. implements(IFoo)
  698. ...
  699. can now also be written::
  700. @implementer(IFoo):
  701. class Foo:
  702. ...
  703. There are 2to3 fixers available to do this change automatically in the
  704. zope.fixers package.
  705. - Python 2.3 is no longer supported.
  706. 3.5.4 (2009-12-23)
  707. ==================
  708. - Use the standard Python doctest module instead of zope.testing.doctest, which
  709. has been deprecated.
  710. 3.5.3 (2009-12-08)
  711. ==================
  712. - Fix an edge case: make providedBy() work when a class has '__provides__' in
  713. its __slots__ (see http://thread.gmane.org/gmane.comp.web.zope.devel/22490)
  714. 3.5.2 (2009-07-01)
  715. ==================
  716. - BaseAdapterRegistry.unregister, unsubscribe: Remove empty portions of
  717. the data structures when something is removed. This avoids leaving
  718. references to global objects (interfaces) that may be slated for
  719. removal from the calling application.
  720. 3.5.1 (2009-03-18)
  721. ==================
  722. - verifyObject: use getattr instead of hasattr to test for object attributes
  723. in order to let exceptions other than AttributeError raised by properties
  724. propagate to the caller
  725. - Add Sphinx-based documentation building to the package buildout
  726. configuration. Use the ``bin/docs`` command after buildout.
  727. - Improve package description a bit. Unify changelog entries formatting.
  728. - Change package's mailing list address to zope-dev at zope.org as
  729. zope3-dev at zope.org is now retired.
  730. 3.5.0 (2008-10-26)
  731. ==================
  732. - Fix declaration of _zope_interface_coptimizations, it's not a top level
  733. package.
  734. - Add a DocTestSuite for odd.py module, so their tests are run.
  735. - Allow to bootstrap on Jython.
  736. - Fix https://bugs.launchpad.net/zope3/3.3/+bug/98388: ISpecification
  737. was missing a declaration for __iro__.
  738. - Add optional code optimizations support, which allows the building
  739. of C code optimizations to fail (Jython).
  740. - Replace `_flatten` with a non-recursive implementation, effectively making
  741. it 3x faster.
  742. 3.4.1 (2007-10-02)
  743. ==================
  744. - Fix a setup bug that prevented installation from source on systems
  745. without setuptools.
  746. 3.4.0 (2007-07-19)
  747. ==================
  748. - Final release for 3.4.0.
  749. 3.4.0b3 (2007-05-22)
  750. ====================
  751. - When checking whether an object is already registered, use identity
  752. comparison, to allow adding registering with picky custom comparison methods.
  753. 3.3.0.1 (2007-01-03)
  754. ====================
  755. - Made a reference to OverflowWarning, which disappeared in Python
  756. 2.5, conditional.
  757. 3.3.0 (2007/01/03)
  758. ==================
  759. New Features
  760. ------------
  761. - Refactor the adapter-lookup algorithim to make it much simpler and faster.
  762. Also, implement more of the adapter-lookup logic in C, making
  763. debugging of application code easier, since there is less
  764. infrastructre code to step through.
  765. - Treat objects without interface declarations as if they
  766. declared that they provide ``zope.interface.Interface``.
  767. - Add a number of richer new adapter-registration interfaces
  768. that provide greater control and introspection.
  769. - Add a new interface decorator to zope.interface that allows the
  770. setting of tagged values on an interface at definition time (see
  771. zope.interface.taggedValue).
  772. Bug Fixes
  773. ---------
  774. - A bug in multi-adapter lookup sometimes caused incorrect adapters to
  775. be returned.
  776. 3.2.0.2 (2006-04-15)
  777. ====================
  778. - Fix packaging bug: 'package_dir' must be a *relative* path.
  779. 3.2.0.1 (2006-04-14)
  780. ====================
  781. - Packaging change: suppress inclusion of 'setup.cfg' in 'sdist' builds.
  782. 3.2.0 (2006-01-05)
  783. ==================
  784. - Corresponds to the version of the zope.interface package shipped as part of
  785. the Zope 3.2.0 release.
  786. 3.1.0 (2005-10-03)
  787. ==================
  788. - Corresponds to the version of the zope.interface package shipped as part of
  789. the Zope 3.1.0 release.
  790. - Made attribute resolution order consistent with component lookup order,
  791. i.e. new-style class MRO semantics.
  792. - Deprecate 'isImplementedBy' and 'isImplementedByInstancesOf' APIs in
  793. favor of 'implementedBy' and 'providedBy'.
  794. 3.0.1 (2005-07-27)
  795. ==================
  796. - Corresponds to the version of the zope.interface package shipped as part of
  797. the Zope X3.0.1 release.
  798. - Fix a bug reported by James Knight, which caused adapter registries
  799. to fail occasionally to reflect declaration changes.
  800. 3.0.0 (2004-11-07)
  801. ==================
  802. - Corresponds to the version of the zope.interface package shipped as part of
  803. the Zope X3.0.0 release.