Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

Port redis-py impl and tests to aioredis. #891

Merged
merged 12 commits into from Mar 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
150 changes: 42 additions & 108 deletions .github/workflows/ci.yml
Expand Up @@ -57,11 +57,23 @@ jobs:
os: [ubuntu-latest]
pyver: [3.6, 3.7, 3.8, 3.9, pypy3]
uvloop: [uvloop, no-uvloop]
redis: [5.0.10, 6.0.10]
exclude:
- pyver: pypy3
uvloop: uvloop
os: ubuntu-latest
- { pyver: pypy3, uvloop: uvloop, os: ubuntu-latest, redis: 5.0.10 }
- { pyver: pypy3, uvloop: uvloop, os: ubuntu-latest, redis: 6.0.10 }
fail-fast: false
services:
redis:
image: redis:${{ matrix.redis }}
ports:
# Maps port 6379 on service container to the host
- 6379:6379
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
runs-on: ${{ matrix.os }}
timeout-minutes: 15
env:
Expand All @@ -75,30 +87,17 @@ jobs:
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- name: Cache Redis Server (${{ runner.os }})
uses: actions/cache@v2.1.4
with:
key: pip-ci-${{ runner.os }}-${{ hashFiles('**/requirements.txt', 'Makefile') }}
path: ${{ github.workspace }}/redis
restore-keys: |
pip-ci-${{ runner.os }}-
- name: Install Redis Server (${{ runner.os }})
if: startsWith(runner.os, 'Linux')
run: |
sudo apt install socat
make ci-prune-old-redis
make -j ci-build-redis
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)" # - name: Cache
echo "::set-output name=dir::$(pip cache dir)"
- name: Cache PyPI
uses: actions/cache@v2.1.4
with:
key: pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ hashFiles('**/requirements.txt') }}
path: ${{ steps.pip-cache.outputs.dir }}
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-
pip-ci-${{ runner.os }}-${{ matrix.pyver }}
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
Expand All @@ -121,93 +120,28 @@ jobs:
env_vars: OS
fail_ci_if_error: false

test-windows:
name: Test Windows
needs: lint
strategy:
matrix:
os: [windows-latest]
pyver: [3.6, 3.7, 3.8, 3.9, pypy3]
uvloop: [no-uvloop]
fail-fast: false
runs-on: ${{ matrix.os }}
continue-on-error: true
timeout-minutes: 15
env:
OS: ${{ matrix.os }}
INSTALL_DIR: ${{ github.workspace }}/redis
PYTEST_ADDOPTS: --${{ matrix.uvloop }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python ${{ matrix.pyver }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.pyver }}
- name: Cache Redis server
uses: actions/cache@v2.1.4
if: ${{ startsWith(runner.os, 'Windows') }}
with:
key: pip-ci-${{ runner.os }}-${{ hashFiles('**/requirements.txt') }}
path: ${{ github.workspace }}\redis
restore-keys: |
pip-ci-${{ runner.os }}-
- name: Install Redis Server
run: |
choco install redis-64 --version 3.0.503
- name: Get pip cache dir
id: pip-cache
run: |
echo "::set-output name=dir::$(pip cache dir)" # - name: Cache
- name: Cache PyPI
uses: actions/cache@v2.1.4
with:
key: pip-ci-${{ runner.os }}-${{ matrix.pyver }}-${{ hashFiles('**/requirements.txt') }}
path: ${{ steps.pip-cache.outputs.dir }}
restore-keys: |
pip-ci-${{ runner.os }}-${{ matrix.pyver }}-
- name: Install dependencies
uses: py-actions/py-dependency-install@v2
with:
path: tests/requirements.txt
- name: Install Self (windows)
if: ${{ startsWith(runner.os, 'Windows') }}
run: |
pip install -e . -c tests\requirements.txt
- name: Run unittests
if: ${{ startsWith(runner.os, 'Windows') }}
run: |
python -m pytest -svv --cov --cov-report=xml --junitxml=coverage.xml --redis-server=C:\\ProgramData\\chocolatey\\lib\\redis-64\\redis-server.exe
- name: Upload coverage
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unit
env_vars: OS
fail_ci_if_error: false

# deploy:
# name: Deploy
# runs-on: ubuntu-latest
# needs: test
# # Run only on pushing a tag
# if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Setup Python 3.8
# uses: actions/setup-python@v2
# with:
# python-version: 3.8
# - name: Install dependencies
# run:
# python -m pip install -U pip wheel twine
# - name: Make dists
# run:
# python setup.py sdist bdist_wheel
# - name: PyPI upload
# env:
# TWINE_USERNAME: __token__
# TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
# run: |
# twine upload dist/*
deploy:
name: Deploy
runs-on: ubuntu-latest
needs: test-unix
# Run only on pushing a tag
if: github.event_name == 'push' && contains(github.ref, 'refs/tags/')
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run:
python -m pip install -U pip wheel twine
- name: Make dists
run:
python setup.py sdist bdist_wheel
- name: PyPI upload
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
twine upload dist/*
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -54,7 +54,7 @@ coverage.xml
*.pot

# Sphinx documentation
docs/_build/
sphinx/_build/

# OS hidden files
.DS_Store
Expand Down
3 changes: 2 additions & 1 deletion .pre-commit-config.yaml
Expand Up @@ -32,6 +32,7 @@ repos:
^docs/[^/]*\.svg$
- id: requirements-txt-fixer
- id: trailing-whitespace
types: [python]
- id: file-contents-sorter
files: |
CONTRIBUTORS.txt|
Expand All @@ -57,7 +58,7 @@ repos:
rev: 'v2.10.0'
hooks:
- id: pyupgrade
args: ['--py36-plus']
args: ['--py36-plus', '--keep-mock']
- repo: https://gitlab.com/pycqa/flake8
rev: '3.9.0'
hooks:
Expand Down
14 changes: 6 additions & 8 deletions CHANGES/template.jinja → .towncrier.md.jinja
@@ -1,31 +1,29 @@
{% for section, _ in sections.items() %}
{% set underline = underlines[0] %}{% if section %}{{section}}
{{ underline * section|length }}{% set underline = underlines[1] %}
{% endif %}
{%- if section %}{{section}}{% endif -%}

{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section]%}
{{ definitions[category]['name'] }}
{{ underline * definitions[category]['name']|length }}
### {{ definitions[category]['name'] }}

{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category].items() %}
- {{ text }}
(see {{ values|join(',\n ') }});
(see {{ values|join(', ') }})
{% endfor %}

{% else %}
- {{ sections[section][category]['']|join(',\n ') }};
- {{ sections[section][category]['']|join(', ') }}

{% endif %}
{% if sections[section][category]|length == 0 %}
No significant changes.

{% else %}
{% endif %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
{% endfor %}
105 changes: 0 additions & 105 deletions .travis.yml

This file was deleted.