Skip to content

Commit 7930342

Browse files
committed
drop python 3.9
Change-Id: I110547bcc87934ce8ecb60bce5b05302fe7472eb
1 parent 0e45615 commit 7930342

4 files changed

Lines changed: 80 additions & 75 deletions

File tree

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.. change::
2+
:tags: general, installation
3+
4+
Minimum Python version is now 3.10, as Python 3.9 is EOL.

dogpile/cache/api.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -499,12 +499,8 @@ def delete_multi(
499499

500500

501501
class DefaultSerialization:
502-
serializer: Union[None, Serializer] = staticmethod(
503-
pickle.dumps
504-
) # type: ignore
505-
deserializer: Union[None, Deserializer] = staticmethod(
506-
pickle.loads
507-
) # type: ignore
502+
serializer: Union[None, Serializer] = staticmethod(pickle.dumps)
503+
deserializer: Union[None, Deserializer] = staticmethod(pickle.loads)
508504

509505

510506
class BytesBackend(DefaultSerialization, CacheBackend):

noxfile.py

Lines changed: 72 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import os
66
import sys
7-
from typing import List
87

98
import nox
109

@@ -14,7 +13,6 @@
1413

1514

1615
PYTHON_VERSIONS = [
17-
"3.9",
1816
"3.10",
1917
"3.11",
2018
"3.12",
@@ -42,7 +40,7 @@
4240

4341

4442
def pifpaf(
45-
cmd: List[str],
43+
cmd: list[str],
4644
module: str,
4745
*,
4846
port_env: str = "TOX_DOGPILE_PORT",
@@ -109,7 +107,7 @@ def coverage(session: nox.Session, target: str) -> None:
109107

110108
def _tests(
111109
session: nox.Session,
112-
targets: List[str],
110+
targets: list[str],
113111
coverage: bool = False,
114112
full: bool = False,
115113
) -> None:
@@ -147,73 +145,80 @@ def _tests(
147145
# pytests separately for each backend rather than having all the
148146
# services running and figuring out how to keep them all on distinct
149147
# ports. so iterate through backends and run individual suites.
150-
backend_cmd: List[str] = []
151-
pifpaf_cmd: List[str] = []
148+
backend_cmd: list[str] = []
149+
pifpaf_cmd: list[str] = []
152150

153151
# note the default target is "generic", which means run all the
154152
# normal tests but no backend tests
155-
if target == "generic":
156-
backend_cmd.append("-k not backend.py")
157-
elif target == "memory":
158-
backend_cmd.append("tests/cache/test_memory_backend.py")
159-
elif target == "memcached":
160-
session.install(
161-
*nox.project.dependency_groups(
162-
pyproject,
163-
"tests_memcached_full" if full else "tests_memcached",
153+
match target:
154+
case "generic":
155+
backend_cmd.append("-k not backend.py")
156+
case "memory":
157+
backend_cmd.append("tests/cache/test_memory_backend.py")
158+
case "memcached":
159+
session.install(
160+
*nox.project.dependency_groups(
161+
pyproject,
162+
"tests_memcached_full" if full else "tests_memcached",
163+
)
164164
)
165-
)
166-
167-
pifpaf(pifpaf_cmd, "memcached")
168-
pifpaf(
169-
pifpaf_cmd,
170-
"memcached",
171-
port_env="TOX_DOGPILE_TLS_PORT",
172-
port="11212",
173-
additonal_args="--ssl_chain_cert=tests/tls/server_chain.pem "
174-
"--ssl_key=tests/tls/server.key",
175-
)
176-
177-
backend_cmd.append("tests/cache/test_memcached_backend.py")
178-
elif target == "redis":
179-
session.install(
180-
*nox.project.dependency_groups(pyproject, "tests_redis")
181-
)
182-
pifpaf(pifpaf_cmd, "redis")
183-
backend_cmd.append("tests/cache/test_redis_backend.py")
184-
elif target == "valkey":
185-
session.install(
186-
*nox.project.dependency_groups(pyproject, "tests_valkey")
187-
)
188-
pifpaf(pifpaf_cmd, "valkey")
189-
backend_cmd.append("tests/cache/test_valkey_backend.py")
190-
elif target == "redis_sentinel":
191-
session.install(
192-
*nox.project.dependency_groups(pyproject, "tests_redis")
193-
)
194-
195-
pifpaf(
196-
pifpaf_cmd,
197-
"redis",
198-
additonal_args=f"--sentinel --sentinel "
199-
f"--sentinel-port "
200-
f"{os.environ.get('TOX_DOGPILE_SENTINEL_PORT', '11235')}",
201-
)
202-
backend_cmd.append("tests/cache/test_redis_sentinel_backend.py")
203-
elif target == "valkey_sentinel":
204-
session.install(
205-
*nox.project.dependency_groups(pyproject, "tests_valkey")
206-
)
207-
pifpaf(
208-
pifpaf_cmd,
209-
"valkey",
210-
additonal_args=f"--sentinel --sentinel "
211-
f"--sentinel-port "
212-
f"{os.environ.get('TOX_DOGPILE_SENTINEL_PORT', '11235')}",
213-
)
214-
backend_cmd.append("tests/cache/test_valkey_sentinel_backend.py")
215-
elif target == "dbm":
216-
backend_cmd.append("tests/cache/test_dbm_backend.py")
165+
166+
pifpaf(pifpaf_cmd, "memcached")
167+
pifpaf(
168+
pifpaf_cmd,
169+
"memcached",
170+
port_env="TOX_DOGPILE_TLS_PORT",
171+
port="11212",
172+
additonal_args=(
173+
"--ssl_chain_cert=tests/tls/server_chain.pem "
174+
"--ssl_key=tests/tls/server.key"
175+
),
176+
)
177+
178+
backend_cmd.append("tests/cache/test_memcached_backend.py")
179+
case "redis":
180+
session.install(
181+
*nox.project.dependency_groups(pyproject, "tests_redis")
182+
)
183+
pifpaf(pifpaf_cmd, "redis")
184+
backend_cmd.append("tests/cache/test_redis_backend.py")
185+
case "valkey":
186+
session.install(
187+
*nox.project.dependency_groups(pyproject, "tests_valkey")
188+
)
189+
pifpaf(pifpaf_cmd, "valkey")
190+
backend_cmd.append("tests/cache/test_valkey_backend.py")
191+
case "redis_sentinel":
192+
session.install(
193+
*nox.project.dependency_groups(pyproject, "tests_redis")
194+
)
195+
196+
pifpaf(
197+
pifpaf_cmd,
198+
"redis",
199+
additonal_args=f"--sentinel --sentinel "
200+
f"--sentinel-port "
201+
f"{os.environ.get('TOX_DOGPILE_SENTINEL_PORT', '11235')}",
202+
)
203+
backend_cmd.append(
204+
"tests/cache/test_redis_sentinel_backend.py"
205+
)
206+
case "valkey_sentinel":
207+
session.install(
208+
*nox.project.dependency_groups(pyproject, "tests_valkey")
209+
)
210+
pifpaf(
211+
pifpaf_cmd,
212+
"valkey",
213+
additonal_args=f"--sentinel --sentinel "
214+
f"--sentinel-port "
215+
f"{os.environ.get('TOX_DOGPILE_SENTINEL_PORT', '11235')}",
216+
)
217+
backend_cmd.append(
218+
"tests/cache/test_valkey_sentinel_backend.py"
219+
)
220+
case "dbm":
221+
backend_cmd.append("tests/cache/test_dbm_backend.py")
217222

218223
session.run(*pifpaf_cmd, *cmd, *backend_cmd, *session.posargs)
219224

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ classifiers = [
1616
"Programming Language :: Python",
1717
"Programming Language :: Python :: 3",
1818
]
19-
requires-python = ">=3.9"
19+
requires-python = ">=3.10"
2020
dependencies = [
2121
"decorator>=4.0.0",
2222
"stevedore>=3.0.0",
@@ -151,7 +151,7 @@ version = {attr = "dogpile.__version__"}
151151
line-length = 79
152152

153153
[tool.mypy]
154-
python_version = "3.9"
154+
python_version = "3.10"
155155
show_error_codes = true
156156
incremental = true
157157
strict = true

0 commit comments

Comments
 (0)