'Create the installation order.
The installation order is topological - requirements are installed
before the requiring thing. We break cycles at an arbitrary point,
and make no other guarantees.'

def _to_install(self):

    order = []
    ordered_reqs = set()
    def schedule(req):
        if (req.satisfied_by or (req in ordered_reqs)):
            return
        if req.constraint:
            return
        ordered_reqs.add(req)
        for dep in self._dependencies[req]:
            schedule(dep)
        order.append(req)
    for install_req in self.requirements.values():
        schedule(install_req)
    return order
