From 1c71f1af2432b364df3b08bffbf34f4d4ad78fe4 Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 6 Dec 2017 23:38:57 +0000 Subject: [PATCH] Build a python3 wheel with sonic_psu Signed-off-by: Qi Luo --- setup.py | 13 ++++++++++--- sonic_psu/psu_base.py | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 5a571ae032..61b055c329 100644 --- a/setup.py +++ b/setup.py @@ -1,11 +1,17 @@ import glob +import sys from setuptools import setup import unittest +# For python3 wheel, we currently don't need test +# TODO: build python3 wheel of all the dependencies, and remove conditional test def get_test_suite(): - test_loader = unittest.TestLoader() - test_suite = test_loader.discover('sonic-utilities-tests', pattern='*.py') - return test_suite + if sys.version_info >= (3, 0): + return unittest.TestSuite() + else: + test_loader = unittest.TestLoader() + test_suite = test_loader.discover('sonic-utilities-tests', pattern='*.py') + return test_suite setup( name='sonic-utilities', @@ -83,6 +89,7 @@ def get_test_suite(): 'Natural Language :: English', 'Operating System :: POSIX :: Linux', 'Programming Language :: Python :: 2.7', + 'Programming Language :: Python :: 3.6', 'Topic :: Utilities', ], keywords='sonic SONiC utilities command line cli CLI', diff --git a/sonic_psu/psu_base.py b/sonic_psu/psu_base.py index fba50b4627..396389150f 100644 --- a/sonic_psu/psu_base.py +++ b/sonic_psu/psu_base.py @@ -8,7 +8,7 @@ try: import abc -except ImportError, e: +except ImportError as e: raise ImportError (str(e) + " - required module not found") class PsuBase(object):