• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#    Copyright 2013-2015 ARM Limited
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7#     http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14#
15
16import os
17import sys
18import warnings
19from itertools import chain
20
21try:
22    from setuptools import setup
23except ImportError:
24    from distutils.core import setup
25
26
27devlib_dir = os.path.join(os.path.dirname(__file__), 'devlib')
28
29sys.path.insert(0, os.path.join(devlib_dir, 'core'))
30
31# happends if falling back to distutils
32warnings.filterwarnings('ignore', "Unknown distribution option: 'install_requires'")
33warnings.filterwarnings('ignore', "Unknown distribution option: 'extras_require'")
34
35try:
36    os.remove('MANIFEST')
37except OSError:
38    pass
39
40packages = []
41data_files = {}
42source_dir = os.path.dirname(__file__)
43for root, dirs, files in os.walk(devlib_dir):
44    rel_dir = os.path.relpath(root, source_dir)
45    data = []
46    if '__init__.py' in files:
47        for f in files:
48            if os.path.splitext(f)[1] not in ['.py', '.pyc', '.pyo']:
49                data.append(f)
50        package_name = rel_dir.replace(os.sep, '.')
51        package_dir = root
52        packages.append(package_name)
53        data_files[package_name] = data
54    else:
55        # use previous package name
56        filepaths = [os.path.join(root, f) for f in files]
57        data_files[package_name].extend([os.path.relpath(f, package_dir) for f in filepaths])
58
59params = dict(
60    name='devlib',
61    description='A framework for automating workload execution and measurment collection on ARM devices.',
62    version='0.0.4',
63    packages=packages,
64    package_data=data_files,
65    url='N/A',
66    license='Apache v2',
67    maintainer='ARM Ltd.',
68    install_requires=[
69        'python-dateutil',  # converting between UTC and local time.
70        'pexpect>=3.3',  # Send/recieve to/from device
71        'pyserial',  # Serial port interface
72        'wrapt',  # Basic for construction of decorator functions
73    ],
74    extras_require={
75        'daq': ['daqpower'],
76        'doc': ['sphinx'],
77        'monsoon': ['python-gflags'],
78    },
79    # https://pypi.python.org/pypi?%3Aaction=list_classifiers
80    classifiers=[
81        'Development Status :: 4 - Beta',
82        'License :: OSI Approved :: Apache Software License',
83        'Operating System :: POSIX :: Linux',
84        'Programming Language :: Python :: 2.7',
85    ],
86)
87
88all_extras = list(chain(params['extras_require'].itervalues()))
89params['extras_require']['full'] = all_extras
90
91setup(**params)
92