I need to run a simple script after the modules and programs have been installed. I\'m having a little trouble finding straight-forward documentation on how to do this. It l
OK, I figured it out. The idea is basically to extend one of the distutils commands and overwrite the run method. To tell distutils to use the new class you can use the cmdclass variable.
from distutils.core import setup
from distutils.command.install_data import install_data
class post_install(install_data):
def run(self):
# Call parent
install_data.run(self)
# Execute commands
print "Running"
setup(name="example",
cmdclass={"install_data": post_install},
...
)
Hope this will help someone else.