1import os
2import re
3import sys
4from setuptools import setup, find_packages
5
6
7install_requires = ['PyMySQL>=0.9']
8
9PY_VER = sys.version_info
10
11
12if not PY_VER >= (3, 5, 3):
13    raise RuntimeError("aiomysql doesn't support Python earlier than 3.5.3")
14
15
16def read(f):
17    return open(os.path.join(os.path.dirname(__file__), f)).read().strip()
18
19
20extras_require = {'sa': ['sqlalchemy>=1.0'], }
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                           'aiomysql', '__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        else:
33            raise RuntimeError('Cannot find version in aiomysql/__init__.py')
34
35
36classifiers = [
37    'License :: OSI Approved :: MIT License',
38    'Intended Audience :: Developers',
39    'Programming Language :: Python :: 3',
40    'Programming Language :: Python :: 3.5',
41    'Programming Language :: Python :: 3.6',
42    'Operating System :: POSIX',
43    'Environment :: Web Environment',
44    'Development Status :: 3 - Alpha',
45    'Topic :: Database',
46    'Topic :: Database :: Front-Ends',
47    'Framework :: AsyncIO',
48]
49
50keywords = ["mysql", "asyncio", "aiomysql"]
51
52
53setup(name='aiomysql',
54      version=read_version(),
55      description=('MySQL driver for asyncio.'),
56      long_description='\n\n'.join((read('README.rst'), read('CHANGES.txt'))),
57      classifiers=classifiers,
58      platforms=['POSIX'],
59      author="Nikolay Novik",
60      author_email="nickolainovik@gmail.com",
61      url='https://github.com/aio-libs/aiomysql',
62      download_url='https://pypi.python.org/pypi/aiomysql',
63      license='MIT',
64      packages=find_packages(exclude=['tests', 'tests.*']),
65      install_requires=install_requires,
66      extras_require=extras_require,
67      keywords=keywords,
68      include_package_data=True)
69