Update dependency list in setup.py for better support of py2/py3.
* Add a dependency on mock<=1.0.1 to allow unit tests to run under py2.
* In py2 mode, add a dependency on enum34.
* Update unit tests to remove the "try import unittest.mock except import mock" pattern
Change-Id: I1c18e400b66b54198a91bd1c62414d07b8ea25ef
diff --git a/acts/framework/setup.py b/acts/framework/setup.py
index fff5a91..84257fb 100755
--- a/acts/framework/setup.py
+++ b/acts/framework/setup.py
@@ -2,6 +2,19 @@
from setuptools import setup
from setuptools import find_packages
+import sys
+
+
+install_requires = [
+ 'contextlib2',
+ 'future',
+ # mock-1.0.1 is the last version compatible with setuptools <17.1,
+ # which is what comes with Ubuntu 14.04 LTS.
+ 'mock<=1.0.1',
+ 'pyserial',
+]
+if sys.version_info < (3,):
+ install_requires.append('enum34')
setup(
name='acts',
@@ -10,11 +23,7 @@
license = 'Apache2.0',
packages = find_packages(),
include_package_data = False,
- install_requires = [
- 'contextlib2',
- 'future',
- 'pyserial',
- ],
+ install_requires = install_requires,
scripts = ['acts/bin/act.py','acts/bin/monsoon.py'],
url = "http://www.android.com/"
)