-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
66 lines (55 loc) · 2.19 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python
import io
import os
import re
from setuptools import setup
from setuptools import find_packages
from setuptools.command.test import test as TestCommand
def find_version(filename):
"""Uses re to pull out the assigned value to __version__ in filename."""
with io.open(filename, "r", encoding="utf-8") as version_file:
version_match = re.search(r'^__version__ = [\'"]([^\'"]*)[\'"]',
version_file.read(), re.M)
if version_match:
return version_match.group(1)
return "0.0-version-unknown"
class PyTest(TestCommand):
"""TestCommand subclass to use pytest with setup.py test."""
def finalize_options(self):
"""Find our package name and test options to fill out test_args."""
TestCommand.finalize_options(self)
self.test_args = ['-rx', '--cov', 'aws_ork',
'--cov-report', 'term-missing']
self.test_suite = True
def run_tests(self):
"""Taken from http://pytest.org/latest/goodpractises.html."""
# have to import here, outside the eggs aren't loaded
import pytest
errno = pytest.main(self.test_args)
raise SystemExit(errno)
if os.path.isfile("README.rst"):
with io.open("README.rst", encoding="utf-8") as opendescr:
long_description = opendescr.read()
else:
long_description = __doc__
setup(name='aws_ork',
version=find_version("aws_ork/__init__.py"),
description='Daemon listening on SQS for messages from an ASG',
author='Stefan Reimer',
author_email='[email protected]',
url='https://github.com/TriNimbus/aws-ork',
packages=find_packages(),
include_package_data=True,
entry_points={'console_scripts': [
"aws_ork = aws_ork:main" ]},
install_requires=['boto3', 'salt', 'python-daemon'],
tests_require=["pytest-cov", "moto", "mock", 'pytest'],
cmdclass={"test": PyTest},
long_description=long_description,
classifiers=[
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"Operating System :: POSIX",
"Programming Language :: Python",
"License :: OSI Approved :: MIT License",
])