Skip to content

Commit c591e2b

Browse files
authored
Merge branch 'master' into patch-1
2 parents a4973f5 + e5e265d commit c591e2b

File tree

11 files changed

+5010
-8
lines changed

11 files changed

+5010
-8
lines changed

.github/workflows/integration.yaml

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v2
2424
- name: install python
25-
uses: actions/setup-python@v2
25+
uses: actions/setup-python@v3
2626
with:
2727
python-version: 3.9
2828
- name: run code linters
@@ -32,20 +32,27 @@ jobs:
3232
3333
run-tests:
3434
runs-on: ubuntu-latest
35+
continue-on-error: ${{ matrix.experimental }}
3536
timeout-minutes: 30
3637
strategy:
3738
max-parallel: 15
3839
matrix:
3940
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
4041
test-type: ['standalone', 'cluster']
4142
connection-type: ['hiredis', 'plain']
43+
experimental: [false]
44+
include:
45+
- python-version: 3.11.0-alpha.6
46+
experimental: true
47+
test-type: standalone
48+
connection-type: plain
4249
env:
4350
ACTIONS_ALLOW_UNSECURE_COMMANDS: true
4451
name: Python ${{ matrix.python-version }} ${{matrix.test-type}}-${{matrix.connection-type}} tests
4552
steps:
4653
- uses: actions/checkout@v2
4754
- name: install python
48-
uses: actions/setup-python@v2
55+
uses: actions/setup-python@v3
4956
with:
5057
python-version: ${{ matrix.python-version }}
5158
- name: run tests
@@ -68,23 +75,28 @@ jobs:
6875
steps:
6976
- uses: actions/checkout@v2
7077
- name: install python
71-
uses: actions/setup-python@v2
78+
uses: actions/setup-python@v3
7279
with:
7380
python-version: 3.9
7481
- name: Run installed unit tests
7582
run: |
7683
bash .github/workflows/install_and_test.sh ${{ matrix.extension }}
7784
7885
install_package_from_commit:
86+
continue-on-error: ${{ matrix.experimental }}
7987
name: Install package from commit hash
8088
runs-on: ubuntu-latest
8189
strategy:
8290
matrix:
8391
python-version: ['3.6', '3.7', '3.8', '3.9', '3.10', 'pypy-3.7']
92+
experimental: [false]
93+
include:
94+
- python-version: 3.11.0-alpha.5
95+
- experimental: true
8496
steps:
8597
- uses: actions/checkout@v2
8698
- name: install python ${{ matrix.python-version }}
87-
uses: actions/setup-python@v2
99+
uses: actions/setup-python@v3
88100
with:
89101
python-version: ${{ matrix.python-version }}
90102
- name: install from pip

.github/workflows/pypi-publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v2
1313
- name: install python
14-
uses: actions/setup-python@v2
14+
uses: actions/setup-python@v3
1515
with:
1616
python-version: 3.9
1717
- name: Install dev tools

redis/asyncio/client.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,14 @@ def set_response_callback(self, command: str, callback: ResponseCallbackT):
255255
"""Set a custom Response Callback"""
256256
self.response_callbacks[command] = callback
257257

258+
def get_encoder(self):
259+
"""Get the connection pool's encoder"""
260+
return self.connection_pool.get_encoder()
261+
262+
def get_connection_kwargs(self):
263+
"""Get the connection's key-word arguments"""
264+
return self.connection_pool.connection_kwargs
265+
258266
def load_external_module(
259267
self,
260268
funcname,

redis/commands/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def acl_setuser(
256256
For more information see https://redis.io/commands/acl-setuser
257257
"""
258258
encoder = self.get_encoder()
259-
pieces: list[str | bytes] = [username]
259+
pieces: List[EncodableT] = [username]
260260

261261
if reset:
262262
pieces.append(b"reset")

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"Programming Language :: Python :: 3.8",
5353
"Programming Language :: Python :: 3.9",
5454
"Programming Language :: Python :: 3.10",
55+
"Programming Language :: Python :: 3.11",
5556
"Programming Language :: Python :: Implementation :: CPython",
5657
"Programming Language :: Python :: Implementation :: PyPy",
5758
],

tests/test_asyncio/conftest.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
PythonParser,
2121
parse_url,
2222
)
23+
from redis.asyncio.retry import Retry
24+
from redis.backoff import NoBackoff
2325
from tests.conftest import REDIS_INFO
2426

2527
from .compat import mock
@@ -97,7 +99,7 @@ async def ateardown():
9799

98100

99101
@pytest_asyncio.fixture()
100-
async def r(create_redis):
102+
async def r(request, create_redis):
101103
yield await create_redis()
102104

103105

@@ -107,8 +109,16 @@ async def r2(create_redis):
107109
yield await create_redis()
108110

109111

112+
@pytest_asyncio.fixture()
113+
async def modclient(request, create_redis):
114+
yield await create_redis(
115+
url=request.config.getoption("--redismod-url"), decode_responses=True
116+
)
117+
118+
110119
def _gen_cluster_mock_resp(r, response):
111120
connection = mock.AsyncMock()
121+
connection.retry = Retry(NoBackoff(), 0)
112122
connection.read_response.return_value = response
113123
r.connection = connection
114124
return r

0 commit comments

Comments
 (0)