Commit Graph

732 Commits

Author SHA1 Message Date
Jens Vagelpohl 946e0370a8
- prepare release 5.5.2 2022-11-17 15:25:14 +01:00
Jens Vagelpohl eb1af6e38b
- Add support for building arm64 wheels on macOS. 2022-11-13 11:34:59 +01:00
Jens Vagelpohl 50773ad042
- vb [ci skip] 2022-11-03 14:22:27 +01:00
Jens Vagelpohl d672d91c62
- prepare release 5.5.1 2022-11-03 13:50:45 +01:00
Jens Vagelpohl 391db8a4c4
- update to the latest meta/config and declare Python 3.11 support 2022-11-02 11:09:27 +01:00
Michael Howitz d65b9977fc Back to development: 5.5.1 2022-10-10 08:41:58 +02:00
Michael Howitz 32815ddb3c Preparing release 5.5.0 2022-10-10 08:41:33 +02:00
Michael Howitz 009c381866 Update to current meta/config. 2022-09-16 09:01:50 +02:00
Marius Gedminas 24bd6eefae Update changelog 2022-09-12 10:23:41 +03:00
Marius Gedminas 4d5ef53663
Merge pull request #262 from zopefoundation/config-with-c-code
Update to the latest c-code template
2022-09-10 19:24:21 +03:00
Marius Gedminas 5051f10e29 Update to the latest c-code template
Add a regression test for CFLAGS not having -Ofast, which is known to
break things.  See https://github.com/zopefoundation/meta/pull/155 for
reference.

This reverts commit dc2e4b9841, which
itself was reverting commit 22a761cc9e,
which was accidentally pushed to git master and is otherwise identical
to this commit.
2022-09-09 18:07:33 +03:00
Marius Gedminas dc2e4b9841 Revert "Update to the latest c-code template"
This reverts commit 22a761cc9e.

This was not supposed to have been pushed directly to master :/
2022-09-09 18:05:42 +03:00
Marius Gedminas 22a761cc9e Update to the latest c-code template
Add a regression test for CFLAGS not having -Ofast, which is known to
break things.  See https://github.com/zopefoundation/meta/pull/155 for
reference.
2022-09-09 18:04:58 +03:00
Michael Howitz a07c82b781 Update to Python 3.11.0b4. 2022-08-03 08:44:34 +02:00
Michael Howitz fc36cf4f86 Fix PyPy2 run on GHA. 2022-07-07 09:06:38 +02:00
Michael Howitz 239dd56589 Fix tests for PyPy3.
On PyPy3 the following `registered_classes` for `IMutableMapping` are
found:

```
{<class 'dict'>,
 <class 'pkg_resources._vendor.pyparsing.ParseResults'>,
 <class 'setuptools._vendor.pyparsing.ParseResults'>,
 <class 'collections.UserDict'>}
```

So collecting the tests fails because of a duplicate name which is
prevented by this commit.
2022-03-29 08:09:24 +02:00
Michael Howitz 5f8e2e0410
Add support for Python 3.11. (#253)
* Add support for Python 3.11.
* Do not use the binary version of coverage as it has a Python 3.11 wheel on PyPI which is not ABI compatible with the current alpha release and caused segfaults.
* Do not push wheels of Python future releases to PyPI.
2022-01-28 08:22:00 +01:00
Kian-Meng Ang 7128155b28
Fix typos (#251)
Co-authored-by: Michael Howitz <mh@gocept.com>
2022-01-25 08:12:30 +01:00
Michael Howitz 67a4f6f7f2
Add support for Python 3.10 (#250)
* Fix tests on Python 3.10.
* "Fix" a test broken just on windows + allow to use posargs for tox test runs.
* Checking array.array non-strictly did not help on Windows. – So ignore it completely.
2022-01-24 13:03:51 +01:00
Colin Watson 64784b2b96
Merge pull request #248 from cjwatson/more-interfaces-all
Add some more entries to zope.interface.interfaces.__all__
2021-09-06 11:42:31 +01:00
Colin Watson e9eb5850ef Add some more entries to zope.interface.interfaces.__all__
`ComponentLookupError`, `Invalid`, `Registered`, and `Unregistered` are
all documented
(https://zopeinterface.readthedocs.io/en/latest/api/components.html), so
it seems odd not to list them in `__all__`.  `ObjectEvent` isn't
documented there, but it seems reasonable to export it as a base class
for similar events.
2021-09-02 10:45:32 +01:00
Marius Gedminas 42571b5a89
Merge pull request #244 from zopefoundation/use-pypi-token
Use a token for twine uploads from Appveyor
2021-06-16 20:27:26 +03:00
Marius Gedminas 36b150e7f3 Use a token for twine uploads from Appveyor
(I cheated and edited both files manually instead of editing .meta.toml
and re-running the config tool.)
2021-06-16 12:49:24 +03:00
Michael Howitz d18b5478f4
Configure with meta/config. (#243)
* Add support for Python 3.9.
* Improve coverage.
2021-06-02 14:35:12 +02:00
Michael Howitz 077ff5b322
Fix the documentation so it can be tested with `ZOPE_INTERFACE_STRICT_IRO=1`. (#242)
Closes #241.
2021-05-05 15:28:09 +02:00
Jason Madden 7928bb3374
Back to development: 5.4.1 2021-04-15 04:55:23 -05:00
Jason Madden 324ba685da
Preparing release 5.4.0 2021-04-15 04:53:40 -05:00
Jason Madden 24b6a016bf
Merge pull request #240 from zopefoundation/issue239
Make C's __providedBy__ stop ignoring all errors and catch only AttributeError
2021-04-15 04:50:36 -05:00
Jason Madden 6a293da775
Finish sentence in docstring. [skip ci] 2021-04-15 04:50:13 -05:00
Jason Madden 253456fe17
Merge pull request #238 from zopefoundation/issue193
Make Declaration.__add__ try harder to produce consistent resolution orders
2021-04-15 04:42:53 -05:00
Jason Madden 8a0a8f1dea
Make C's __providedBy__ stop ignoring all errors and catch only AttributeError.
Fixes #239

There was a similar bug in the Python side where it would ignore a __provides__ of None, unlike the C implementation.
I documented this in the code but not the CHANGES.rst because I can't imagine anyone relying on that.
2021-04-13 16:47:53 -05:00
Jason Madden eb542a8a75
Make Declaration.__add__ try harder to produce consistent resolution orders.
By moving things from the RHS to the front of the list if they already extend something from the LHS.

Fixes #193
2021-04-01 07:11:26 -05:00
Jason Madden 4a686fc8d8
Merge pull request #237 from zopefoundation/issue236
Update repr() and str() of some common objects.
2021-03-29 06:04:58 -05:00
Jason Madden ce8f66f8bf
Update repr() and str() of some common objects.
Only InterfaceClass got a str, so it now has a distinction. Other objects only got updated reprs.

Note: This may potentially break some doctests.

In many cases, the ``repr()`` is now something that can be evaluated
to produce an equal object. For example, what was previously printed
as ``<implementedBy builtins.list>`` is now shown as
``classImplements(list, IMutableSequence, IIterable)``.

Fixes #236

Here's a before with ZOPE_INTERFACE_LOG_CHANGED_IRO=1 in BTrees:
```
Object <implementedBy builtins.list> has different legacy and C3 MROs:
  Legacy RO (len=11)                                                        C3 RO (len=11; inconsistent=no)
  ==================================================================================================================================================
    <implementedBy builtins.list>                                             <implementedBy builtins.list>
    <ABCInterfaceClass zope.interface.common.collections.IMutableSequence>    <ABCInterfaceClass zope.interface.common.collections.IMutableSequence>
    <ABCInterfaceClass zope.interface.common.collections.ISequence>           <ABCInterfaceClass zope.interface.common.collections.ISequence>
    <ABCInterfaceClass zope.interface.common.collections.IReversible>         <ABCInterfaceClass zope.interface.common.collections.IReversible>
    <ABCInterfaceClass zope.interface.common.collections.ICollection>         <ABCInterfaceClass zope.interface.common.collections.ICollection>
    <ABCInterfaceClass zope.interface.common.collections.ISized>              <ABCInterfaceClass zope.interface.common.collections.ISized>
                                                                            + <ABCInterfaceClass zope.interface.common.collections.IIterable>
    <ABCInterfaceClass zope.interface.common.collections.IContainer>          <ABCInterfaceClass zope.interface.common.collections.IContainer>
  - <ABCInterfaceClass zope.interface.common.collections.IIterable>
    <ABCInterfaceClass zope.interface.common.ABCInterface>                    <ABCInterfaceClass zope.interface.common.ABCInterface>
                                                                            + <implementedBy builtins.object>
    <InterfaceClass zope.interface.Interface>                                 <InterfaceClass zope.interface.Interface>
  - <implementedBy builtins.object>
Object <ABCInterfaceClass zope.interface.common.mapping.IFullMapping> has different legacy and C3 MROs:
  Legacy RO (len=18)                                                       C3 RO (len=18; inconsistent=no)
  ================================================================================================================================================
    <ABCInterfaceClass zope.interface.common.mapping.IFullMapping>           <ABCInterfaceClass zope.interface.common.mapping.IFullMapping>
    <ABCInterfaceClass zope.interface.common.collections.IMutableMapping>    <ABCInterfaceClass zope.interface.common.collections.IMutableMapping>
    <ABCInterfaceClass zope.interface.common.collections.IMapping>           <ABCInterfaceClass zope.interface.common.collections.IMapping>
    <ABCInterfaceClass zope.interface.common.collections.ICollection>        <ABCInterfaceClass zope.interface.common.collections.ICollection>
  - <ABCInterfaceClass zope.interface.common.collections.IIterable>
    <InterfaceClass zope.interface.common.mapping.IExtendedReadMapping>      <InterfaceClass zope.interface.common.mapping.IExtendedReadMapping>
    <InterfaceClass zope.interface.common.mapping.IIterableMapping>          <InterfaceClass zope.interface.common.mapping.IIterableMapping>
    <InterfaceClass zope.interface.common.mapping.IExtendedWriteMapping>     <InterfaceClass zope.interface.common.mapping.IExtendedWriteMapping>
    <InterfaceClass zope.interface.common.mapping.IClonableMapping>          <InterfaceClass zope.interface.common.mapping.IClonableMapping>
    <InterfaceClass zope.interface.common.mapping.IMapping>                  <InterfaceClass zope.interface.common.mapping.IMapping>
    <InterfaceClass zope.interface.common.mapping.IWriteMapping>             <InterfaceClass zope.interface.common.mapping.IWriteMapping>
    <InterfaceClass zope.interface.common.mapping.IEnumerableMapping>        <InterfaceClass zope.interface.common.mapping.IEnumerableMapping>
    <ABCInterfaceClass zope.interface.common.collections.ISized>             <ABCInterfaceClass zope.interface.common.collections.ISized>
                                                                           + <ABCInterfaceClass zope.interface.common.collections.IIterable>
    <InterfaceClass zope.interface.common.mapping.IReadMapping>              <InterfaceClass zope.interface.common.mapping.IReadMapping>
    <ABCInterfaceClass zope.interface.common.collections.IContainer>         <ABCInterfaceClass zope.interface.common.collections.IContainer>
    <ABCInterfaceClass zope.interface.common.ABCInterface>                   <ABCInterfaceClass zope.interface.common.ABCInterface>
    <InterfaceClass zope.interface.common.mapping.IItemMapping>              <InterfaceClass zope.interface.common.mapping.IItemMapping>
    <InterfaceClass zope.interface.Interface>                                <InterfaceClass zope.interface.Interface>
Object <InterfaceClass BTrees.Interfaces.ISet> has different legacy and C3 MROs:
  Legacy RO (len=7)                                  C3 RO (len=7; inconsistent=no)
  ====================================================================================================
    <InterfaceClass BTrees.Interfaces.ISet>            <InterfaceClass BTrees.Interfaces.ISet>
    <InterfaceClass BTrees.Interfaces.IKeySequence>    <InterfaceClass BTrees.Interfaces.IKeySequence>
  - <InterfaceClass BTrees.Interfaces.ISized>
    <InterfaceClass BTrees.Interfaces.ISetMutable>     <InterfaceClass BTrees.Interfaces.ISetMutable>
    <InterfaceClass BTrees.Interfaces.IKeyed>          <InterfaceClass BTrees.Interfaces.IKeyed>
    <InterfaceClass BTrees.Interfaces.ICollection>     <InterfaceClass BTrees.Interfaces.ICollection>
                                                     + <InterfaceClass BTrees.Interfaces.ISized>
    <InterfaceClass zope.interface.Interface>          <InterfaceClass zope.interface.Interface>
```

And here's after:

```
Object classImplements(list, IMutableSequence, IIterable) has different legacy and C3 MROs:
  Legacy RO (len=11)                                    C3 RO (len=11; inconsistent=no)
  ==========================================================================================================
    classImplements(list, IMutableSequence, IIterable)    classImplements(list, IMutableSequence, IIterable)
    zope.interface.common.collections.IMutableSequence    zope.interface.common.collections.IMutableSequence
    zope.interface.common.collections.ISequence           zope.interface.common.collections.ISequence
    zope.interface.common.collections.IReversible         zope.interface.common.collections.IReversible
    zope.interface.common.collections.ICollection         zope.interface.common.collections.ICollection
    zope.interface.common.collections.ISized              zope.interface.common.collections.ISized
                                                        + zope.interface.common.collections.IIterable
    zope.interface.common.collections.IContainer          zope.interface.common.collections.IContainer
  - zope.interface.common.collections.IIterable
    zope.interface.common.ABCInterface                    zope.interface.common.ABCInterface
                                                        + classImplements(object)
    zope.interface.Interface                              zope.interface.Interface
  - classImplements(object)
Object <ABCInterfaceClass zope.interface.common.mapping.IFullMapping> has different legacy and C3 MROs:
  Legacy RO (len=18)                                     C3 RO (len=18; inconsistent=no)
  ============================================================================================================
    zope.interface.common.mapping.IFullMapping             zope.interface.common.mapping.IFullMapping
    zope.interface.common.collections.IMutableMapping      zope.interface.common.collections.IMutableMapping
    zope.interface.common.collections.IMapping             zope.interface.common.collections.IMapping
    zope.interface.common.collections.ICollection          zope.interface.common.collections.ICollection
  - zope.interface.common.collections.IIterable
    zope.interface.common.mapping.IExtendedReadMapping     zope.interface.common.mapping.IExtendedReadMapping
    zope.interface.common.mapping.IIterableMapping         zope.interface.common.mapping.IIterableMapping
    zope.interface.common.mapping.IExtendedWriteMapping    zope.interface.common.mapping.IExtendedWriteMapping
    zope.interface.common.mapping.IClonableMapping         zope.interface.common.mapping.IClonableMapping
    zope.interface.common.mapping.IMapping                 zope.interface.common.mapping.IMapping
    zope.interface.common.mapping.IWriteMapping            zope.interface.common.mapping.IWriteMapping
    zope.interface.common.mapping.IEnumerableMapping       zope.interface.common.mapping.IEnumerableMapping
    zope.interface.common.collections.ISized               zope.interface.common.collections.ISized
                                                         + zope.interface.common.collections.IIterable
    zope.interface.common.mapping.IReadMapping             zope.interface.common.mapping.IReadMapping
    zope.interface.common.collections.IContainer           zope.interface.common.collections.IContainer
    zope.interface.common.ABCInterface                     zope.interface.common.ABCInterface
    zope.interface.common.mapping.IItemMapping             zope.interface.common.mapping.IItemMapping
    zope.interface.Interface                               zope.interface.Interface
Object <InterfaceClass BTrees.Interfaces.ISet> has different legacy and C3 MROs:
  Legacy RO (len=7)                 C3 RO (len=7; inconsistent=no)
  ==================================================================
    BTrees.Interfaces.ISet            BTrees.Interfaces.ISet
    BTrees.Interfaces.IKeySequence    BTrees.Interfaces.IKeySequence
  - BTrees.Interfaces.ISized
    BTrees.Interfaces.ISetMutable     BTrees.Interfaces.ISetMutable
    BTrees.Interfaces.IKeyed          BTrees.Interfaces.IKeyed
    BTrees.Interfaces.ICollection     BTrees.Interfaces.ICollection
                                    + BTrees.Interfaces.ISized
    zope.interface.Interface          zope.interface.Interface
```
2021-03-25 10:30:47 -05:00
Jens Vagelpohl e6d3805c6e
- prepare release 5.3.0 2021-03-21 10:35:24 +01:00
Jens Vagelpohl ef0b7dad44
- ignore virtualenv artifacts 2021-03-21 10:31:40 +01:00
Jason Madden dd0f7b9447
Back to development: 5.3.0a2 2021-03-18 09:11:38 -05:00
Jason Madden cec672fb3f
Preparing release 5.3.0a1 2021-03-18 09:11:13 -05:00
Jason Madden 5db4d7c689
Merge pull request #234 from zopefoundation/issue229-take2
Update documentation and Provides repr for better debugging.
2021-03-18 07:04:33 -05:00
Jason Madden f46bc4f788
Improve the tests for ProvidesClass.__repr__. 2021-03-18 06:00:14 -05:00
Jason Madden 45c97ab85d
Update documentation and Provides repr for better debugging.
Fixes #229.

Replaces #232
2021-03-18 05:17:52 -05:00
Jason Madden cfe4075488
Merge pull request #235 from zopefoundation/issue207
Make Provides and ClassProvides ignore redundant interfaces like @implementer
2021-03-18 05:14:10 -05:00
Jason Madden 7a9fcddc22
Merge pull request #233 from zopefoundation/docs-update
Update the Adaptation docs to be more concrete.
2021-03-17 11:43:08 -05:00
Jason Madden 686760eb26
Update docs/README.rst: Two expressions need two lines
Co-authored-by: Michael Howitz <mh@gocept.com>
2021-03-17 11:42:18 -05:00
Jason Madden 45b9294e9d
Make Provides and ClassProvides ignore redundant interfaces like @implementer
cf #207
2021-03-17 11:11:19 -05:00
Jason Madden 762c253064
Merge pull request #231 from zopefoundation/issue230
Add IAdapterRegistry.subscribed and Components.rebuildUtilityRegistryFromLocalCache
2021-03-17 10:09:13 -05:00
Jason Madden 488a317abd
Update the Adaptation docs to be more concrete.
This should help provide better motivating use cases. Examples inspired by https://glyph.twistedmatrix.com/2021/03/interfaces-and-protocols.html

Also some minor typo fixes and updates to comments.
2021-03-17 07:39:49 -05:00
Jason Madden 8728a3efad
Tweak wrapping in subscribed() docstring. 2021-03-16 08:40:02 -05:00
Jason Madden 8534bdc961
Add missing quote in docstring in src/zope/interface/registry.py
Co-authored-by: Marius Gedminas <marius@gedmin.as>
2021-03-16 08:33:48 -05:00
Jason Madden 820b9b0299
Share code between registered and subscribed. 2021-03-15 10:04:09 -05:00