Exemplo n.º 1
0
 def as_ireq(self, **kwargs: Any) -> InstallRequirement:
     line_for_req = self.as_line()
     if self.editable:
         line_for_req = line_for_req[3:].strip()
         ireq = install_req_from_editable(line_for_req, **kwargs)
     else:
         ireq = install_req_from_line(line_for_req, **kwargs)
     ireq.req = self
     return ireq
Exemplo n.º 2
0
    def uninstall(self, dist: Distribution) -> None:
        req = parse_requirement(dist.project_name)
        if is_dist_editable(dist):
            ireq = pip_shims.install_req_from_editable(dist.location)
        else:
            ireq = pip_shims.install_req_from_line(dist.project_name)
        ireq.req = req

        pathset = ireq.uninstall(auto_confirm=self.auto_confirm)
        if pathset:
            pathset.commit()
Exemplo n.º 3
0
 def as_ireq(self, **kwargs: Any) -> InstallRequirement:
     line_for_req = self.as_line()
     try:
         if self.editable:
             line_for_req = line_for_req[3:].strip()
             ireq = install_req_from_editable(line_for_req, **kwargs)
         else:
             ireq = install_req_from_line(line_for_req, **kwargs)
     except Exception as e:
         raise RequirementError(e)
     ireq.req = self  # type: ignore
     return ireq