Skip to content
6 changes: 6 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
v4.5.0
=======

* #319: Remove ``SelectableGroups`` deprecation exception
for flake8.

v4.4.0
=======

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ were contributed to different versions in the standard library:

* - importlib_metadata
- stdlib
* - 4.2
* - 4.4
- 3.10
* - 1.4
- 3.8
Expand Down
10 changes: 1 addition & 9 deletions importlib_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,14 +367,6 @@ def _parse_groups(text):
)


def flake8_bypass(func):
# defer inspect import as performance optimization.
import inspect

is_flake8 = any('flake8' in str(frame.filename) for frame in inspect.stack()[:5])
return func if not is_flake8 else lambda: None


class Deprecated:
"""
Compatibility add-in for mapping to indicate that
Expand Down Expand Up @@ -410,7 +402,7 @@ def __getitem__(self, name):
return super().__getitem__(name)

def get(self, name, default=None):
flake8_bypass(self._warn)()
self._warn()
return super().get(name, default)

def __iter__(self):
Expand Down
4 changes: 4 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS
# workaround for warning pytest-dev/pytest#6178
junit_family=xunit2
filterwarnings=
# Suppress deprecation warning in flake8
ignore:SelectableGroups dict interface is deprecated::flake8
# Suppress deprecation warning in pypa/packaging#433
ignore:The distutils package is deprecated::packaging.tags
1 change: 1 addition & 0 deletions tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def test_entry_points_by_index(self):
"""
eps = distribution('distinfo-pkg').entry_points
with warnings.catch_warnings(record=True) as caught:
warnings.filterwarnings("default", category=DeprecationWarning)
eps[0]

# check warning
Expand Down