From e8bc2fb7e3b9b2e9f6450bec5366a8da82ffbbb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Doktor?= Date: Mon, 4 Sep 2017 14:21:54 +0200 Subject: [PATCH] requirements: Add all mandatory requirements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The requirements are quite outdated, this commit adds all of them to both, requirements.txt and setup.py in order to just install avocado-vt and get all required dependencies installed automatically. The `avocado-framework` dependency is not included in requirements.txt as 36lts used a different name. This is treated in setup.py but there is no way to workaround it in requirements so only comment is there. Signed-off-by: Lukáš Doktor --- requirements.txt | 4 ++++ setup.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/requirements.txt b/requirements.txt index 3763b8fdea2..377322bed8c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,3 +3,7 @@ aexpect>=1.3.1 simplejson>=3.5.3 netaddr>=0.7.18 netifaces>=0.10.5 +# This is a mandatory requirement but on 36.0 release the avocado name was +# avocado-36.0 which breaks the dependencies. Please include this dependency +# manually. +# avocado-framework>=36.0 diff --git a/setup.py b/setup.py index 91ed33b835c..1f0d78cb3e3 100644 --- a/setup.py +++ b/setup.py @@ -80,6 +80,23 @@ def pre_post_plugin_type(): if __name__ == "__main__": + requirements = ["netifaces", "aexpect", "netaddr", "simplejson", + "autotest"] + try: + # Avocado-36 was called "avocado" and newer ones are called + # avocado-framework. Let's only include it in case it's not + # available. + from avocado import Test + del(Test) + except ImportError: + if sys.version_info[:2] >= (2, 7): + requirements.append("avocado-framework>=36.0") + else: + # In avocado-36 there is a bug which requires the stevedore + # to be manually added. + requirements.append("stevedore>=1.8.0,<=1.10.0") + requirements.append("avocado-framework>=36.0,<=46.0") + setup(name='avocado-plugins-vt', version=VERSION, description='Avocado Virt Test Compatibility Layer plugin', @@ -114,4 +131,5 @@ def pre_post_plugin_type(): 'vt-joblock = avocado_vt.plugins.vt_joblock:VTJobLock', ], }, + install_requires=requirements, )