Esempio n. 1
0
    def uninstall(self, dist: Distribution) -> None:
        req = parse_requirement(dist.project_name)
        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()
Esempio n. 2
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
Esempio 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