-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
99 lines (83 loc) · 2.47 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
"""
Sanic-Redis
"""
import sys
from setuptools import find_packages, setup
from setuptools.command.test import test as TestCommand
from sanic_redis import __version__ as version
class PyTest(TestCommand):
"""
Provide a Test runner to be used from setup.py to run unit tests
"""
user_options = [("pytest-args=", "a", "Arguments to pass to pytest")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = ""
def run_tests(self):
import shlex
import pytest
errno = pytest.main(shlex.split(self.pytest_args))
sys.exit(errno)
setup_kwargs = {
"name": "sanic-redis",
"version": version,
"url": "https://github.com/strahe/sanic-redis",
"license": "MIT",
"author": "octal",
"author_email": "[email protected]",
"description": (
'Adds redis support to Sanic'
),
"long_description": 'sanic-redis is a Sanic framework extension which adds support for the redis.',
"packages": find_packages(exclude=("tests", "tests.*")),
"platforms": "any",
"python_requires": ">=3.7",
"keywords": ['sanic', 'redis', 'hiredis'],
"zip_safe": False,
"classifiers": [
"Development Status :: 4 - Beta",
"Environment :: Web Environment",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
'Programming Language :: Python :: 3 :: Only',
'Topic :: Internet :: WWW/HTTP :: Session',
],
}
env_dependency = (
'; sys_platform != "win32" ' 'and implementation_name == "cpython"'
)
ujson = "ujson>=1.35" + env_dependency
uvloop = "uvloop>=0.15.0" + env_dependency
types_ujson = "types-ujson" + env_dependency
requirements = [
"sanic",
"redis>=5.0.0",
"hiredis==2.3.2"
]
tests_require = [
"sanic-testing>=22.9.0",
"pytest==8.0.*",
"coverage",
"beautifulsoup4",
"pytest-sanic",
"pytest-benchmark",
"chardet==3.*",
"flake8",
"black",
"isort>=5.0.0",
"bandit",
"mypy>=0.901,<0.910",
"docutils",
"pygments",
"uvicorn<0.15.0",
"slotscheck>=0.8.0,<1",
types_ujson,
]
setup_kwargs["install_requires"] = requirements
setup_kwargs["tests_require"] = tests_require
setup_kwargs["cmdclass"] = {"test": PyTest}
setup(**setup_kwargs)