-
-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathsetup.py
executable file
·67 lines (53 loc) · 1.88 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
"""
setup.py for limits
"""
__author__ = "Ali-Akber Saifee"
__email__ = "[email protected]"
__copyright__ = "Copyright 2023, Ali-Akber Saifee"
import itertools
import os
from setuptools import find_packages, setup
import versioneer
THIS_DIR = os.path.abspath(os.path.dirname(__file__))
def get_requirements(req_file):
requirements = []
for r in open(os.path.join(THIS_DIR, "requirements", req_file)).read().splitlines():
if r.strip():
requirements.append(r.strip())
return requirements
EXTRA_REQUIREMENTS = {
"redis": get_requirements("storage/redis.txt"),
"rediscluster": get_requirements("storage/rediscluster.txt"),
"memcached": get_requirements("storage/memcached.txt"),
"mongodb": get_requirements("storage/mongodb.txt"),
"etcd": get_requirements("storage/etcd.txt"),
"async-redis": get_requirements("storage/async-redis.txt"),
"async-memcached": get_requirements("storage/async-memcached.txt"),
"async-mongodb": get_requirements("storage/async-mongodb.txt"),
"async-etcd": get_requirements("storage/async-etcd.txt"),
}
EXTRA_REQUIREMENTS["all"] = list(itertools.chain(*EXTRA_REQUIREMENTS.values()))
setup(
name="limits",
author=__author__,
author_email=__email__,
license="MIT",
url="https://limits.readthedocs.org",
project_urls={
"Source": "https://github.com/alisaifee/limits",
},
zip_safe=False,
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
install_requires=get_requirements("main.txt"),
classifiers=[k for k in open("CLASSIFIERS").read().split("\n") if k],
description="Rate limiting utilities",
long_description=open("README.rst").read(),
packages=find_packages(exclude=["tests*"]),
python_requires=">=3.9",
extras_require=EXTRA_REQUIREMENTS,
include_package_data=True,
package_data={
"limits": ["py.typed"],
},
)