forked from gthank/django-mysqlpool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
77 lines (64 loc) · 2.4 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
#!/bin/env python
# -*- coding: utf-8 -*-
"""The setup script for ``django_mysqlpool``."""
# These imports make 2 act like 3, making it easier on us to switch to PyPy or
# some other VM if we need to for performance reasons.
from __future__ import (absolute_import, print_function, unicode_literals,
division)
# Make ``Foo()`` work the same in Python 2 as it does in Python 3.
__metaclass__ = type
import re
from setuptools import setup, find_packages
REQUIRES = [
"SQLAlchemy >=1.0, <2.0",
]
def find_version(fname):
"""Attempt to find the version number in the file names fname.
Raises ``RuntimeError`` if not found.
"""
version = ""
with open(fname, "r") as fp:
reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]')
for line in fp:
m = reg.match(line)
if m:
version = m.group(1)
break
if not version:
raise RuntimeError("Cannot find version information")
return version
__version__ = find_version("django_mysqlpool/__init__.py")
def read(fname):
"""Return the contents of the file-like ``fname``."""
with open(fname) as fp:
content = fp.read()
return content
setup(
name="django-mysqlpool",
version=__version__,
description="Django database backend for MySQL that provides pooling ala SQLAlchemy.", # noqa
long_description=read("README.rst"),
author=["Ben Timby", "Hank Gay"],
author_email=["[email protected]", "[email protected]"],
maintainer=["Ben Timby", "Hank Gay"],
maintainer_email=["[email protected]", "[email protected]"],
url="https://github.com/gthank/django-mysqlpool",
install_requires=REQUIRES,
license=read("LICENSE"),
zip_safe=False,
classifiers=[
"License :: OSI Approved :: MIT License",
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy"
],
packages=find_packages(),
)