forked from eukaryote/pytest-tornasync
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
79 lines (63 loc) · 2.11 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
import sys
import os
from setuptools import setup
from setuptools.command.test import test
import pytest_tornasync
here_dir = os.path.abspath(os.path.dirname(__file__))
# require python-3.5+, since we only support the native coroutine 'async def'
# style for tests that were introduced in python 3.5.
if sys.version_info < (3, 5):
print("pytest-tornasync requires Python 3.5 or newer")
sys.exit(1)
def read(*filenames):
buf = []
for filename in filenames:
filepath = os.path.join(here_dir, filename)
try:
with open(filepath) as f:
buf.append(f.read())
except FileNotFoundError:
pass
return '\n\n'.join(buf)
class PyTest(test):
def finalize_options(self):
test.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
status = pytest.main(self.test_args)
sys.exit(status)
_reqs = ['pytest>=3.0', 'tornado>=5.0']
setup(
name='pytest-tornasync',
version=pytest_tornasync.__version__,
license='http://www.opensource.org/licenses/mit-license.php',
url='https://github.com/eukaryote/pytest-tornasync',
description='py.test plugin for testing Python 3.5+ Tornado code',
long_description=read('README.rst', 'CHANGES.rst'),
keywords='testing py.test tornado',
author='Calvin Smith',
author_email='sapientdust+pytest-tornasync@gmail.com',
packages=[pytest_tornasync.__name__],
platforms='any',
cmdclass={'test': PyTest},
install_requires=_reqs,
tests_require=_reqs,
test_suite='tests',
entry_points={
'pytest11': ['tornado = pytest_tornasync.plugin'],
},
classifiers=[
'Programming Language :: Python :: 3 :: Only',
'License :: OSI Approved :: MIT License',
'Environment :: Console',
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Framework :: Pytest',
'Topic :: Software Development :: Testing',
] + [
("Programming Language :: Python :: %s" % x)
for x in "3 3.4 3.5 3.6 3.7".split()
]
)