问题
From resources online, I've learned that the following will add a "post-install" hook if included in setup.py
:
from setuptools import setup
from setuptools.command.install import install as _install
class install(_install):
def run(self):
_install.run(self)
# Do something magical
setup(cmdclass={'install': install})
What I'd like to do, though, is create equivalent behavior after a setup.py clean
is executed. Specifically, I'd like setup.py clean
to remove the .egg-INFO
directory created during the execution of setup.py egg_info
.
来源:https://stackoverflow.com/questions/28018117/add-post-clean-command-to-python-setup-py