I want to check some requirements (but existence of other python packages, I already know how to do that) of the system before running setup()
, like check output of some system commands, to stop installation process and warn user if requirements doesn't met. But I need to do it only when running setup.py install
, not setup.py check
or setup.py sdist
.
How can I do that?
UPD: Example of check that I need:
packs = subprocess.check_output(['packagemanager', '--list'])
if NAME in packs:
print ('You have to remove previous version of %s '
'before installing this.' % NAME
)
sys.exit(1)