Skip to content

Commit e5756da

Browse files
authored
Dropping Python 3.8 support as it has reached end of life (#3657)
1 parent bc7de60 commit e5756da

8 files changed

+43
-32
lines changed

.github/workflows/hiredis-py-integration.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
steps:
3535
- name: Compute outputs
3636
run: |
37-
echo "CURRENT=${{ env.CURRENT_REDIS_VERSION }}" >> $GITHUB_OUTPUT
37+
echo "CURRENT=${{ env.CURRENT_REDIS_VERSION }}" >> $GITHUB_OUTPUT
3838
3939
hiredis-tests:
4040
runs-on: ubuntu-latest
@@ -45,7 +45,7 @@ jobs:
4545
fail-fast: false
4646
matrix:
4747
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
48-
python-version: [ '3.8', '3.13']
48+
python-version: [ '3.9', '3.13']
4949
parser-backend: [ 'hiredis' ]
5050
hiredis-version: [ 'unstable' ]
5151
event-loop: [ 'asyncio' ]

.github/workflows/integration.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ jobs:
7575
fail-fast: false
7676
matrix:
7777
redis-version: ['8.0.1-pre', '${{ needs.redis_version.outputs.CURRENT }}', '7.2.7', '6.2.17']
78-
python-version: ['3.8', '3.13']
78+
python-version: ['3.9', '3.13']
7979
parser-backend: ['plain']
8080
event-loop: ['asyncio']
8181
env:
@@ -123,7 +123,7 @@ jobs:
123123
fail-fast: false
124124
matrix:
125125
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
126-
python-version: [ '3.8', '3.13']
126+
python-version: [ '3.9', '3.13']
127127
parser-backend: [ 'hiredis' ]
128128
hiredis-version: [ '>=3.2.0', '<3.0.0' ]
129129
event-loop: [ 'asyncio' ]
@@ -149,7 +149,7 @@ jobs:
149149
fail-fast: false
150150
matrix:
151151
redis-version: [ '${{ needs.redis_version.outputs.CURRENT }}' ]
152-
python-version: [ '3.8', '3.13' ]
152+
python-version: [ '3.9', '3.13' ]
153153
parser-backend: [ 'plain' ]
154154
event-loop: [ 'uvloop' ]
155155
env:
@@ -191,7 +191,7 @@ jobs:
191191
strategy:
192192
fail-fast: false
193193
matrix:
194-
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
194+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy-3.9', 'pypy-3.10']
195195
steps:
196196
- uses: actions/checkout@v4
197197
- uses: actions/setup-python@v5

README.md

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

1616
**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+.
17-
17+
**Note:** redis-py 6.1.0 will be the last version of redis-py to support Python 3.8, as it has reached [end of life](https://devguide.python.org/versions/). redis-py 6.2.0 will support Python 3.9+.
1818
---------------------------------------------
1919

2020
## How do I Redis?

pyproject.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dynamic = ["version"]
88
description = "Python client for Redis database and key-value store"
99
readme = "README.md"
1010
license = "MIT"
11-
requires-python = ">=3.8"
11+
requires-python = ">=3.9"
1212
authors = [{ name = "Redis Inc.", email = "[email protected]" }]
1313
keywords = ["Redis", "database", "key-value-store"]
1414
classifiers = [
@@ -20,7 +20,6 @@ classifiers = [
2020
"Programming Language :: Python",
2121
"Programming Language :: Python :: 3",
2222
"Programming Language :: Python :: 3 :: Only",
23-
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",
@@ -83,7 +82,7 @@ filterwarnings = [
8382
]
8483

8584
[tool.ruff]
86-
target-version = "py38"
85+
target-version = "py39"
8786
line-length = 88
8887
exclude = [
8988
"*.egg-info",

tests/test_asyncio/test_cluster_transaction.py

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,12 @@ async def test_retry_transaction_during_unfinished_slot_migration(self, r):
125125
slot = r.keyslot(key)
126126
node_migrating, node_importing = _find_source_and_target_node_for_slot(r, slot)
127127

128-
with patch.object(
129-
ClusterNode, "parse_response"
130-
) as parse_response, patch.object(
131-
NodesManager, "_update_moved_slots"
132-
) as manager_update_moved_slots:
128+
with (
129+
patch.object(ClusterNode, "parse_response") as parse_response,
130+
patch.object(
131+
NodesManager, "_update_moved_slots"
132+
) as manager_update_moved_slots,
133+
):
133134

134135
def ask_redirect_effect(connection, *args, **options):
135136
if "MULTI" in args:
@@ -167,11 +168,12 @@ async def test_retry_transaction_during_slot_migration_successful(
167168
slot = r.keyslot(key)
168169
node_migrating, node_importing = _find_source_and_target_node_for_slot(r, slot)
169170

170-
with patch.object(
171-
ClusterNode, "parse_response"
172-
) as parse_response, patch.object(
173-
NodesManager, "_update_moved_slots"
174-
) as manager_update_moved_slots:
171+
with (
172+
patch.object(ClusterNode, "parse_response") as parse_response,
173+
patch.object(
174+
NodesManager, "_update_moved_slots"
175+
) as manager_update_moved_slots,
176+
):
175177

176178
def ask_redirect_effect(conn, *args, **options):
177179
# first call should go here, we trigger an AskError

tests/test_asyncio/test_pubsub.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1048,9 +1048,11 @@ async def get_msg():
10481048
assert msg is not None
10491049
# timeout waiting for another message which never arrives
10501050
assert pubsub.connection.is_connected
1051-
with patch("redis._parsers._AsyncRESP2Parser.read_response") as mock1, patch(
1052-
"redis._parsers._AsyncHiredisParser.read_response"
1053-
) as mock2, patch("redis._parsers._AsyncRESP3Parser.read_response") as mock3:
1051+
with (
1052+
patch("redis._parsers._AsyncRESP2Parser.read_response") as mock1,
1053+
patch("redis._parsers._AsyncHiredisParser.read_response") as mock2,
1054+
patch("redis._parsers._AsyncRESP3Parser.read_response") as mock3,
1055+
):
10541056
mock1.side_effect = BaseException("boom")
10551057
mock2.side_effect = BaseException("boom")
10561058
mock3.side_effect = BaseException("boom")

tests/test_cluster_transaction.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,12 @@ def test_retry_transaction_during_unfinished_slot_migration(self, r):
124124
slot = r.keyslot(key)
125125
node_migrating, node_importing = _find_source_and_target_node_for_slot(r, slot)
126126

127-
with patch.object(Redis, "parse_response") as parse_response, patch.object(
128-
NodesManager, "_update_moved_slots"
129-
) as manager_update_moved_slots:
127+
with (
128+
patch.object(Redis, "parse_response") as parse_response,
129+
patch.object(
130+
NodesManager, "_update_moved_slots"
131+
) as manager_update_moved_slots,
132+
):
130133

131134
def ask_redirect_effect(connection, *args, **options):
132135
if "MULTI" in args:
@@ -161,9 +164,12 @@ def test_retry_transaction_during_slot_migration_successful(self, r):
161164
slot = r.keyslot(key)
162165
node_migrating, node_importing = _find_source_and_target_node_for_slot(r, slot)
163166

164-
with patch.object(Redis, "parse_response") as parse_response, patch.object(
165-
NodesManager, "_update_moved_slots"
166-
) as manager_update_moved_slots:
167+
with (
168+
patch.object(Redis, "parse_response") as parse_response,
169+
patch.object(
170+
NodesManager, "_update_moved_slots"
171+
) as manager_update_moved_slots,
172+
):
167173

168174
def ask_redirect_effect(conn, *args, **options):
169175
# first call should go here, we trigger an AskError

tests/test_pubsub.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,9 +1138,11 @@ def get_msg():
11381138
assert msg is not None
11391139
# timeout waiting for another message which never arrives
11401140
assert is_connected()
1141-
with patch("redis._parsers._RESP2Parser.read_response") as mock1, patch(
1142-
"redis._parsers._HiredisParser.read_response"
1143-
) as mock2, patch("redis._parsers._RESP3Parser.read_response") as mock3:
1141+
with (
1142+
patch("redis._parsers._RESP2Parser.read_response") as mock1,
1143+
patch("redis._parsers._HiredisParser.read_response") as mock2,
1144+
patch("redis._parsers._RESP3Parser.read_response") as mock3,
1145+
):
11441146
mock1.side_effect = BaseException("boom")
11451147
mock2.side_effect = BaseException("boom")
11461148
mock3.side_effect = BaseException("boom")

0 commit comments

Comments
 (0)