diff --git a/setup.py b/setup.py index a1f749d..11bef54 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,11 @@ import sys from setuptools import setup, find_packages +from setuptools.command.install import install import os + +SETUP_DIR = os.path.dirname(os.path.abspath(__file__)) + # Must keep these two versions in sync. # from pmr2 import wfctrl # version = wfctrl.__version__ @@ -13,6 +17,16 @@ open(os.path.join('docs', 'CHANGES.rst')).read() + '\n') + +class InstallCommand(install): + + def run(self): + install.run(self) + # Automatically install requirements from requirements.txt + import subprocess + subprocess.call(['pip', 'install', '-r', os.path.join(SETUP_DIR, 'requirements.txt')]) + + setup(name='pmr2.wfctrl', version=version, description="Workflow controller", @@ -22,6 +36,7 @@ classifiers=[ "Programming Language :: Python", ], + cmdclass={'install': InstallCommand,}, keywords='', author='', author_email='',