From 926563f80a213260eecfb33815af3915e3fb8c2a Mon Sep 17 00:00:00 2001 From: Hugh Sorby Date: Thu, 8 Sep 2016 12:07:36 +1200 Subject: [PATCH] Update setup.py Make pip install requirements from requirements.txt file. --- setup.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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='',