Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

from aioredis change to redis #4

Merged
merged 1 commit into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ using as so,
redis_store = RedisStore(address)
RateLimiter(app, store=redis_store)
This store uses `aioredis <https://github.com/aio-libs/aioredis>`_,
This store uses `redis <https://github.com/redis/redis-py>`_,
and any extra keyword arguments passed to the ``RedisStore``
constructor will be passed to the aioredis ``create_redis`` function.
constructor will be passed to the redis ``create_redis`` function.

A custom store is possible, see the ``RateLimiterStoreABC`` for the
required interface.
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,13 @@ warn_unused_ignores = true
[tool.poetry.dependencies]
python = ">=3.7"
quart = ">=0.15"
aioredis = { version = ">=2.0", optional = true }
redis = { version = ">=4.4.0", optional = true }

[tool.poetry.dev-dependencies]
tox = "*"

[tool.poetry.extras]
redis = ["aioredis"]
redis = ["redis"]

[tool.pytest.ini_options]
addopts = "--no-cov-on-fail --showlocals --strict-markers"
Expand Down
4 changes: 2 additions & 2 deletions src/quart_rate_limiter/redis_store.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from datetime import datetime
from typing import Any, Optional

import aioredis
from redis import asyncio as aioredis

from .store import RateLimiterStoreABC

Expand All @@ -12,7 +12,7 @@ class RedisStore(RateLimiterStoreABC):
Arguments:
address: The address of the redis instance.
kwargs: Any keyword arguments to pass to the redis client on
creation, see the aioredis documentation.
creation, see the redis documentation.
"""

def __init__(self, address: str, **kwargs: Any) -> None:
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ isolated_build = True

[testenv]
deps =
aioredis
redis
pytest
pytest-asyncio
pytest-cov
Expand All @@ -14,7 +14,7 @@ commands = pytest --cov=quart_rate_limiter {posargs}
[testenv:redis]
basepython = python3.10
deps =
aioredis
redis
pytest
pytest-asyncio
pytest-cov
Expand All @@ -41,7 +41,7 @@ commands = flake8 src/quart_rate_limiter/ tests/
[testenv:mypy]
basepython = python3.10
deps =
aioredis
redis
mypy
pytest
commands =
Expand Down