Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build a python3 wheel with sonic_psu #162

Merged
merged 1 commit into from
Dec 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we really plan to do this in the future?

It is my understanding that this is a temporary solution until we break the sonic Python modules out into their own package, separate from sonic-utilities, then we will build the modules package for both Python 2 and 3, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. This is an alternative, and we can remove TODO if either is achieved.

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',
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion sonic_psu/psu_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down