Skip to content

Commit b94b105

Browse files
authored
Merge branch 'master' into no-ssl
2 parents ae2e1bd + ebb6171 commit b94b105

Some content is hidden

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

43 files changed

+1294
-398
lines changed

.github/release-drafter-config.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name-template: '$NEXT_MINOR_VERSION'
22
tag-template: 'v$NEXT_MINOR_VERSION'
3+
filter-by-commitish: true
4+
commitish: master
35
autolabeler:
46
- label: 'maintenance'
57
files:
@@ -15,7 +17,7 @@ autolabeler:
1517
branch:
1618
- '/feature-.+'
1719
categories:
18-
- title: 'Breaking Changes'
20+
- title: '🔥 Breaking Changes'
1921
labels:
2022
- 'breakingchange'
2123
- title: '🧪 Experimental Features'
@@ -32,7 +34,12 @@ categories:
3234
- 'bug'
3335
- 'BUG'
3436
- title: '🧰 Maintenance'
35-
label: 'maintenance'
37+
labels:
38+
- 'maintenance'
39+
- 'dependencies'
40+
- 'documentation'
41+
- 'docs'
42+
- 'testing'
3643
change-template: '- $TITLE (#$NUMBER)'
3744
exclude-labels:
3845
- 'skip-changelog'

.github/workflows/codeql-analysis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040

4141
# Initializes the CodeQL tools for scanning.
4242
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v2
43+
uses: github/codeql-action/init@v3
4444
with:
4545
languages: ${{ matrix.language }}
4646
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -51,7 +51,7 @@ jobs:
5151
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
5252
# If this step fails, then you should remove it and run the build manually (see below)
5353
- name: Autobuild
54-
uses: github/codeql-action/autobuild@v2
54+
uses: github/codeql-action/autobuild@v3
5555

5656
# ℹ️ Command-line programs to run using the OS shell.
5757
# 📚 https://git.io/JvXDl
@@ -65,4 +65,4 @@ jobs:
6565
# make release
6666

6767
- name: Perform CodeQL Analysis
68-
uses: github/codeql-action/analyze@v2
68+
uses: github/codeql-action/analyze@v3

.github/workflows/docs.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
runs-on: ubuntu-latest
2727
steps:
2828
- uses: actions/checkout@v4
29-
- uses: actions/setup-python@v4
29+
- uses: actions/setup-python@v5
3030
with:
3131
python-version: 3.9
3232
cache: 'pip'
@@ -40,7 +40,7 @@ jobs:
4040
invoke build-docs
4141
4242
- name: upload docs
43-
uses: actions/upload-artifact@v3
43+
uses: actions/upload-artifact@v4
4444
with:
4545
name: redis-py-docs
4646
path: |

.github/workflows/integration.yaml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
runs-on: ubuntu-latest
4242
steps:
4343
- uses: actions/checkout@v4
44-
- uses: actions/setup-python@v4
44+
- uses: actions/setup-python@v5
4545
with:
4646
python-version: 3.9
4747
cache: 'pip'
@@ -57,15 +57,15 @@ jobs:
5757
max-parallel: 15
5858
fail-fast: false
5959
matrix:
60-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
60+
python-version: ['3.8', '3.9', '3.10', '3.11', 'pypy-3.8', 'pypy-3.9']
6161
test-type: ['standalone', 'cluster']
6262
connection-type: ['hiredis', 'plain']
6363
env:
6464
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
6565
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
6666
steps:
6767
- uses: actions/checkout@v4
68-
- uses: actions/setup-python@v4
68+
- uses: actions/setup-python@v5
6969
with:
7070
python-version: ${{ matrix.python-version }}
7171
cache: 'pip'
@@ -81,15 +81,14 @@ jobs:
8181
sleep 10 # time to settle
8282
invoke ${{matrix.test-type}}-tests
8383
84-
- uses: actions/upload-artifact@v3
84+
- uses: actions/upload-artifact@v4
8585
if: success() || failure()
8686
with:
8787
name: pytest-results-${{matrix.test-type}}-${{matrix.connection-type}}-${{matrix.python-version}}
8888
path: '${{matrix.test-type}}*results.xml'
8989

9090
- name: Upload codecov coverage
91-
uses: codecov/codecov-action@v3
92-
if: ${{matrix.python-version == '3.11'}}
91+
uses: codecov/codecov-action@v4
9392
with:
9493
fail_ci_if_error: false
9594

@@ -111,7 +110,7 @@ jobs:
111110
strategy:
112111
fail-fast: false
113112
matrix:
114-
python-version: ['3.7', '3.11']
113+
python-version: ['3.8', '3.11']
115114
test-type: ['standalone', 'cluster']
116115
connection-type: ['hiredis', 'plain']
117116
protocol: ['3']
@@ -120,7 +119,7 @@ jobs:
120119
name: RESP3 [${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}}]
121120
steps:
122121
- uses: actions/checkout@v4
123-
- uses: actions/setup-python@v4
122+
- uses: actions/setup-python@v5
124123
with:
125124
python-version: ${{ matrix.python-version }}
126125
cache: 'pip'
@@ -147,7 +146,7 @@ jobs:
147146
extension: ['tar.gz', 'whl']
148147
steps:
149148
- uses: actions/checkout@v4
150-
- uses: actions/setup-python@v4
149+
- uses: actions/setup-python@v5
151150
with:
152151
python-version: 3.9
153152
- name: Run installed unit tests
@@ -160,10 +159,10 @@ jobs:
160159
strategy:
161160
fail-fast: false
162161
matrix:
163-
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
162+
python-version: ['3.8', '3.9', '3.10', '3.11', 'pypy-3.8', 'pypy-3.9']
164163
steps:
165164
- uses: actions/checkout@v4
166-
- uses: actions/setup-python@v4
165+
- uses: actions/setup-python@v5
167166
with:
168167
python-version: ${{ matrix.python-version }}
169168
cache: 'pip'

.github/workflows/pypi-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: actions/checkout@v4
1616
- name: install python
17-
uses: actions/setup-python@v4
17+
uses: actions/setup-python@v5
1818
with:
1919
python-version: 3.9
2020
- name: Install dev tools

CHANGES

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Allow to control the minimum SSL version
2+
* Add an optional lock_name attribute to LockError.
13
* Fix return types for `get`, `set_path` and `strappend` in JSONCommands
24
* Connection.register_connect_callback() is made public.
35
* Fix async `read_response` to use `disable_decoding`.

docs/examples/asyncio_examples.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
"\n",
202202
"async def reader(channel: redis.client.PubSub):\n",
203203
" while True:\n",
204-
" message = await channel.get_message(ignore_subscribe_messages=True)\n",
204+
" message = await channel.get_message(ignore_subscribe_messages=True, timeout=None)\n",
205205
" if message is not None:\n",
206206
" print(f\"(Reader) Message Received: {message}\")\n",
207207
" if message[\"data\"].decode() == STOPWORD:\n",
@@ -264,7 +264,7 @@
264264
"\n",
265265
"async def reader(channel: redis.client.PubSub):\n",
266266
" while True:\n",
267-
" message = await channel.get_message(ignore_subscribe_messages=True)\n",
267+
" message = await channel.get_message(ignore_subscribe_messages=True, timeout=None)\n",
268268
" if message is not None:\n",
269269
" print(f\"(Reader) Message Received: {message}\")\n",
270270
" if message[\"data\"].decode() == STOPWORD:\n",

docs/examples/ssl_connection_examples.ipynb

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,42 @@
7676
"ssl_connection.ping()"
7777
]
7878
},
79+
{
80+
"cell_type": "markdown",
81+
"metadata": {},
82+
"source": [
83+
"## Connecting to a Redis instance via SSL, while specifying a minimum TLS version"
84+
]
85+
},
86+
{
87+
"cell_type": "code",
88+
"execution_count": null,
89+
"metadata": {},
90+
"outputs": [
91+
{
92+
"data": {
93+
"text/plain": [
94+
"True"
95+
]
96+
},
97+
"execution_count": 6,
98+
"metadata": {},
99+
"output_type": "execute_result"
100+
}
101+
],
102+
"source": [
103+
"import redis\n",
104+
"import ssl\n",
105+
"\n",
106+
"ssl_conn = redis.Redis(\n",
107+
" host=\"localhost\",\n",
108+
" port=6666,\n",
109+
" ssl=True,\n",
110+
" ssl_min_version=ssl.TLSVersion.TLSv1_3,\n",
111+
")\n",
112+
"ssl_conn.ping()"
113+
]
114+
},
79115
{
80116
"cell_type": "markdown",
81117
"metadata": {},

docs/lua_scripting.rst

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,19 +92,24 @@ Cluster Mode
9292

9393
Cluster mode has limited support for lua scripting.
9494

95-
The following commands are supported, with caveats: - ``EVAL`` and
96-
``EVALSHA``: The command is sent to the relevant node, depending on the
97-
keys (i.e., in ``EVAL "<script>" num_keys key_1 ... key_n ...``). The
98-
keys *must* all be on the same node. If the script requires 0 keys, *the
99-
command is sent to a random (primary) node*. - ``SCRIPT EXISTS``: The
100-
command is sent to all primaries. The result is a list of booleans
101-
corresponding to the input SHA hashes. Each boolean is an AND of “does
102-
the script exist on each node?”. In other words, each boolean is True
103-
iff the script exists on all nodes. - ``SCRIPT FLUSH``: The command is
104-
sent to all primaries. The result is a bool AND over all nodes’
105-
responses. - ``SCRIPT LOAD``: The command is sent to all primaries. The
106-
result is the SHA1 digest.
107-
108-
The following commands are not supported: - ``EVAL_RO`` - ``EVALSHA_RO``
95+
The following commands are supported, with caveats:
96+
97+
- ``EVAL`` and ``EVALSHA``: The command is sent to the relevant node,
98+
depending on the keys (i.e., in ``EVAL "<script>" num_keys key_1 ...
99+
key_n ...``). The keys *must* all be on the same node. If the script
100+
requires 0 keys, *the command is sent to a random (primary) node*.
101+
- ``SCRIPT EXISTS``: The command is sent to all primaries. The result
102+
is a list of booleans corresponding to the input SHA hashes. Each
103+
boolean is an AND of “does the script exist on each node?”. In other
104+
words, each boolean is True iff the script exists on all nodes.
105+
- ``SCRIPT FLUSH``: The command is sent to all primaries. The result
106+
is a bool AND over all nodes’ responses.
107+
- ``SCRIPT LOAD``: The command is sent to all primaries. The result
108+
is the SHA1 digest.
109+
110+
The following commands are not supported:
111+
112+
- ``EVAL_RO``
113+
- ``EVALSHA_RO``
109114

110115
Using scripting within pipelines in cluster mode is **not supported**.

redis/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
from redis import asyncio # noqa
44
from redis.backoff import default_backoff
5-
from redis.cache import _LocalChace
65
from redis.client import Redis, StrictRedis
76
from redis.cluster import RedisCluster
87
from redis.connection import (
@@ -62,7 +61,6 @@ def int_or_str(value):
6261
VERSION = tuple([99, 99, 99])
6362

6463
__all__ = [
65-
"_LocalChace",
6664
"AuthenticationError",
6765
"AuthenticationWrongNumberOfArgsError",
6866
"BlockingConnectionPool",

0 commit comments

Comments
 (0)