Skip to content

implement valkey support #975

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

Draft
wants to merge 19 commits into
base: master
Choose a base branch
from
Draft
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
18 changes: 9 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,26 +51,26 @@ jobs:
matrix:
os: [ubuntu]
pyver: ['3.9', '3.10', '3.11', '3.12', '3.13']
redis: ['latest']
valkey: ['latest']
ujson: ['']
include:
- os: ubuntu
pyver: pypy-3.9
redis: 'latest'
valkey: 'latest'
- os: ubuntu
pyver: '3.9'
redis: '5.0.14'
valkey: '7.2.8'
- os: ubuntu
pyver: '3.9'
redis: 'latest'
valkey: 'latest'
ujson: 'ujson'
services:
redis:
image: redis:${{ matrix.redis }}
valkey:
image: valkey/valkey:${{ matrix.valkey }}
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-cmd "valkey-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
Expand Down Expand Up @@ -104,12 +104,12 @@ jobs:
- name: Run functional tests
run: bash examples/run_all.sh
- name: Uninstall optional backends
run: pip uninstall -y aiomcache redis
run: pip uninstall -y aiomcache valkey-glide
- name: Run unittests with minimal backend set
env:
COLOR: 'yes'
run: |
pytest --cov-report xml --cov-report html --cov-append tests/acceptance tests/ut -m "not memcached and not redis" --ignore "tests/ut/backends/test_memcached.py" --ignore "tests/ut/backends/test_redis.py"
pytest --cov-report xml --cov-report html --cov-append tests/acceptance tests/ut -m "not memcached and not valkey" --ignore "tests/ut/backends/test_memcached.py" --ignore "tests/ut/backends/test_valkey.py"
- name: Produce coverage report
run: python -m coverage xml
- name: Upload coverage
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ celerybeat-schedule
.env

# virtualenv
.venv/
venv/
ENV/

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ lint:
flake8 tests/ aiocache/

install-dev:
pip install -e .[redis,memcached,msgpack,dev]
pip install -e .[valkey,memcached,msgpack,dev]

pylint:
pylint --disable=C0111 aiocache
Expand Down
10 changes: 5 additions & 5 deletions aiocache/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
_AIOCACHE_CACHES: list[Type[BaseCache[Any]]] = [SimpleMemoryCache]

try:
import redis
import glide
except ImportError:
logger.debug("redis not installed, RedisCache unavailable")
logger.debug("glide not installed, ValkeyCache unavailable")
else:
from aiocache.backends.redis import RedisCache
from aiocache.backends.valkey import ValkeyCache

_AIOCACHE_CACHES.append(RedisCache)
del redis
_AIOCACHE_CACHES.append(ValkeyCache)
del glide

try:
import aiomcache
Expand Down
209 changes: 0 additions & 209 deletions aiocache/backends/redis.py

This file was deleted.

Loading
Loading