blob: 0210a4a0966980ead12079298c5c0ed1e831c411 [file] [log] [blame]
tturney1bdf77d2015-12-28 17:46:13 -08001#!/usr/bin/env python3.4
Ang Lieb5e5052016-06-24 18:07:11 -07002#
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 Li73697b32015-12-03 00:41:53 +000017from setuptools import setup
18from setuptools import find_packages
Ang Lieb5e5052016-06-24 18:07:11 -070019from setuptools.command.test import test as TestCommand
Alexander Dorokhine5eb366e2016-03-14 12:04:40 -070020import sys
21
Alexander Dorokhine5eb366e2016-03-14 12:04:40 -070022install_requires = [
Alexander Dorokhine5eb366e2016-03-14 12:04:40 -070023 '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 Lieb5e5052016-06-24 18:07:11 -070029
30if sys.version_info < (3, ):
Alexander Dorokhine5eb366e2016-03-14 12:04:40 -070031 install_requires.append('enum34')
Ang Lia7a30692016-09-21 13:25:53 -070032 # "futures" is needed for py2 compatibility and it only works in 2.7
33 install_requires.append('futures')
Ang Li73697b32015-12-03 00:41:53 +000034
Ang Lieb5e5052016-06-24 18:07:11 -070035
36class 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
51setup(name='acts',
52 version='0.9',
53 description='Android Comms Test Suite',
54 license='Apache2.0',
Ang Lieb5e5052016-06-24 18:07:11 -070055 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/")