diff --git a/setup.py b/setup.py index 109b345c576e961d11ba61604b40f9dcc7146f97..1f1af6a4ac4fe3cf73a3cee5f8e95f67714d50ff 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,11 @@ import glob import os # pylint: disable=E0611 -from distutils.core import setup + +try: + from setuptools import setup +except ImportError: + from distutils.core import setup import avocado.version @@ -71,6 +75,16 @@ def _get_plugin_resource_files(path): return flist +def get_requirements(): + requirements = [] + with open('requirements.txt', 'r') as req: + req_contents = req.read() + for line in req_contents.splitlines(): + if not line.startswith("#"): + line = line.split("#")[0].strip() + requirements.append("%s" % line) + return requirements + setup(name='avocado', version=avocado.version.VERSION, description='Avocado Test Framework', @@ -86,4 +100,5 @@ setup(name='avocado', 'avocado.plugins'], package_data={'avocado.plugins': _get_plugin_resource_files('avocado/plugins/resources')}, data_files=get_data_files(), - scripts=['scripts/avocado']) + scripts=['scripts/avocado'], + install_requires=get_requirements())