I want to run some custom code when I run pip uninstall
, cleaning up files that were created on installation. How should I go about this?
I've got custom install code running by using the following in setup.py:
from setuptools import setup
from setuptools.command.install import install
class CustomInstallCommand(install):
def run(self):
#Custom code here
install.run(self)
...
setup(
...
cmdclass = {
'install':CustomInstallCommand
}
)
But trying something similar for setuptools.command.uninstall
or from setuptools.command.install import uninstall
fails, since those modules/names don't exist.