-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
78 lines (64 loc) · 2.06 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
import sys
import os
import re
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
user_options = [('pytest-args=', 'a', "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ''
def run_tests(self):
import shlex
# import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
here = os.path.dirname(__file__)
with open(os.path.join(here, 'uadetector', '__init__.py'), 'r') as f:
version = re.compile(
r".*__version__ = '(.*?)'", re.S).match(f.read()).group(1)
readme = open(os.path.join(here, 'README.rst')).read()
requires = [
'woothee',
]
tests_require = [
'Django',
'Flask',
'Pyramid',
'tornado',
'pytest-django',
'pytest-cov',
'pytest',
'webtest',
]
classifiers = [
'Development Status :: 3 - Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Topic :: Internet :: WWW/HTTP',
'Topic :: Software Development :: Libraries',
]
setup(
name='uadetector',
version=version,
description='WSGI Middleware and web framework extensions for handling User-Agent.', # NOQA
long_description=readme,
url='https://github.com/tell-k/uadetector',
author='tell-k',
author_email='[email protected]',
classifiers=classifiers,
keywords=['user_agent', 'web', 'browser', 'detector', 'handling'],
install_requires=requires,
tests_require=tests_require,
cmdclass={'test': PyTest},
packages=find_packages(exclude=['tests*']),
license='MIT',
)