Skip to content

Commit 88bede2

Browse files
authored
Merge branch 'master' into ckpy312
2 parents c668538 + 4a66c1e commit 88bede2

32 files changed

+711
-477
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: 9 additions & 10 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', '3.12', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
60+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.7', '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
9191
uses: codecov/codecov-action@v3
92-
if: ${{matrix.python-version == '3.12'}}
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.12']
113+
python-version: ['3.8', '3.12']
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', '3.12', 'pypy-3.7', 'pypy-3.8', 'pypy-3.9']
162+
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', 'pypy-3.7', '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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Add an optional lock_name attribute to LockError.
12
* Fix return types for `get`, `set_path` and `strappend` in JSONCommands
23
* Connection.register_connect_callback() is made public.
34
* Fix async `read_response` to use `disable_decoding`.

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/cache.py renamed to redis/_cache.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ class _LocalCache:
178178
"""
179179

180180
def __init__(
181-
self, max_size: int, ttl: int, eviction_policy: EvictionPolicy, **kwargs
181+
self,
182+
max_size: int = 100,
183+
ttl: int = 0,
184+
eviction_policy: EvictionPolicy = DEFAULT_EVICTION_POLICY,
185+
**kwargs,
182186
):
183187
self.max_size = max_size
184188
self.ttl = ttl

redis/_parsers/hiredis.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import asyncio
22
import socket
33
import sys
4-
from typing import Callable, List, Optional, Union
4+
from typing import Callable, List, Optional, TypedDict, Union
55

66
if sys.version_info.major >= 3 and sys.version_info.minor >= 11:
77
from asyncio import timeout as async_timeout
88
else:
99
from async_timeout import timeout as async_timeout
1010

11-
from redis.compat import TypedDict
12-
1311
from ..exceptions import ConnectionError, InvalidResponse, RedisError
1412
from ..typing import EncodableT
1513
from ..utils import HIREDIS_AVAILABLE

0 commit comments

Comments
 (0)