1

I'm trying to add a post-install step into the setup.py. The installation works but the code inside run(self) is never executed.

Things I've tried (with no result):

  • Install it using both "pip install (-e) ." and "python setup.py (develop)" [and later uninstall it, reinstall it, delete .egg-info folder,...]
  • Variations using: do_egg_install, build, bdist_egg,...

Versions:

  • pip 8.1.2 (for Python 3.5)
  • setuptools-20.2.2

Toy example:

from setuptools import setup
from setuptools.command.install import install


class MyCommand(install):
    def run(self):
        print("Hello, developer, how are you? :)")
        install.run(self)


if __name__ == '__main__':
    setup(
        cmdclass={
            'install': MyCommand,
        }
    )
Salva Carrión
  • 510
  • 6
  • 16
  • 1
    How do you run your code? I ran your code with `python setup.py install` and it prints `Hello, developer, how are you? :)`. BTW: [here](https://stackoverflow.com/questions/20288711/post-install-script-with-python-setuptools) is thread regarding post-installation script in `setup.py`. – patryk.beza Oct 06 '17 at 10:33

0 Answers0