Commit d47b5285 by Arun Babu Neelicattu

pip: ensure vcs source is removed after package removal

Relates-to: #2238
parent 9b56bdd5
......@@ -105,12 +105,6 @@ class PipInstaller(BaseInstaller):
self.install(target, update=True)
def remove(self, package):
# If we have a VCS package, remove its source directory
if package.source_type == "git":
src_dir = self._env.path / "src" / package.name
if src_dir.exists():
safe_rmtree(str(src_dir))
try:
self.run("uninstall", package.name, "-y")
except CalledProcessError as e:
......@@ -119,6 +113,12 @@ class PipInstaller(BaseInstaller):
raise
# If we have a VCS package, remove its source directory
if package.source_type == "git":
src_dir = self._env.path / "src" / package.name
if src_dir.exists():
safe_rmtree(str(src_dir))
def run(self, *args, **kwargs): # type: (...) -> str
return self._env.run_pip(*args, **kwargs)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment