Updated Apex Exceptions
[releng-anteater.git] / setup.py
1 # -*- coding: utf-8 -*-
2 from __future__ import absolute_import
3 import re
4 import sys
5 from setuptools.command.test import test as TestCommand
6 from setuptools import setup, find_packages
7
8 REQUIRES = [
9     'docopt',
10     'six',
11     'binaryornot',
12     'PyYAML',
13 ]
14
15
16 class PyTest(TestCommand):
17     def finalize_options(self):
18         TestCommand.finalize_options(self)
19         self.test_args = []
20         self.test_suite = True
21
22     def run_tests(self):
23         import pytest
24         errcode = pytest.main(self.test_args)
25         sys.exit(errcode)
26
27
28 def find_version(fname):
29     '''Attempts to find the version number in the file names fname.
30     Raises RuntimeError if not found.
31     '''
32     version = ''
33     with open(fname, 'r') as fp:
34         reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
35         for line in fp:
36             m = reg.match(line)
37             if m:
38                 version = m.group(1)
39                 break
40     if not version:
41         raise RuntimeError('Cannot find version information')
42     return version
43
44 __version__ = find_version("anteater/main.py")
45
46
47 def read(fname):
48     with open(fname) as fp:
49         content = fp.read()
50     return content
51
52 setup(
53     name='anteater',
54     version="0.1",
55     description='anteater',
56     long_description=read("README.md"),
57     author='Luke Hinds',
58     author_email='lhinds@redhat.com',
59     url='https://gerrit.opnfv.org/gerrit/gitweb?p=releng-anteater.git',
60     install_requires=REQUIRES,
61     license=read("LICENSE"),
62     zip_safe=False,
63     keywords='anteater',
64     classifiers=[
65         'Development Status :: 2 - Pre-Alpha',
66         'Intended Audience :: Developers',
67         'License :: OSI Approved :: Apache Software License',
68         'Natural Language :: English',
69         "Programming Language :: Python :: 2",
70         'Programming Language :: Python :: 2.7',
71         "Programming Language :: Python :: 3",
72         'Programming Language :: Python :: 3.4',
73         'Programming Language :: Python :: Implementation :: CPython',
74         'Programming Language :: Python :: Implementation :: PyPy'
75     ],
76     packages=find_packages(),
77     entry_points={
78         'console_scripts': [
79             "anteater = anteater.main:main"
80         ]
81     },
82     tests_require=['pytest'],
83     cmdclass={'test': PyTest}
84 )