Skip to content

Commit cf079d1

Browse files
authored
Merge branch 'master' into fix-async-client-safety
2 parents 1580dd4 + 746653a commit cf079d1

File tree

13 files changed

+210
-141
lines changed

13 files changed

+210
-141
lines changed

.github/actions/run-tests/action.yml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,9 @@ runs:
3131
- name: Setup Test environment
3232
env:
3333
REDIS_VERSION: ${{ inputs.redis-version }}
34-
REDIS_IMAGE: "redis:${{ inputs.redis-version }}"
35-
CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ inputs.redis-version }}"
34+
CLIENT_LIBS_TEST_IMAGE_TAG: ${{ inputs.redis-version }}
3635
run: |
3736
set -e
38-
39-
if [ "${{inputs.redis-version}}" == "8.0-M04-pre" ]; then
40-
export REDIS_IMAGE=redis:8.0-M03
41-
fi
4237
4338
echo "::group::Installing dependencies"
4439
pip install -U setuptools wheel
@@ -60,13 +55,13 @@ runs:
6055
6156
# Mapping of redis version to stack version
6257
declare -A redis_stack_version_mapping=(
63-
["7.4.2"]="7.4.0-v2"
64-
["7.2.7"]="7.2.0-v14"
65-
["6.2.17"]="6.2.6-v18"
58+
["7.4.2"]="rs-7.4.0-v2"
59+
["7.2.7"]="rs-7.2.0-v14"
60+
["6.2.17"]="rs-6.2.6-v18"
6661
)
6762
6863
if [[ -v redis_stack_version_mapping[$REDIS_VERSION] ]]; then
69-
export REDIS_STACK_IMAGE="redis/redis-stack-server:${redis_stack_version_mapping[$REDIS_VERSION]}"
64+
export CLIENT_LIBS_TEST_STACK_IMAGE_TAG=${redis_stack_version_mapping[$REDIS_VERSION]}
7065
echo "REDIS_MOD_URL=redis://127.0.0.1:6479/0" >> $GITHUB_ENV
7166
else
7267
echo "Version not found in the mapping."

.github/workflows/integration.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ env:
2727
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
2828
# this speeds up coverage with Python 3.12: https://github.com/nedbat/coveragepy/issues/1665
2929
COVERAGE_CORE: sysmon
30-
REDIS_IMAGE: redis:latest
31-
REDIS_STACK_IMAGE: redis/redis-stack-server:latest
30+
CURRENT_CLIENT_LIBS_TEST_STACK_IMAGE_TAG: 'rs-7.4.0-v2'
3231
CURRENT_REDIS_VERSION: '7.4.2'
3332

3433
jobs:
@@ -75,7 +74,7 @@ jobs:
7574
fail-fast: false
7675
matrix:
7776
redis-version: ['8.0-M04-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.2.7', '6.2.17']
78-
python-version: ['3.8', '3.12']
77+
python-version: ['3.8', '3.13']
7978
parser-backend: ['plain']
8079
event-loop: ['asyncio']
8180
env:
@@ -99,7 +98,7 @@ jobs:
9998
fail-fast: false
10099
matrix:
101100
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
102-
python-version: ['3.9', '3.10', '3.11', 'pypy-3.9', 'pypy-3.10']
101+
python-version: ['3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
103102
parser-backend: [ 'plain' ]
104103
event-loop: [ 'asyncio' ]
105104
env:
@@ -123,7 +122,7 @@ jobs:
123122
fail-fast: false
124123
matrix:
125124
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
126-
python-version: [ '3.8', '3.12']
125+
python-version: [ '3.8', '3.13']
127126
parser-backend: [ 'hiredis' ]
128127
hiredis-version: [ '>=3.0.0', '<3.0.0' ]
129128
event-loop: [ 'asyncio' ]
@@ -149,7 +148,7 @@ jobs:
149148
fail-fast: false
150149
matrix:
151150
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
152-
python-version: [ '3.8', '3.12' ]
151+
python-version: [ '3.8', '3.13' ]
153152
parser-backend: [ 'plain' ]
154153
event-loop: [ 'uvloop' ]
155154
env:
@@ -180,9 +179,8 @@ jobs:
180179
python-version: 3.9
181180
- name: Run installed unit tests
182181
env:
183-
REDIS_VERSION: ${{ env.CURRENT_REDIS_VERSION }}
184-
REDIS_IMAGE: "redis:${{ env.CURRENT_REDIS_VERSION }}"
185-
CLIENT_LIBS_TEST_IMAGE: "redislabs/client-libs-test:${{ env.CURRENT_REDIS_VERSION }}"
182+
CLIENT_LIBS_TEST_IMAGE_TAG: ${{ env.CURRENT_REDIS_VERSION }}
183+
CLIENT_LIBS_TEST_STACK_IMAGE_TAG: ${{ env.CURRENT_CLIENT_LIBS_TEST_STACK_IMAGE_TAG }}
186184
run: |
187185
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
188186
@@ -192,7 +190,7 @@ jobs:
192190
strategy:
193191
fail-fast: false
194192
matrix:
195-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.9', 'pypy-3.10']
193+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
196194
steps:
197195
- uses: actions/checkout@v4
198196
- uses: actions/setup-python@v5

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,6 @@ docker/stunnel/keys
2323
/dockers/*/tls/*
2424
/dockers/standalone/
2525
/dockers/cluster/
26+
/dockers/replica/
27+
/dockers/sentinel/
28+
/dockers/redis-stack/

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
include INSTALL
22
include LICENSE
33
include README.md
4+
include dev_requirements.txt
5+
include pytest.ini
46
exclude __pycache__
57
recursive-include tests *
68
recursive-exclude tests *.pyc

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ The Python interface to the Redis key-value store.
1313

1414
---------------------------------------------
1515

16-
**Note: ** redis-py 5.0 will be the last version of redis-py to support Python 3.7, as it has reached [end of life](https://devguide.python.org/versions/). redis-py 5.1 will support Python 3.8+.
16+
**Note:** redis-py 5.0 will be the last version of redis-py to support Python 3.7, as it has reached [end of life](https://devguide.python.org/versions/). redis-py 5.1 will support Python 3.8+.
1717

1818
---------------------------------------------
1919

dev_requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ packaging>=20.4
99
pytest
1010
pytest-asyncio>=0.23.0,<0.24.0
1111
pytest-cov
12-
pytest-profiling==1.7.0
12+
pytest-profiling==1.8.1
1313
pytest-timeout
1414
ujson>=4.2.0
1515
uvloop
1616
vulture>=2.3.0
1717
wheel>=0.30.0
1818
numpy>=1.24.0
19-
redis-entraid==0.1.0b1
19+
redis-entraid==0.3.0b1

docker-compose.yml

Lines changed: 31 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
---
2+
x-client-libs-stack-image: &client-libs-stack-image
3+
image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_STACK_IMAGE_TAG:-rs-7.4.0-v2}"
4+
5+
x-client-libs-image: &client-libs-image
6+
image: "redislabs/client-libs-test:${CLIENT_LIBS_TEST_IMAGE_TAG:-7.4.2}"
27

38
services:
49

510
redis:
6-
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
11+
<<: *client-libs-image
712
container_name: redis-standalone
813
environment:
914
- TLS_ENABLED=yes
@@ -24,20 +29,26 @@ services:
2429
- all
2530

2631
replica:
27-
image: ${REDIS_IMAGE:-redis:7.4.1}
32+
<<: *client-libs-image
2833
container_name: redis-replica
2934
depends_on:
3035
- redis
31-
command: redis-server --replicaof redis 6379 --protected-mode no --save ""
36+
environment:
37+
- TLS_ENABLED=no
38+
- REDIS_CLUSTER=no
39+
- PORT=6380
40+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --replicaof redis 6379 --protected-mode no --save ""}
3241
ports:
33-
- 6380:6379
42+
- 6380:6380
43+
volumes:
44+
- "./dockers/replica:/redis/work"
3445
profiles:
3546
- replica
3647
- all-stack
3748
- all
3849

3950
cluster:
40-
image: ${CLIENT_LIBS_TEST_IMAGE:-redislabs/client-libs-test:7.4.1}
51+
<<: *client-libs-image
4152
container_name: redis-cluster
4253
environment:
4354
- REDIS_CLUSTER=yes
@@ -58,57 +69,38 @@ services:
5869
- all
5970

6071
sentinel:
61-
image: ${REDIS_IMAGE:-redis:7.4.1}
72+
<<: *client-libs-image
6273
container_name: redis-sentinel
6374
depends_on:
6475
- redis
65-
entrypoint: "redis-sentinel /redis.conf --port 26379"
76+
environment:
77+
- REDIS_CLUSTER=no
78+
- NODES=3
79+
- PORT=26379
80+
command: ${REDIS_EXTRA_ARGS:---sentinel}
6681
ports:
6782
- 26379:26379
68-
volumes:
69-
- "./dockers/sentinel.conf:/redis.conf"
70-
profiles:
71-
- sentinel
72-
- all-stack
73-
- all
74-
75-
sentinel2:
76-
image: ${REDIS_IMAGE:-redis:7.4.1}
77-
container_name: redis-sentinel2
78-
depends_on:
79-
- redis
80-
entrypoint: "redis-sentinel /redis.conf --port 26380"
81-
ports:
8283
- 26380:26380
83-
volumes:
84-
- "./dockers/sentinel.conf:/redis.conf"
85-
profiles:
86-
- sentinel
87-
- all-stack
88-
- all
89-
90-
sentinel3:
91-
image: ${REDIS_IMAGE:-redis:7.4.1}
92-
container_name: redis-sentinel3
93-
depends_on:
94-
- redis
95-
entrypoint: "redis-sentinel /redis.conf --port 26381"
96-
ports:
9784
- 26381:26381
9885
volumes:
99-
- "./dockers/sentinel.conf:/redis.conf"
86+
- "./dockers/sentinel.conf:/redis/config-default/redis.conf"
87+
- "./dockers/sentinel:/redis/work"
10088
profiles:
10189
- sentinel
10290
- all-stack
10391
- all
10492

10593
redis-stack:
106-
image: ${REDIS_STACK_IMAGE:-redis/redis-stack-server:latest}
94+
<<: *client-libs-stack-image
10795
container_name: redis-stack
96+
environment:
97+
- REDIS_CLUSTER=no
98+
- PORT=6379
99+
command: ${REDIS_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ""}
108100
ports:
109101
- 6479:6379
110-
environment:
111-
- "REDIS_ARGS=${REDIS_STACK_EXTRA_ARGS:---enable-debug-command yes --enable-module-command yes --save ''}"
102+
volumes:
103+
- "./dockers/redis-stack:/redis/work"
112104
profiles:
113105
- standalone
114106
- all-stack

docs/examples/connection_examples.ipynb

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,26 @@
7575
]
7676
},
7777
{
78-
"cell_type": "markdown",
78+
"cell_type": "code",
79+
"execution_count": 4,
7980
"metadata": {},
81+
"outputs": [
82+
{
83+
"data": {
84+
"text/plain": [
85+
"True"
86+
]
87+
},
88+
"execution_count": 4,
89+
"metadata": {},
90+
"output_type": "execute_result"
91+
}
92+
],
8093
"source": [
8194
"import redis\n",
8295
"\n",
8396
"r = redis.Redis(protocol=3)\n",
84-
"rcon.ping()"
97+
"r.ping()"
8598
]
8699
},
87100
{
@@ -93,7 +106,7 @@
93106
},
94107
{
95108
"cell_type": "code",
96-
"execution_count": 4,
109+
"execution_count": 5,
97110
"metadata": {},
98111
"outputs": [
99112
{
@@ -102,7 +115,7 @@
102115
"True"
103116
]
104117
},
105-
"execution_count": 4,
118+
"execution_count": 5,
106119
"metadata": {},
107120
"output_type": "execute_result"
108121
}

docs/opentelemetry.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ You can then use it to instrument code like this:
4646
4747
RedisInstrumentor().instrument()
4848
49-
Once the code is patched, you can use redis-py as usually:
49+
Once the code is patched, you can use redis-py as usual:
5050

5151
.. code-block:: python
5252

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
long_description_content_type="text/markdown",
99
keywords=["Redis", "key-value store", "database"],
1010
license="MIT",
11-
version="5.1.1",
11+
version="5.2.1",
1212
packages=find_packages(
1313
include=[
1414
"redis",
@@ -54,6 +54,7 @@
5454
"Programming Language :: Python :: 3.10",
5555
"Programming Language :: Python :: 3.11",
5656
"Programming Language :: Python :: 3.12",
57+
"Programming Language :: Python :: 3.13",
5758
"Programming Language :: Python :: Implementation :: CPython",
5859
"Programming Language :: Python :: Implementation :: PyPy",
5960
],

0 commit comments

Comments
 (0)