forked from aio-libs/aiocache
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
50 lines (39 loc) · 1.34 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
import re
import os
from setuptools import setup, find_packages
from distutils.util import strtobool
with open(
os.path.join(
os.path.abspath(os.path.dirname(__file__)),
'aiocache/_version.py')) as fp:
try:
version = re.findall(
r"^__version__ = '([^']+)'\r?$", fp.read(), re.M)[0]
except IndexError:
raise RuntimeError('Unable to determine version.')
aioredis = "aioredis>=0.3.3,<1"
aiomcache = "aiomcache>=0.5.2"
install_requires = set((aioredis, aiomcache))
setup_kwargs = {
'name': "aiocache",
'version': version,
'author': "Manuel Miranda",
'url': "https://github.com/argaen/aiocache",
'author_email': "manu.mirandad@gmail.com",
'description': "multi backend asyncio cache",
'classifiers': [
"Programming Language :: Python",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Framework :: AsyncIO",
],
'packages': find_packages(),
}
if not strtobool(os.environ.get("AIOCACHE_REDIS", "yes")):
print("Installing without aioredis")
install_requires.remove(aioredis)
if not strtobool(os.environ.get("AIOCACHE_MEMCACHED", "yes")):
print("Installing without aiomcache")
install_requires.remove(aiomcache)
setup_kwargs['install_requires'] = install_requires
setup(**setup_kwargs)