Skip to content

Commit 1cabd5f

Browse files
authored
Merge pull request #319 from python/feature/uniform
Remove SelectableGroups deprecation exception for flake8.
2 parents dba300f + abfe23b commit 1cabd5f

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

CHANGES.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
v4.5.0
2+
=======
3+
4+
* #319: Remove ``SelectableGroups`` deprecation exception
5+
for flake8.
6+
17
v4.4.0
28
=======
39

importlib_metadata/__init__.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -367,14 +367,6 @@ def _parse_groups(text):
367367
)
368368

369369

370-
def flake8_bypass(func):
371-
# defer inspect import as performance optimization.
372-
import inspect
373-
374-
is_flake8 = any('flake8' in str(frame.filename) for frame in inspect.stack()[:5])
375-
return func if not is_flake8 else lambda: None
376-
377-
378370
class Deprecated:
379371
"""
380372
Compatibility add-in for mapping to indicate that
@@ -410,7 +402,7 @@ def __getitem__(self, name):
410402
return super().__getitem__(name)
411403

412404
def get(self, name, default=None):
413-
flake8_bypass(self._warn)()
405+
self._warn()
414406
return super().get(name, default)
415407

416408
def __iter__(self):

pytest.ini

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,5 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS
55
# workaround for warning pytest-dev/pytest#6178
66
junit_family=xunit2
77
filterwarnings=
8+
# Suppress deprecation warning in flake8
9+
ignore:SelectableGroups dict interface is deprecated::flake8

0 commit comments

Comments
 (0)