Replace use of pkg_resources in test_packaging.
-import pkg_resources
+try:
+ from importlib import metadata
+except ImportError:
+ import importlib_metadata as metadata
def test_entry_point():
@@ -6,6 +9,5 @@ def test_entry_point():
Keyring provides exactly one 'keyring' console script
that's a callable.
"""
- eps = pkg_resources.iter_entry_points('console_scripts')
- (ep,) = (ep for ep in eps if ep.name == 'keyring')
- assert callable(ep.resolve())
+ scripts = dict(metadata.entry_points()['console_scripts'])
+ assert callable(scripts['keyring'].load())
