aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2016-11-06 16:41:23 -0500
committerJason R. Coombs <jaraco@jaraco.com>2016-11-06 16:41:23 -0500
commit355603259aa37e424cf7466c3de6518375a935e3 (patch)
tree44882a2534fbdf9165d4491b5b1faa59c72f45de /setuptools
parent14827711f669a830190313951ab5aef7b71ab2c6 (diff)
downloadexternal_python_setuptools-355603259aa37e424cf7466c3de6518375a935e3.tar.gz
external_python_setuptools-355603259aa37e424cf7466c3de6518375a935e3.tar.bz2
external_python_setuptools-355603259aa37e424cf7466c3de6518375a935e3.zip
Add uninstall support for namespace packages
Diffstat (limited to 'setuptools')
-rwxr-xr-xsetuptools/command/develop.py1
-rwxr-xr-xsetuptools/namespaces.py8
2 files changed, 9 insertions, 0 deletions
diff --git a/setuptools/command/develop.py b/setuptools/command/develop.py
index 8de24fd7..aa82f959 100755
--- a/setuptools/command/develop.py
+++ b/setuptools/command/develop.py
@@ -31,6 +31,7 @@ class develop(namespaces.DevelopInstaller, easy_install):
if self.uninstall:
self.multi_version = True
self.uninstall_link()
+ self.uninstall_namespaces()
else:
self.install_for_development()
self.warn_deprecated_options()
diff --git a/setuptools/namespaces.py b/setuptools/namespaces.py
index cc934b7e..a6371c99 100755
--- a/setuptools/namespaces.py
+++ b/setuptools/namespaces.py
@@ -30,6 +30,14 @@ class Installer:
with open(filename, 'wt') as f:
f.writelines(lines)
+ def uninstall_namespaces(self):
+ filename, ext = os.path.splitext(self._get_target())
+ filename += self.nspkg_ext
+ if not os.path.exists(filename):
+ return
+ log.info("Removing %s", filename)
+ os.remove(filename)
+
def _get_target(self):
return self.target