Skip to content

Commit a06aa30

Browse files
committed
Add more context to the changelog describing how to suppress the warning.
2 parents 6360916 + ae14c73 commit a06aa30

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

CHANGES.rst

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
v3.9.0
2+
======
3+
4+
* Use of Mapping (dict) interfaces on ``SelectableGroups``
5+
is now flagged as deprecated. Instead, users are advised
6+
to use the select interface for future compatibility.
7+
8+
Suppress the warning with this filter:
9+
``ignore:SelectableGroups dict interface``.
10+
11+
Or with this invocation in the Python environment:
12+
``warnings.filterwarnings('ignore', 'SelectableGroups dict interface')``.
13+
14+
Preferably, switch to the ``select`` interface introduced
15+
in 3.7.0.
16+
117
v3.8.0
218
======
319

@@ -48,12 +64,10 @@ v3.6.0
4864

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

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

5872
If passing selection parameters to ``entry_points``, the
5973
future behavior is invoked and an ``EntryPoints`` is the

importlib_metadata/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ def values(self):
269269
return super().values()
270270

271271

272-
class SelectableGroups(dict):
272+
class SelectableGroups(Deprecated, dict):
273273
"""
274274
A backward- and forward-compatible result from
275275
entry_points that fully implements the dict interface.
@@ -287,7 +287,8 @@ def _all(self):
287287
"""
288288
Reconstruct a list of all entrypoints from the groups.
289289
"""
290-
return EntryPoints(itertools.chain.from_iterable(self.values()))
290+
groups = super(Deprecated, self).values()
291+
return EntryPoints(itertools.chain.from_iterable(groups))
291292

292293
@property
293294
def groups(self):

0 commit comments

Comments
 (0)