Skip to content

Commit 5a50825

Browse files
committed
master merge and unit tests
2 parents fa50356 + e0d3ba5 commit 5a50825

File tree

143 files changed

+31551
-6623
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+31551
-6623
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ _Please make sure to review and check all of these items:_
66
- [ ] Do the CI tests pass with this change (enable it first in your forked repo and wait for the github action build to finish)?
77
- [ ] Is the new or changed code fully tested?
88
- [ ] Is a documentation update included (if this change modifies existing APIs, or introduces new ones)?
9+
- [ ] Is there an example added to the examples folder (if applicable)?
910

1011
_NOTE: these things are not required to open a PR and can be done
1112
afterwards / while the PR is open._

.github/release-drafter-config.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name-template: 'Version $NEXT_PATCH_VERSION'
2+
tag-template: 'v$NEXT_PATCH_VERSION'
3+
autolabeler:
4+
- label: 'chore'
5+
files:
6+
- '*.md'
7+
- '.github/*'
8+
- label: 'bug'
9+
branch:
10+
- '/bug-.+'
11+
- label: 'chore'
12+
branch:
13+
- '/chore-.+'
14+
- label: 'feature'
15+
branch:
16+
- '/feature-.+'
17+
categories:
18+
- title: '🔥 Breaking Changes'
19+
labels:
20+
- 'breakingchange'
21+
- title: '🚀 New Features'
22+
labels:
23+
- 'feature'
24+
- 'enhancement'
25+
- title: '🐛 Bug Fixes'
26+
labels:
27+
- 'fix'
28+
- 'bugfix'
29+
- 'bug'
30+
- title: '🧰 Maintenance'
31+
label: 'chore'
32+
change-template: '- $TITLE (#$NUMBER)'
33+
exclude-labels:
34+
- 'skip-changelog'
35+
template: |
36+
## Changes
37+
38+
$CHANGES
39+
40+
## Contributors
41+
We'd like to thank all the contributors who worked on this release!
42+
43+
$CONTRIBUTORS
44+

.github/workflows/install_and_test.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
SUFFIX=$1
6+
if [ -z ${SUFFIX} ]; then
7+
echo "Supply valid python package extension such as whl or tar.gz. Exiting."
8+
exit 3
9+
fi
10+
11+
script=`pwd`/${BASH_SOURCE[0]}
12+
HERE=`dirname ${script}`
13+
ROOT=`realpath ${HERE}/../..`
14+
15+
cd ${ROOT}
16+
DESTENV=${ROOT}/.venvforinstall
17+
if [ -d ${DESTENV} ]; then
18+
rm -rf ${DESTENV}
19+
fi
20+
python -m venv ${DESTENV}
21+
source ${DESTENV}/bin/activate
22+
pip install --upgrade --quiet pip
23+
pip install --quiet -r dev_requirements.txt
24+
invoke devenv
25+
invoke package
26+
27+
# find packages
28+
PKG=`ls ${ROOT}/dist/*.${SUFFIX}`
29+
ls -l ${PKG}
30+
31+
TESTDIR=${ROOT}/STAGETESTS
32+
if [ -d ${TESTDIR} ]; then
33+
rm -rf ${TESTDIR}
34+
fi
35+
mkdir ${TESTDIR}
36+
cp -R ${ROOT}/tests ${TESTDIR}/tests
37+
cd ${TESTDIR}
38+
39+
# install, run tests
40+
pip install ${PKG}
41+
# Redis tests
42+
pytest -m 'not onlycluster'
43+
# RedisCluster tests
44+
CLUSTER_URL="redis://localhost:16379/0"
45+
pytest -m 'not onlynoncluster and not redismod and not ssl' --redis-url=${CLUSTER_URL}

.github/workflows/integration.yaml

Lines changed: 79 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,88 @@ name: CI
22

33
on:
44
push:
5+
paths-ignore:
6+
- 'docs/**'
7+
- '**/*.rst'
8+
- '**/*.md'
9+
branches:
10+
- master
511
pull_request:
12+
branches:
13+
- master
614

715
jobs:
8-
integration:
16+
17+
lint:
18+
name: Code linters
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: install python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: 3.9
26+
- name: run code linters
27+
run: |
28+
pip install -r dev_requirements.txt
29+
invoke linters
30+
31+
run-tests:
32+
runs-on: ubuntu-latest
33+
strategy:
34+
max-parallel: 6
35+
matrix:
36+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
37+
test-type: ['standalone', 'cluster']
38+
connection-type: ['hiredis', 'plain']
39+
env:
40+
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
41+
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
42+
steps:
43+
- uses: actions/checkout@v2
44+
- name: install python
45+
uses: actions/setup-python@v2
46+
with:
47+
python-version: ${{ matrix.python-version }}
48+
- name: run tests
49+
run: |
50+
pip install -r dev_requirements.txt
51+
bash docker/stunnel/create_certs.sh
52+
tox -e ${{matrix.test-type}}-${{matrix.connection-type}}
53+
- name: Upload codecov coverage
54+
uses: codecov/codecov-action@v2
55+
with:
56+
fail_ci_if_error: false
57+
token: ${{ secrets.CODECOV_TOKEN }}
58+
59+
build_and_test_package:
60+
name: Validate building and installing the package
61+
runs-on: ubuntu-latest
62+
strategy:
63+
matrix:
64+
extension: ['tar.gz', 'whl']
65+
steps:
66+
- uses: actions/checkout@v2
67+
- name: install python
68+
uses: actions/setup-python@v2
69+
with:
70+
python-version: 3.9
71+
- name: Run installed unit tests
72+
run: |
73+
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
74+
75+
install_package_from_commit:
76+
name: Install package from commit hash
977
runs-on: ubuntu-latest
78+
strategy:
79+
matrix:
80+
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
1081
steps:
1182
- uses: actions/checkout@v2
12-
- name: test
13-
run: make test
83+
- name: install python ${{ matrix.python-version }}
84+
uses: actions/setup-python@v2
85+
with:
86+
python-version: ${{ matrix.python-version }}
87+
- name: install from pip
88+
run: |
89+
pip install --quiet git+${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git@${GITHUB_SHA}

.github/workflows/pypi-publish.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish tag to Pypi
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
build_and_package:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: install python
14+
uses: actions/setup-python@v2
15+
with:
16+
python-version: 3.9
17+
- name: Install dev tools
18+
run: |
19+
pip install -r dev_requirements.txt
20+
pip install twine wheel
21+
22+
- name: Build package
23+
run: |
24+
python setup.py build
25+
python setup.py sdist bdist_wheel
26+
27+
- name: Publish to Pypi
28+
uses: pypa/gh-action-pypi-publish@release/v1
29+
with:
30+
user: __token__
31+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/release-drafter.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
# branches to consider in the event; optional, defaults to all
6+
branches:
7+
- master
8+
9+
jobs:
10+
update_release_draft:
11+
runs-on: ubuntu-latest
12+
steps:
13+
# Drafts your next Release notes as Pull Requests are merged into "master"
14+
- uses: release-drafter/release-drafter@v5
15+
with:
16+
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
17+
config-name: release-drafter-config.yml
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,7 @@ vagrant/.vagrant
1414
env
1515
venv
1616
coverage.xml
17+
.venv
18+
*.xml
19+
.coverage*
20+
docker/stunnel/keys

.readthedocs.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
version: 2
2+
3+
python:
4+
install:
5+
- requirements: ./docs/requirements.txt
6+
7+
build:
8+
os: ubuntu-20.04
9+
tools:
10+
python: "3.9"
11+
12+
sphinx:
13+
configuration: docs/conf.py

CHANGES

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,37 @@
1+
# DEPRECATED
2+
3+
This file is historic. Starting with redis-py 4.0.0b1, please see the GitHub releases page at
4+
https://github.com/redis/redis-py/releases.
5+
6+
------------------------------------------------------------------------------------------------
7+
18
* (in development)
29
* BACKWARDS INCOMPATIBLE: Removed support for end of life Python 2.7. #1318
310
* BACKWARDS INCOMPATIBLE: All values within Redis URLs are unquoted via
411
urllib.parse.unquote. Prior versions of redis-py supported this by
512
specifying the ``decode_components`` flag to the ``from_url`` functions.
613
This is now done by default and cannot be disabled. #589
7-
* POTENTIALLY INCOMPATIBLE: Redis commands were moved into a mixin
8-
(see commands.py). Anyone importing ``redis.client`` to access commands
9-
directly should import ``redis.commands``.
14+
* POTENTIALLY INCOMPATIBLE: Redis commands were moved into a mixin
15+
(see commands.py). Anyone importing ``redis.client`` to access commands
16+
directly should import ``redis.commands``. #1534, #1550
17+
* Removed technical debt on REDIS_6_VERSION placeholder. Thanks @chayim #1582.
18+
* Various docus fixes. Thanks @Andrew-Chen-Wang #1585, #1586.
19+
* Support for LOLWUT command, available since Redis 5.0.0.
20+
Thanks @brainix #1568.
21+
* Added support for CLIENT REPLY, available in Redis 3.2.0.
22+
Thanks @chayim #1581.
23+
* Support for Auto-reconnect PubSub on get_message. Thanks @luhn #1574.
24+
* Fix RST syntax error in README/ Thanks @JanCBrammer #1451.
25+
* IDLETIME and FREQ support for RESTORE. Thanks @chayim #1580.
26+
* Supporting args with MODULE LOAD. Thanks @chayim #1579.
27+
* Updating RedisLabs with Redis. Thanks @gkorland #1575.
1028
* Added support for ASYNC to SCRIPT FLUSH available in Redis 6.2.0.
1129
Thanks @chayim. #1567
12-
* Added CLIENT LIST fix to support multiple client ids available in
30+
* Added CLIENT LIST fix to support multiple client ids available in
1331
Redis 2.8.12. Thanks @chayim #1563.
1432
* Added DISCARD support for pipelines available in Redis 2.0.0.
1533
Thanks @chayim #1565.
16-
* Added ACL DELUSER support for deleting lists of users available in
34+
* Added ACL DELUSER support for deleting lists of users available in
1735
Redis 6.2.0. Thanks @chayim. #1562
1836
* Added CLIENT TRACKINFO support available in Redis 6.2.0.
1937
Thanks @chayim. #1560
@@ -31,10 +49,10 @@
3149
Thanks @ian28223 #1489.
3250
* Added support for STRALGO available in Redis 6.0.0.
3351
Thanks @AvitalFineRedis. #1528
34-
* Addes support for ZMSCORE available in Redis 6.2.0.
52+
* Addes support for ZMSCORE available in Redis 6.2.0.
3553
Thanks @2014BDuck and @jiekun.zhu. #1437
36-
* Support MINID and LIMIT on XADD available in Redis 6.2.0.
37-
Thanks @AvitalFineRedis. #1548
54+
* Support MINID and LIMIT on XADD available in Redis 6.2.0.
55+
Thanks @AvitalFineRedis. #1548
3856
* Added sentinel commands FLUSHCONFIG, CKQUORUM, FAILOVER, and RESET
3957
available in Redis 2.8.12.
4058
Thanks @otherpirate. #834

0 commit comments

Comments
 (0)