docs: def dist_to_req(dist):
      """Make a pip.FrozenRequirement from a pkg_resources distribution object"""
      try:  # :pragma:nocover: (pip>=10)
          from pip._internal.operations.freeze import FrozenRequirement
      except ImportError:  # :pragma:nocover: (pip<10)
          from pip import FrozenRequirement
  
      # normalize the casing, dashes in the req name
      orig_name, dist.project_name = dist.project_name, dist.key
      result = FrozenRequirement.from_dist(dist, [])
      # put things back the way we found it.
      dist.project_name = orig_name
  
      return result