Skip to content

Commit

Permalink
Add more context to the changelog describing how to suppress the warn…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
jaraco committed Mar 27, 2021
2 parents 6360916 + ae14c73 commit a06aa30
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
22 changes: 18 additions & 4 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
v3.9.0
======

* Use of Mapping (dict) interfaces on ``SelectableGroups``
is now flagged as deprecated. Instead, users are advised
to use the select interface for future compatibility.

Suppress the warning with this filter:
``ignore:SelectableGroups dict interface``.

Or with this invocation in the Python environment:
``warnings.filterwarnings('ignore', 'SelectableGroups dict interface')``.

Preferably, switch to the ``select`` interface introduced
in 3.7.0.

v3.8.0
======

Expand Down Expand Up @@ -48,12 +64,10 @@ v3.6.0

``entry_points()`` now provides a future-compatible
``SelectableGroups`` object that supplies the above interface
but remains a dict for compatibility.
(except item access) but remains a dict for compatibility.

In the future, ``entry_points()`` will return an
``EntryPoints`` object, but provide for backward
compatibility with a deprecated ``__getitem__``
accessor by group and a ``get()`` method.
``EntryPoints`` object for all entry points.

If passing selection parameters to ``entry_points``, the
future behavior is invoked and an ``EntryPoints`` is the
Expand Down
5 changes: 3 additions & 2 deletions importlib_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def values(self):
return super().values()


class SelectableGroups(dict):
class SelectableGroups(Deprecated, dict):
"""
A backward- and forward-compatible result from
entry_points that fully implements the dict interface.
Expand All @@ -287,7 +287,8 @@ def _all(self):
"""
Reconstruct a list of all entrypoints from the groups.
"""
return EntryPoints(itertools.chain.from_iterable(self.values()))
groups = super(Deprecated, self).values()
return EntryPoints(itertools.chain.from_iterable(groups))

@property
def groups(self):
Expand Down

0 comments on commit a06aa30

Please sign in to comment.