vpp_papi: Fix missing dependency. 98/19998/2
authorPaul Vinciguerra <pvinci@vinciconsulting.com>
Thu, 6 Jun 2019 11:38:42 +0000 (07:38 -0400)
committerOle Trøan <otroan@employees.org>
Fri, 7 Jun 2019 09:45:34 +0000 (09:45 +0000)
Since we test vpp_papi as part of tests, the need for
ipaddress under python2.7 is masked.

Add ipaddress to setup.py for python <=3.3.

Change-Id: I01c2f5560eeb740e546024e84028d5a2fb2ace45
Type: fix
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
src/vpp-api/python/setup.py

index c832132..a14e4e4 100644 (file)
 import sys
 
 stdlib_enum = sys.version_info >= (3, 6)
+stdlib_ipaddress = sys.version_info >= (3, 3)
 
 try:
     from setuptools import setup, find_packages
 except ImportError:
     from distutils.core import setup, find_packages
 
+requirements = ['cffi >= 1.6']
+if not stdlib_enum:
+    requirements.append('aenum')
+if not stdlib_ipaddress:
+    requirements.append('ipaddress')
+
 setup(
     name='vpp_papi',
     version='1.6.2',
@@ -29,8 +36,7 @@ setup(
     url='https://wiki.fd.io/view/VPP/Python_API',
     license='Apache-2.0',
     test_suite='vpp_papi.tests',
-    install_requires=['cffi >= 1.6'] if stdlib_enum else
-        ['cffi >= 1.6', 'aenum'],
+    install_requires=requirements,
     packages=find_packages(),
     long_description='''VPP Python language binding.''',
     zip_safe=True)