Custom code to delete

I want to run my own code at startup pip uninstall, cleaning up files created during installation. How should I do it?

I have a custom installation code launched 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 the attempt to do something similar for setuptools.command.uninstallor from setuptools.command.install import uninstallfailed because these modules / names do not exist.

+4
source share

All Articles