1import re
2import os.path
3import sys
4import platform
5from setuptools import setup, find_packages
6
7
8install_requires = ['async-timeout']
9if platform.python_implementation() == 'CPython':
10    install_requires.append('hiredis')
11
12PY_VER = sys.version_info
13
14if PY_VER < (3, 5):
15    raise RuntimeError("aioredis doesn't support Python version prior 3.5")
16
17
18def read(*parts):
19    with open(os.path.join(*parts), 'rt') as f:
20        return f.read().strip()
21
22
23def read_version():
24    regexp = re.compile(r"^__version__\W*=\W*'([\d.abrc]+)'")
25    init_py = os.path.join(os.path.dirname(__file__),
26                           'aioredis', '__init__.py')
27    with open(init_py) as f:
28        for line in f:
29            match = regexp.match(line)
30            if match is not None:
31                return match.group(1)
32        raise RuntimeError('Cannot find version in {}'.format(init_py))
33
34
35classifiers = [
36    'License :: OSI Approved :: MIT License',
37    'Development Status :: 4 - Beta',
38    'Programming Language :: Python',
39    'Programming Language :: Python :: 3',
40    'Programming Language :: Python :: 3.5',
41    'Programming Language :: Python :: 3.6',
42    'Programming Language :: Python :: 3.7',
43    'Programming Language :: Python :: 3 :: Only',
44    'Operating System :: POSIX',
45    'Environment :: Web Environment',
46    'Intended Audience :: Developers',
47    'Topic :: Software Development',
48    'Topic :: Software Development :: Libraries',
49    'Framework :: AsyncIO',
50]
51
52setup(name='aioredis',
53      version=read_version(),
54      description=("asyncio (PEP 3156) Redis support"),
55      long_description="\n\n".join((read('README.rst'), read('CHANGES.txt'))),
56      classifiers=classifiers,
57      platforms=["POSIX"],
58      author="Alexey Popravka",
59      author_email="alexey.popravka@horsedevel.com",
60      url="https://github.com/aio-libs/aioredis",
61      license="MIT",
62      packages=find_packages(exclude=["tests"]),
63      install_requires=install_requires,
64      include_package_data=True,
65      )
66