Skip to content

Drop hard dependency on redis-py; test on Valkey too #176

Drop hard dependency on redis-py; test on Valkey too

Drop hard dependency on redis-py; test on Valkey too #176

Workflow file for this run

name: CI
on:
push:
branches:
- master
tags:
- 'v*'
pull_request:
branches:
- master
env:
PIP_DISABLE_PIP_VERSION_CHECK: '1'
jobs:
Test:
runs-on: ubuntu-24.04
strategy:
matrix:
include:
# With the Redis client
- { python-version: '3.10', install-extra: '[redis]' }
- { python-version: '3.11', install-extra: '[redis]' }
- { python-version: '3.12', install-extra: '[redis]' }
- { python-version: '3.13', install-extra: '[redis]' }
- { python-version: '3.13', install-extra: '[redis,sentry]'}
# With the Valkey server
- { python-version: '3.13', install-extra: '[redis]', redis-image: 'valkey/valkey:8'}
# With the Valkey client and Valkey server
- { python-version: '3.13', install-extra: '[valkey,sentry]', redis-image: 'valkey/valkey:8'}
services:
redis:
image: ${{ matrix.redis-image || 'redis' }}
ports:
- 6379:6379
env:
REDIS_URL: 'redis://localhost:6379/0'
SENTRY_DSN: 'http://user:pass@localhost:12340/foo'
steps:
- uses: actions/checkout@v5
- name: 'Set up Python ${{ matrix.python-version }}'
uses: astral-sh/setup-uv@v6
with:
python-version: '${{ matrix.python-version }}'
activate-environment: true
- run: 'uv pip install -e ".$EXTRA"'
env:
EXTRA: '${{ matrix.install-extra }}'
- run: uv run pytest -vvv --cov .
- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: 'Python ${{ matrix.python-version }}'
Lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: akx/pre-commit-uv-action@v0.1.0
Mypy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
with:
python-version: '3.13'
- run: uv run --all-extras mypy --strict --install-types --non-interactive --show-error-codes minique
Build:
runs-on: ubuntu-24.04
needs: [ Lint, Mypy, Test ]
steps:
- uses: actions/checkout@v5
- uses: astral-sh/setup-uv@v6
with:
python-version: '3.13'
- run: uv build
- run: uvx twine check dist/*
- uses: actions/upload-artifact@v4
with:
name: build
path: dist
- name: Publish distribution to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
print_hash: true
password: ${{ secrets.PYPI_API_TOKEN }}