diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7b2a23c..c259283 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,6 +12,9 @@ jobs: - 3.7 - 3.8 - 3.9 + - "3.10" + - "3.11" + - "3.12" services: redis: diff --git a/aioredlock/redis.py b/aioredlock/redis.py index 27958c3..d38b644 100644 --- a/aioredlock/redis.py +++ b/aioredlock/redis.py @@ -2,7 +2,7 @@ import logging import re import time -from distutils.version import StrictVersion +from packaging.version import parse as parse_version from itertools import groupby import aioredis @@ -110,7 +110,7 @@ async def _create_redis_pool(*args, **kwargs): aioredis.create_pool(*args, **kwargs) """ - if StrictVersion(aioredis.__version__) >= StrictVersion('1.0.0'): # pragma no cover + if parse_version(aioredis.__version__) >= parse_version('1.0.0'): # pragma no cover return await aioredis.create_redis_pool(*args, **kwargs) else: # pragma no cover return await aioredis.create_pool(*args, **kwargs) diff --git a/setup.py b/setup.py index a823d78..bcc43ff 100644 --- a/setup.py +++ b/setup.py @@ -35,6 +35,9 @@ '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.12', ], keywords='redis redlock distributed locks asyncio', @@ -42,7 +45,7 @@ packages=find_packages(), python_requires='>=3.6', - install_requires=['aioredis<2.0.0', 'attrs >= 17.4.0'], + install_requires=['aioredis<2.0.0', 'attrs >= 17.4.0', 'packaging'], extras_require={ 'test': ['pytest==6.1.0', 'pytest-asyncio', 'pytest-mock', 'pytest-cov', 'flake8'], 'cicd': ['codecov'], diff --git a/tests/ut/test_redis.py b/tests/ut/test_redis.py index 693d93a..d6a53ba 100644 --- a/tests/ut/test_redis.py +++ b/tests/ut/test_redis.py @@ -379,9 +379,9 @@ def test_initialization(self, redis_two_connections): assert len(redis.instances) == 2 parametrize_methods = pytest.mark.parametrize("method_name, call_args", [ - ('set_lock', {'keys': ['resource'], 'args':['lock_id', 10000]}), - ('unset_lock', {'keys': ['resource'], 'args':['lock_id']}), - ('get_lock_ttl', {'keys': ['resource'], 'args':['lock_id']}), + ('set_lock', {'keys': ['resource'], 'args': ['lock_id', 10000]}), + ('unset_lock', {'keys': ['resource'], 'args': ['lock_id']}), + ('get_lock_ttl', {'keys': ['resource'], 'args': ['lock_id']}), ]) @pytest.mark.asyncio