Skip to content

Fix DeprecationWarning caused by mixing valkey and redis classes #2114

Fix DeprecationWarning caused by mixing valkey and redis classes

Fix DeprecationWarning caused by mixing valkey and redis classes #2114

Workflow file for this run

---
name: Unit tests
on:
push:
branches:
- master
pull_request:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
ruff:
uses: ./.github/workflows/lint.yml
basic_tests:
needs: ["ruff"]
name: Tests without server
uses: ./.github/workflows/test-no-matrix.yml
test:
needs: ["ruff", "basic_tests"]
runs-on: ubuntu-latest
strategy:
max-parallel: 8
fail-fast: false
matrix:
redis-image:
- "redis:8.6.1"
- "valkey/valkey:9.0.0"
- "redis:7.4.2"
- "valkey/valkey:8.1.3"
- "redis:6.2.17"
python-version: ["3.9", "3.12", "3.13", "3.14"]
redis-py: ["4.6.0", "5.3.1", "6.4.0", "7.2.1"]
install-extras: [false]
coverage: [false]
exclude:
- python-version: "3.9"
redis-py: "7.2.1"
- python-version: "3.13"
redis-image: "redis:8.6.1"
redis-py: "7.2.1"
install-extras: false
coverage: false
include:
- python-version: "3.13"
redis-image: "redis/redis-stack-server:6.2.6-v20"
redis-py: "7.2.1"
install-extras: true
- python-version: "3.13"
redis-image: "redis/redis-stack-server:7.4.0-v3"
redis-py: "7.2.1"
install-extras: true
- python-version: "3.13"
redis-image: "redis:8.6.1"
redis-py: "7.2.1"
install-extras: true
coverage: true
permissions:
pull-requests: write
services:
keydb:
image: ${{ matrix.redis-image }}
ports:
- 6390:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
name: >
tests
${{ matrix.redis-image }},
py${{ matrix.python-version }},redis-py:${{ matrix.redis-py }},
cov:${{ matrix.coverage }},extra:${{matrix.install-extras}}
outputs:
version: ${{ steps.getVersion.outputs.VERSION }}
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@v7
- uses: actions/setup-python@v6
with:
cache-dependency-path: uv.lock
python-version: ${{ matrix.python-version }}
- name: Install dependencies
env:
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
run: |
uv sync --extra lua --extra valkey
if [ ${{ matrix.install-extras }} == true ]; then
uv sync --all-extras
fi
uv pip install redis==${{ matrix.redis-py }}
- name: Get version
id: getVersion
shell: bash
run: |
VERSION=$(uv version --short)
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Test without coverage
timeout-minutes: 4
if: ${{ !matrix.coverage }}
run: |
uv run pytest -v -m "not slow and not tcp_server"
- name: Test with coverage
if: ${{ matrix.coverage }}
uses: ./.github/actions/test-coverage
with:
github-secret: ${{ secrets.GITHUB_TOKEN }}
gist-secret: ${{ secrets.GIST_SECRET }}