File: setup.py

package info (click to toggle)
python-limits 4.4.1-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,064 kB
  • sloc: python: 7,833; makefile: 162; sh: 59
file content (69 lines) | stat: -rwxr-xr-x 2,049 bytes parent folder | download
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
"""
setup.py for limits


"""

__author__ = "Ali-Akber Saifee"
__email__ = "ali@indydevs.org"
__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"),
    "valkey": get_requirements("storage/valkey.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"),
    "async-valkey": get_requirements("storage/async-valkey.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.10",
    extras_require=EXTRA_REQUIREMENTS,
    include_package_data=True,
    package_data={
        "limits": ["py.typed"],
    },
)