tturney | 1bdf77d | 2015-12-28 17:46:13 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python3.4 |
Ang Li | eb5e505 | 2016-06-24 18:07:11 -0700 | [diff] [blame] | 2 | # |
| 3 | # Copyright 2016 - The Android Open Source Project |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 17 | from setuptools import setup |
| 18 | from setuptools import find_packages |
Ang Li | eb5e505 | 2016-06-24 18:07:11 -0700 | [diff] [blame] | 19 | from setuptools.command.test import test as TestCommand |
Alexander Dorokhine | 5eb366e | 2016-03-14 12:04:40 -0700 | [diff] [blame] | 20 | import sys |
| 21 | |
Alexander Dorokhine | 5eb366e | 2016-03-14 12:04:40 -0700 | [diff] [blame] | 22 | install_requires = [ |
Alexander Dorokhine | 5eb366e | 2016-03-14 12:04:40 -0700 | [diff] [blame] | 23 | 'future', |
| 24 | # mock-1.0.1 is the last version compatible with setuptools <17.1, |
| 25 | # which is what comes with Ubuntu 14.04 LTS. |
| 26 | 'mock<=1.0.1', |
| 27 | 'pyserial', |
| 28 | ] |
Ang Li | eb5e505 | 2016-06-24 18:07:11 -0700 | [diff] [blame] | 29 | |
| 30 | if sys.version_info < (3, ): |
Alexander Dorokhine | 5eb366e | 2016-03-14 12:04:40 -0700 | [diff] [blame] | 31 | install_requires.append('enum34') |
Ang Li | a7a3069 | 2016-09-21 13:25:53 -0700 | [diff] [blame^] | 32 | # "futures" is needed for py2 compatibility and it only works in 2.7 |
| 33 | install_requires.append('futures') |
Ang Li | 73697b3 | 2015-12-03 00:41:53 +0000 | [diff] [blame] | 34 | |
Ang Li | eb5e505 | 2016-06-24 18:07:11 -0700 | [diff] [blame] | 35 | |
| 36 | class PyTest(TestCommand): |
| 37 | """Class used to execute unit tests using PyTest. This allows us to execute |
| 38 | unit tests without having to install the package. |
| 39 | """ |
| 40 | def finalize_options(self): |
| 41 | TestCommand.finalize_options(self) |
| 42 | self.test_args = ['-x', "tests"] |
| 43 | self.test_suite = True |
| 44 | |
| 45 | def run_tests(self): |
| 46 | import pytest |
| 47 | errno = pytest.main(self.test_args) |
| 48 | sys.exit(errno) |
| 49 | |
| 50 | |
| 51 | setup(name='acts', |
| 52 | version='0.9', |
| 53 | description='Android Comms Test Suite', |
| 54 | license='Apache2.0', |
Ang Li | eb5e505 | 2016-06-24 18:07:11 -0700 | [diff] [blame] | 55 | packages=find_packages(), |
| 56 | include_package_data=False, |
| 57 | tests_require=['pytest'], |
| 58 | install_requires=install_requires, |
| 59 | scripts=['acts/bin/act.py', 'acts/bin/monsoon.py'], |
| 60 | cmdclass={'test': PyTest}, |
| 61 | url="http://www.android.com/") |