-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathsetup.py
81 lines (71 loc) · 2.14 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
import re
from setuptools import setup, find_packages
from pathlib import Path
try:
import swagger_ui
except ImportError:
pass
else:
if not Path(swagger_ui.STATIC_DIR).exists():
swagger_ui.setup_ui('2.2.10')
swagger_ui.setup_ui('3.52.5')
swagger_ui.setup_ui('4.10.3')
def read(f):
path = Path(__file__).parent / f
if not path.exists():
return ''
return path.read_text(encoding='latin1').strip()
def get_version():
text = read('aiohttp_apiset/version.py')
if not text:
text = read('aiohttp_apiset/__init__.py')
try:
return re.findall(r"^__version__ = '([^']+)'$", text, re.M)[0]
except IndexError:
raise RuntimeError('Unable to determine version.')
install_requires = [
'aiohttp>=2,<4',
'pyyaml',
'jsonschema',
]
tests_require = [
'pytest',
'pytest-aiohttp',
'pytest-mock',
'pytest-cov',
'aiohttp-jinja2',
]
setup(
name='aiohttp-apiset',
version=get_version(),
description='Build routes using swagger specification',
long_description=read('README.rst') + '\n\n' + read('HISTORY.rst'),
classifiers=[
'License :: OSI Approved :: Apache Software License',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Internet :: WWW/HTTP'],
author='Alexander Malev',
author_email='[email protected]',
url='https://github.com/aamalev/aiohttp_apiset/',
license='Apache 2',
packages=[i for i in find_packages() if i.startswith('aiohttp_apiset')],
python_requires='>=3.5.3',
install_requires=install_requires,
tests_require=tests_require,
include_package_data=True,
extras_require={
'docs': [
'sphinx >= 1.4.8',
'sphinx_rtd_theme',
],
'dev': tests_require,
},
)