summaryrefslogtreecommitdiff
path: root/CHANGES.rst
blob: b21f54da471ea34144478e1fb8a60996e4175ed1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
=========
 Changes
=========

5.0.0 (unreleased)
==================

- Make an internal singleton object returned by APIs like
  ``implementedBy`` and ``directlyProvidedBy`` immutable. Previously,
  it was fully mutable and allowed changing its ``__bases___``. That
  could potentially lead to wrong results in pathological corner
  cases. See `issue 158
  <https://github.com/zopefoundation/zope.interface/issues/158>`_.

- Support the ``PURE_PYTHON`` environment variable at runtime instead
  of just at wheel build time. A value of 0 forces the C extensions to
  be used (even on PyPy) failing if they aren't present. Any other
  value forces the Python implementation to be used, ignoring the C
  extensions. See `PR 151 <https://github.com/zopefoundation/zope.interface/pull/151>`_.

- Cache the result of ``__hash__`` method in ``InterfaceClass`` as a
  speed optimization. The method is called very often (i.e several
  hundred thousand times during Plone 5.2 startup). Because the hash value never
  changes it can be cached. This improves test performance from 0.614s
  down to 0.575s (1.07x faster). In a real world Plone case a reindex
  index came down from 402s to 320s (1.26x faster). See `PR 156
  <https://github.com/zopefoundation/zope.interface/pull/156>`_.

- Change the C classes ``SpecificationBase`` and its subclass
  ``ClassProvidesBase`` to store implementation attributes in their structures
  instead of their instance dictionaries. This eliminates the use of
  an undocumented private C API function, and helps make some
  instances require less memory. See `PR 154 <https://github.com/zopefoundation/zope.interface/pull/154>`_.

- Reduce memory usage in other ways based on observations of usage
  patterns in Zope (3) and Plone code bases.

  - Specifications with no dependents are common (more than 50%) so
    avoid allocating a ``WeakKeyDictionary`` unless we need it.
  - Likewise, tagged values are relatively rare, so don't allocate a
    dictionary to hold them until they are used.
  - Use ``__slots___`` or the C equivalent ``tp_members`` in more
    common places. Note that this removes the ability to set arbitrary
    instance variables on certain objects.
    See `PR 155 <https://github.com/zopefoundation/zope.interface/pull/155>`_.

  The changes in this release resulted in a 7% memory reduction after
  loading about 6,000 modules that define about 2,200 interfaces.

- Remove support for hashing uninitialized interfaces. This could only
  be done by subclassing ``InterfaceClass``. This has generated a
  warning since it was first added in 2011 (3.6.5). Please call the
  ``InterfaceClass`` constructor or otherwise set the appropriate
  fields in your subclass before attempting to hash or sort it. See
  `issue 157 <https://github.com/zopefoundation/zope.interface/issues/157>`_.

- Remove unneeded override of the ``__hash__`` method from
  ``zope.interface.declarations.Implements``. Watching a reindex index
  process in ZCatalog with on a Py-Spy after 10k samples the time for
  ``.adapter._lookup`` was reduced from 27.5s to 18.8s (~1.5x faster).
  Overall reindex index time shrunk from 369s to 293s (1.26x faster).
  See `PR 161
  <https://github.com/zopefoundation/zope.interface/pull/161>`_.

- Make the Python implementation closer to the C implementation by
  ignoring all exceptions, not just ``AttributeError``, during (parts
  of) interface adaptation. See `issue 163
  <https://github.com/zopefoundation/zope.interface/issues/163>`_.

- Micro-optimization in ``.adapter._lookup`` , ``.adapter._lookupAll``
  and ``.adapter._subscriptions``: By loading ``components.get`` into
  a local variable before entering the loop a bytcode "LOAD_FAST 0
  (components)" in the loop can be eliminated. In Plone, while running
  all tests, average speedup of the "owntime" of ``_lookup`` is ~5x.
  See `PR 167
  <https://github.com/zopefoundation/zope.interface/pull/167>`_.

- Add ``__all__`` declarations to all modules. This helps tools that
  do auto-completion and documentation and results in less cluttered
  results. Wildcard ("*") are not recommended and may be affected. See
  `issue 153
  <https://github.com/zopefoundation/zope.interface/issues/153>`_.

- Fix ``verifyClass`` and ``verifyObject`` for builtin types like
  ``dict`` that have methods taking an optional, unnamed argument with
  no default value like ``dict.pop``. On PyPy3, the verification is
  strict, but on PyPy2 (as on all versions of CPython) those methods
  cannot be verified and are ignored. See `issue 118
  <https://github.com/zopefoundation/zope.interface/issues/118>`_.

- Update the common interfaces ``IEnumerableMapping``,
  ``IExtendedReadMapping``, ``IExtendedWriteMapping``,
  ``IReadSequence`` and ``IUniqueMemberWriteSequence`` to no longer
  require methods that were removed from Python 3 on Python 3, such as
  ``__setslice___``. Now, ``dict``, ``list`` and ``tuple`` properly
  verify as ``IFullMapping``, ``ISequence`` and ``IReadSequence,``
  respectively on all versions of Python.

- Add human-readable ``__str___`` and ``__repr___`` to ``Attribute``
  and ``Method``. These contain the name of the defining interface
  and the attribute. For methods, it also includes the signature.

- Change the error strings raised by ``verifyObject`` and
  ``verifyClass``. They now include more human-readable information
  and exclude extraneous lines and spaces. See `issue 170
  <https://github.com/zopefoundation/zope.interface/issues/170>`_.

  .. caution:: This will break consumers (such as doctests) that
               depended on the exact error messages.

- Make ``verifyObject`` and ``verifyClass`` report all errors, if the
  candidate object has multiple detectable violations. Previously they
  reported only the first error. See `issue
  <https://github.com/zopefoundation/zope.interface/issues/171>`_.

  Like the above, this will break consumers depending on the exact
  output of error messages if more than one error is present.

4.7.1 (2019-11-11)
==================

- Use Python 3 syntax in the documentation.  See `issue 119
  <https://github.com/zopefoundation/zope.interface/issues/119>`_.


4.7.0 (2019-11-11)
==================

- Drop support for Python 3.4.

- Fix ``queryTaggedValue``, ``getTaggedValue``, ``getTaggedValueTags``
  subclass inheritance. See `PR 144
  <https://github.com/zopefoundation/zope.interface/pull/144>`_.

- Add support for Python 3.8.


4.6.0 (2018-10-23)
==================

- Add support for Python 3.7

- Fix ``verifyObject`` for class objects with staticmethods on
  Python 3. See `issue 126
  <https://github.com/zopefoundation/zope.interface/issues/126>`_.


4.5.0 (2018-04-19)
==================

- Drop support for 3.3, avoid accidental dependence breakage via setup.py.
  See `PR 110 <https://github.com/zopefoundation/zope.interface/pull/110>`_.
- Allow registering and unregistering instance methods as listeners.
  See `issue 12 <https://github.com/zopefoundation/zope.interface/issues/12>`_
  and `PR 102 <https://github.com/zopefoundation/zope.interface/pull/102>`_.
- Synchronize and simplify zope/__init__.py. See `issue 114
  <https://github.com/zopefoundation/zope.interface/issues/114>`_


4.4.3 (2017-09-22)
==================

- Avoid exceptions when the ``__annotations__`` attribute is added to
  interface definitions with Python 3.x type hints. See `issue 98
  <https://github.com/zopefoundation/zope.interface/issues/98>`_.
- Fix the possibility of a rare crash in the C extension when
  deallocating items. See `issue 100
  <https://github.com/zopefoundation/zope.interface/issues/100>`_.


4.4.2 (2017-06-14)
==================

- Fix a regression storing
  ``zope.component.persistentregistry.PersistentRegistry`` instances.
  See `issue 85 <https://github.com/zopefoundation/zope.interface/issues/85>`_.

- Fix a regression that could lead to the utility registration cache
  of ``Components`` getting out of sync. See `issue 93
  <https://github.com/zopefoundation/zope.interface/issues/93>`_.

4.4.1 (2017-05-13)
==================

- Simplify the caching of utility-registration data. In addition to
  simplification, avoids spurious test failures when checking for
  leaks in tests with persistent registries. See `pull 84
  <https://github.com/zopefoundation/zope.interface/pull/84>`_.

- Raise ``ValueError`` when non-text names are passed to adapter registry
  methods:  prevents corruption of lookup caches.

4.4.0 (2017-04-21)
==================

- Avoid a warning from the C compiler.
  (https://github.com/zopefoundation/zope.interface/issues/71)

- Add support for Python 3.6.

4.3.3 (2016-12-13)
==================

- Correct typos and ReST formatting errors in documentation.

- Add API documentation for the adapter registry.

- Ensure that the ``LICENSE.txt`` file is included in built wheels.

- Fix C optimizations broken on Py3k.  See the Python bug at:
  http://bugs.python.org/issue15657
  (https://github.com/zopefoundation/zope.interface/issues/60)


4.3.2 (2016-09-05)
==================

- Fix equality testing of ``implementedBy`` objects and proxies.
  (https://github.com/zopefoundation/zope.interface/issues/55)


4.3.1 (2016-08-31)
==================

- Support Components subclasses that are not hashable.
  (https://github.com/zopefoundation/zope.interface/issues/53)


4.3.0 (2016-08-31)
==================

- Add the ability to sort the objects returned by ``implementedBy``.
  This is compatible with the way interface classes sort so they can
  be used together in ordered containers like BTrees.
  (https://github.com/zopefoundation/zope.interface/issues/42)

- Make ``setuptools`` a hard dependency of ``setup.py``.
  (https://github.com/zopefoundation/zope.interface/issues/13)

- Change a linear algorithm (O(n)) in ``Components.registerUtility`` and
  ``Components.unregisterUtility`` into a dictionary lookup (O(1)) for
  hashable components. This substantially improves the time taken to
  manipulate utilities in large registries at the cost of some
  additional memory usage. (https://github.com/zopefoundation/zope.interface/issues/46)


4.2.0 (2016-06-10)
==================

- Add support for Python 3.5

- Drop support for Python 2.6 and 3.2.


4.1.3 (2015-10-05)
==================

- Fix installation without a C compiler on Python 3.5
  (https://github.com/zopefoundation/zope.interface/issues/24).


4.1.2 (2014-12-27)
==================

- Add support for PyPy3.

- Remove unittest assertions deprecated in Python3.x.

- Add ``zope.interface.document.asReStructuredText``, which formats the
  generated text for an interface using ReST double-backtick markers.


4.1.1 (2014-03-19)
==================

- Add support for Python 3.4.


4.1.0 (2014-02-05)
==================

- Update ``boostrap.py`` to version 2.2.

- Add ``@named(name)`` declaration, that specifies the component name, so it
  does not have to be passed in during registration.


4.0.5 (2013-02-28)
==================

- Fix a bug where a decorated method caused false positive failures on
  ``verifyClass()``.


4.0.4 (2013-02-21)
==================

- Fix a bug that was revealed by porting zope.traversing. During a loop, the
  loop body modified a weakref dict causing a ``RuntimeError`` error.

4.0.3 (2012-12-31)
==================

- Fleshed out PyPI Trove classifiers.

4.0.2 (2012-11-21)
==================

- Add support for Python 3.3.

- Restored ability to install the package in the absence of ``setuptools``.

- LP #1055223:  Fix test which depended on dictionary order and failed randomly
  in Python 3.3.

4.0.1 (2012-05-22)
==================

- Drop explicit ``DeprecationWarnings`` for "class advice" APIS (these
  APIs are still deprecated under Python 2.x, and still raise an exception
  under Python 3.x, but no longer cause a warning to be emitted under
  Python 2.x).

4.0.0 (2012-05-16)
==================

- Automated build of Sphinx HTML docs and running doctest snippets via tox.

- Deprecate the "class advice" APIs from ``zope.interface.declarations``:
  ``implements``, ``implementsOnly``, and ``classProvides``.  In their place,
  prefer the equivalent class decorators: ``@implementer``,
  ``@implementer_only``, and ``@provider``.  Code which uses the deprecated
  APIs will not work as expected under Py3k.

- Remove use of '2to3' and associated fixers when installing under Py3k.
  The code is now in a "compatible subset" which supports Python 2.6, 2.7,
  and 3.2, including PyPy 1.8 (the version compatible with the 2.7 language
  spec).

- Drop explicit support for Python 2.4 / 2.5 / 3.1.

- Add support for PyPy.

- Add support for continuous integration using ``tox`` and ``jenkins``.

- Add 'setup.py dev' alias (runs ``setup.py develop`` plus installs
  ``nose`` and ``coverage``).

- Add 'setup.py docs' alias (installs ``Sphinx`` and dependencies).

- Replace all unittest coverage previously accomplished via doctests with
  unittests.  The doctests have been moved into a ``docs`` section, managed
  as a Sphinx collection.

- LP #910987:  Ensure that the semantics of the ``lookup`` method of
  ``zope.interface.adapter.LookupBase`` are the same in both the C and
  Python implementations.

- LP #900906:  Avoid exceptions due to tne new ``__qualname__`` attribute
  added in Python 3.3 (see PEP 3155 for rationale).  Thanks to Antoine
  Pitrou for the patch.

3.8.0 (2011-09-22)
==================

- New module ``zope.interface.registry``.  This is code moved from
  ``zope.component.registry`` which implements a basic nonperistent component
  registry as ``zope.interface.registry.Components``.  This class was moved
  from ``zope.component`` to 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 the ``zope.component`` package.  Backwards
  compatibility import shims have been left behind in ``zope.component``, so
  this change will not break any existing code.

- New ``tests_require`` dependency: ``zope.event`` to test events sent by
  Components implementation.  The ``zope.interface`` package does not have a
  hard dependency on ``zope.event``, but if ``zope.event`` is importable, it
  will send component registration events when methods of an instance of
  ``zope.interface.registry.Components`` are called.

- New interfaces added to support ``zope.interface.registry.Components``
  addition: ``ComponentLookupError``, ``Invalid``, ``IObjectEvent``,
  ``ObjectEvent``, ``IComponentLookup``, ``IRegistration``,
  ``IUtilityRegistration``, ``IAdapterRegistration``,
  ``ISubscriptionAdapterRegistration``, ``IHandlerRegistration``,
  ``IRegistrationEvent``, ``RegistrationEvent``, ``IRegistered``,
  ``Registered``, ``IUnregistered``, ``Unregistered``,
  ``IComponentRegistry``, and ``IComponents``.

- No longer Python 2.4 compatible (tested under 2.5, 2.6, 2.7, and 3.2).

3.7.0 (2011-08-13)
==================

- Move changes from 3.6.2 - 3.6.5 to a new 3.7.x release line.

3.6.7 (2011-08-20)
==================

- Fix sporadic failures on x86-64 platforms in tests of rich comparisons
  of interfaces.

3.6.6 (2011-08-13)
==================

- LP #570942:  Now correctly compare interfaces  from different modules but
  with the same names.

  N.B.: This is a less intrusive / destabilizing fix than the one applied in
  3.6.3:  we only fix the underlying cmp-alike function, rather than adding
  the other "rich comparison" functions.

- Revert to software as released with 3.6.1 for "stable" 3.6 release branch.

3.6.5 (2011-08-11)
==================

- LP #811792:  work around buggy behavior in some subclasses of
  ``zope.interface.interface.InterfaceClass``, which invoke ``__hash__``
  before initializing ``__module__`` and ``__name__``.  The workaround
  returns a fixed constant hash in such cases, and issues a ``UserWarning``.

- LP #804832:  Under PyPy, ``zope.interface`` should not build its C
  extension.  Also, prevent attempting to build it under Jython.

- Add a tox.ini for easier xplatform testing.

- Fix testing deprecation warnings issued when tested under Py3K.

3.6.4 (2011-07-04)
==================

- LP 804951:  InterfaceClass instances were unhashable under Python 3.x.

3.6.3 (2011-05-26)
==================

- LP #570942:  Now correctly compare interfaces  from different modules but
  with the same names.

3.6.2 (2011-05-17)
==================

- Moved detailed documentation out-of-line from PyPI page, linking instead to
  http://docs.zope.org/zope.interface .

- Fixes for small issues when running tests under Python 3.2 using
  ``zope.testrunner``.

- LP # 675064:  Specify return value type for C optimizations module init
  under Python 3:  undeclared value caused warnings, and segfaults on some
  64 bit architectures.

- setup.py now raises RuntimeError if you don't have Distutils installed when
  running under Python 3.

3.6.1 (2010-05-03)
==================

- A non-ASCII character in the changelog made 3.6.0 uninstallable on
  Python 3 systems with another default encoding than UTF-8.

- Fix compiler warnings under GCC 4.3.3.

3.6.0 (2010-04-29)
==================

- LP #185974:  Clear the cache used by ``Specificaton.get`` inside
  ``Specification.changed``.  Thanks to Jacob Holm for the patch.

- Add support for Python 3.1. Contributors:

    Lennart Regebro
    Martin v Loewis
    Thomas Lotze
    Wolfgang Schnerring

  The 3.1 support is completely backwards compatible. However, the implements
  syntax used under Python 2.X does not work under 3.X, since it depends on
  how metaclasses are implemented and this has changed. Instead it now supports
  a decorator syntax (also under Python 2.X)::

    class Foo:
        implements(IFoo)
        ...

  can now also be written::

    @implementer(IFoo):
    class Foo:
        ...

  There are 2to3 fixers available to do this change automatically in the
  zope.fixers package.

- Python 2.3 is no longer supported.


3.5.4 (2009-12-23)
==================

- Use the standard Python doctest module instead of zope.testing.doctest, which
  has been deprecated.


3.5.3 (2009-12-08)
==================

- Fix an edge case: make providedBy() work when a class has '__provides__' in
  its __slots__ (see http://thread.gmane.org/gmane.comp.web.zope.devel/22490)


3.5.2 (2009-07-01)
==================

- BaseAdapterRegistry.unregister, unsubscribe: Remove empty portions of
  the data structures when something is removed.  This avoids leaving
  references to global objects (interfaces) that may be slated for
  removal from the calling application.


3.5.1 (2009-03-18)
==================

- verifyObject: use getattr instead of hasattr to test for object attributes
  in order to let exceptions other than AttributeError raised by properties
  propagate to the caller

- Add Sphinx-based documentation building to the package buildout
  configuration. Use the ``bin/docs`` command after buildout.

- Improve package description a bit. Unify changelog entries formatting.

- Change package's mailing list address to zope-dev at zope.org as
  zope3-dev at zope.org is now retired.


3.5.0 (2008-10-26)
==================

- Fix declaration of _zope_interface_coptimizations, it's not a top level
  package.

- Add a DocTestSuite for odd.py module, so their tests are run.

- Allow to bootstrap on Jython.

- Fix https://bugs.launchpad.net/zope3/3.3/+bug/98388: ISpecification
  was missing a declaration for __iro__.

- Add optional code optimizations support, which allows the building
  of C code optimizations to fail (Jython).

- Replace `_flatten` with a non-recursive implementation, effectively making
  it 3x faster.


3.4.1 (2007-10-02)
==================

- Fix a setup bug that prevented installation from source on systems
  without setuptools.


3.4.0 (2007-07-19)
==================

- Final release for 3.4.0.


3.4.0b3 (2007-05-22)
====================


- When checking whether an object is already registered, use identity
  comparison, to allow adding registering with picky custom comparison methods.


3.3.0.1 (2007-01-03)
====================

- Made a reference to OverflowWarning, which disappeared in Python
  2.5, conditional.


3.3.0 (2007/01/03)
==================

New Features
------------

- Refactor the adapter-lookup algorithim to make it much simpler and faster.

  Also, implement more of the adapter-lookup logic in C, making
  debugging of application code easier, since there is less
  infrastructre code to step through.

- Treat objects without interface declarations as if they
  declared that they provide ``zope.interface.Interface``.

- Add a number of richer new adapter-registration interfaces
  that provide greater control and introspection.

- Add a new interface decorator to zope.interface that allows the
  setting of tagged values on an interface at definition time (see
  zope.interface.taggedValue).

Bug Fixes
---------

- A bug in multi-adapter lookup sometimes caused incorrect adapters to
  be returned.


3.2.0.2 (2006-04-15)
====================

- Fix packaging bug:  'package_dir' must be a *relative* path.


3.2.0.1 (2006-04-14)
====================

- Packaging change:  suppress inclusion of 'setup.cfg' in 'sdist' builds.


3.2.0 (2006-01-05)
==================

- Corresponds to the verison of the zope.interface package shipped as part of
  the Zope 3.2.0 release.


3.1.0 (2005-10-03)
==================

- Corresponds to the verison of the zope.interface package shipped as part of
  the Zope 3.1.0 release.

- Made attribute resolution order consistent with component lookup order,
  i.e. new-style class MRO semantics.

- Deprecate 'isImplementedBy' and 'isImplementedByInstancesOf' APIs in
  favor of 'implementedBy' and 'providedBy'.


3.0.1 (2005-07-27)
==================

- Corresponds to the verison of the zope.interface package shipped as part of
  the Zope X3.0.1 release.

- Fix a bug reported by James Knight, which caused adapter registries
  to fail occasionally to reflect declaration changes.


3.0.0 (2004-11-07)
==================

- Corresponds to the verison of the zope.interface package shipped as part of
  the Zope X3.0.0 release.