def dist_is_editable(dist): """Is distribution an editable install?""" # TODO: factor out determining editableness out of FrozenRequirement from pip import FrozenRequirement req = FrozenRequirement.from_dist(dist, []) return req.editable
def dist_to_req(dist): """Make a pip.FrozenRequirement from a pkg_resources distribution object""" 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
def dist_to_req(dist): """Make a pip.FrozenRequirement from a pkg_resources distribution object""" from pip import FrozenRequirement # TODO: does it matter that we completely ignore dependency_links? return FrozenRequirement.from_dist(dist, [])