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