forked from emcache/emcache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
72 lines (61 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
import os
import re
import sys
from setuptools import Extension, setup
if sys.platform in ("win32", "cygwin", "cli"):
raise RuntimeError("emcache does not support Windows at the moment")
vi = sys.version_info
if vi < (3, 7):
raise RuntimeError("emcache requires Python 3.7 or greater")
MURMUR3_DIR = os.path.join(os.path.dirname(__file__), "vendor", "murmur3")
extensions = [
Extension(
"emcache._cython.cyemcache",
sources=["emcache/_cython/cyemcache.c"],
include_dirs=[MURMUR3_DIR],
library_dirs=[MURMUR3_DIR],
libraries=["murmur3"],
)
]
dev_requires = [
"Cython==0.29.32",
"pytest==6.2.5",
"pytest-mock==3.1.0",
"pytest-asyncio==0.11.0",
"pytest-cov==2.8.1",
"black==22.3.0",
"isort==4.3.21",
"flake8==3.7.9",
]
def get_version():
with open(os.path.join(os.path.abspath(os.path.dirname(__file__)), "emcache/version.py")) as fp:
try:
return re.findall(r"^__version__ = \"([^']+)\"\r?$", fp.read())[0]
except IndexError:
raise RuntimeError("Unable to determine version.")
with open(os.path.join(os.path.dirname(__file__), "README.rst")) as f:
readme = f.read()
setup(
version=get_version(),
name="emcache",
description="A high performance asynchronous Python client for Memcached with full batteries included",
long_description=readme,
url="http://github.com/emcache/emcache",
author="Pau Freixes",
author_email="[email protected]",
platforms=["*nix"],
packages=["emcache"],
ext_modules=extensions,
extras_require={"dev": dev_requires},
classifiers=[
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"License :: OSI Approved :: Apache Software License",
"License :: OSI Approved :: MIT License",
"Intended Audience :: Developers",
],
)