This repository has been archived by the owner on Aug 30, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 26
/
Copy pathsetup.py
98 lines (78 loc) · 2.4 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
"""
raven-aiohttp
=============
A transport for `raven-python <https://github.com/getsentry/raven-python>`_
which supports Python 3's asyncio interface.
:copyright: (c) 2015 Functional Software, Inc
:license: BSD, see LICENSE for more details.
"""
import io
import os
import re
import sys
from setuptools import setup
from setuptools.command.test import test as TestCommand
def get_version():
regex = r"__version__\s=\s\'(?P<version>.+?)\'"
return re.search(regex, read('raven_aiohttp.py')).group('version')
def read(*parts):
filename = os.path.join(os.path.abspath(os.path.dirname(__file__)), *parts)
with io.open(filename, encoding='utf-8', mode='rt') as fp:
return fp.read()
tests_require = [
'flake8',
'isort',
'pytest',
'pytest-asyncio<0.6.0', # to support Python 3.5-
'pytest-cov',
'pytest-mock'
]
install_requires = [
'aiohttp>=2.0',
'raven>=5.4.0',
]
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(
name='raven-aiohttp',
version=get_version(),
author='David Cramer',
author_email='[email protected]',
url='https://github.com/getsentry/raven-aiohttp',
description='An asyncio transport for raven-python',
long_description=read('README.rst'),
py_modules=['raven_aiohttp'],
zip_safe=False,
install_requires=install_requires,
extras_require={
'test': tests_require,
},
cmdclass={
'test': PyTest,
},
license='BSD',
classifiers=[
'Intended Audience :: Developers',
'Intended Audience :: System Administrators',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Software Development',
],
)