diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ec10b71f8..a7e695a89 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,10 +1,12 @@ CHANGELOG ========= -6.4.3 (unreleased) +6.5.0 (unreleased) ------------------ -- Nothing changed yet. +- Deps: replace aioredis with redis-py +- Deps: updated flake8 so it won't depend on 'importlib-metadata<5' + [masipcat] 6.4.2 (2022-08-25) diff --git a/contrib-requirements.txt b/contrib-requirements.txt index 20233557e..9548b8b6a 100644 --- a/contrib-requirements.txt +++ b/contrib-requirements.txt @@ -1,8 +1,8 @@ -aioredis==2.0.0 +redis==4.3.4 html2text==2019.8.11 aiosmtplib==1.1.4 pre-commit==1.18.2 -flake8==3.9.2 +flake8==5.0.4 codecov==2.0.15 mypy-zope==0.3.2 black==22.3.0 diff --git a/docs/source/contrib/cache.md b/docs/source/contrib/cache.md index 8f474bdc8..22514b750 100644 --- a/docs/source/contrib/cache.md +++ b/docs/source/contrib/cache.md @@ -21,7 +21,7 @@ applications: This option is not recommended as they are not invalidating the memory objects. -Its needed to add `aioredis` as a dependency on your project +Its needed to add `redis` as a dependency on your project ### Configuration @@ -37,7 +37,7 @@ cache: This option is the recommended one for more than one process running guillotina on the same DB. -Its needed to add `aioredis` as a dependency on your project +Its needed to add `redis` as a dependency on your project ### Configuration diff --git a/guillotina/contrib/catalog/pg/indexes.py b/guillotina/contrib/catalog/pg/indexes.py index e06efd551..00f60737e 100644 --- a/guillotina/contrib/catalog/pg/indexes.py +++ b/guillotina/contrib/catalog/pg/indexes.py @@ -18,9 +18,9 @@ def idx_name(self) -> str: def get_index_sql(self, storage: IPostgresStorage) -> typing.List[str]: return [ f"""CREATE INDEX CONCURRENTLY IF NOT EXISTS {sqlq(self.idx_name)}_{sqlq(storage.objects_table_name.replace('.', '_'))} - ON {sqlq(storage.objects_table_name)} ((json->>'{sqlq(self.name)}'));""", + ON {sqlq(storage.objects_table_name)} ((json->>'{sqlq(self.name)}'));""", # noqa: E501 f"""CREATE INDEX CONCURRENTLY IF NOT EXISTS {sqlq(self.idx_name)}_{sqlq(storage.objects_table_name.replace('.', '_'))} - ON {sqlq(storage.objects_table_name)} USING gin ((json->'{sqlq(self.name)}'))""", + ON {sqlq(storage.objects_table_name)} USING gin ((json->'{sqlq(self.name)}'))""", # noqa: E501 ] def where(self, value, operator="=") -> str: diff --git a/guillotina/contrib/redis/driver.py b/guillotina/contrib/redis/driver.py index c07f7d0ca..bfc0b825a 100644 --- a/guillotina/contrib/redis/driver.py +++ b/guillotina/contrib/redis/driver.py @@ -1,14 +1,14 @@ try: - import aioredis + import redis.asyncio as aioredis except ImportError: - print("If you add guillotina.contrib.redis you need to add aioredis on your requirements") + print("If you add guillotina.contrib.redis you need to add redis>4.2.0rc1 on your requirements") raise -from aioredis.client import PubSub -from aioredis.exceptions import ConnectionError from guillotina import app_settings from guillotina import metrics from guillotina.contrib.redis.exceptions import NoRedisConfigured +from redis.asyncio.client import PubSub +from redis.exceptions import ConnectionError from typing import Dict from typing import List from typing import Optional diff --git a/requirements.txt b/requirements.txt index 7b9dc0253..d80b89b6f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -25,4 +25,5 @@ types-python-dateutil==0.1.6 types-pytz==2021.1.2 types-PyYAML==5.4.6 types-setuptools==57.0.2 -types-toml==0.1.5 \ No newline at end of file +types-toml==0.1.5 +types-redis==4.3.21 diff --git a/setup.py b/setup.py index dc7fe3e5b..f9518e44a 100644 --- a/setup.py +++ b/setup.py @@ -105,7 +105,7 @@ 'aiohttp>=3.0.0,<3.6.0;python_version<"3.8"', 'aiohttp>=3.6.0,<4.0.0;python_version>="3.8"', ], - "redis": ['aioredis==2.0.0'], + "redis": ['redis>=4.3.0'], "mailer": ["html2text>=2018.1.9", "aiosmtplib>=1.0.6"], "memcached": ["emcache"], "validation": ["pytz==2020.1"],