old_contents: import pkg_resources
  
  
  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())
  
new_contents: try:
      from importlib import metadata
  except ImportError:
      import importlib_metadata as metadata
  
  
  def test_entry_point():
      """
      Keyring provides exactly one 'keyring' console script
      that's a callable.
      """
      scripts = dict(metadata.entry_points()['console_scripts'])
      assert callable(scripts['keyring'].load())
  
subject: Replace use of pkg_resources in test_packaging.