Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Commit 8e50299

Browse files
author
David Robertson
authored
Fix track_memory_usage on poetry-core 1.3.x installations (#14221)
* Fix `track_memory_usage` on poetry-core 1.3.x installations The same kind of problem as discussed in #14085: 1. we defined an extra with an underscore 2. we look it up at runtime with an underscore 3. but poetry-core 1.3.x. installs it with a dash, causing (2) to fail. Fix by using a dash everywhere. * Changelog
1 parent a8677bc commit 8e50299

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

changelog.d/14221.misc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Rename the `cache_memory` extra to `cache-memory`, for compatability with poetry-core 1.3.0 and [PEP 685](https://peps.python.org/pep-0685/). From-source installations using this extra will need to install using the new name.

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ jwt = ["authlib"]
227227
# (if it is not installed, we fall back to slow code.)
228228
redis = ["txredisapi", "hiredis"]
229229
# Required to use experimental `caches.track_memory_usage` config option.
230-
cache_memory = ["pympler"]
230+
cache-memory = ["pympler"]
231231
test = ["parameterized", "idna"]
232232

233233
# The duplication here is awful. I hate hate hate hate hate it. However, for now I want
@@ -258,7 +258,7 @@ all = [
258258
"jaeger-client", "opentracing",
259259
# redis
260260
"txredisapi", "hiredis",
261-
# cache_memory
261+
# cache-memory
262262
"pympler",
263263
# omitted:
264264
# - test: it's useful to have this separate from dev deps in the olddeps job

synapse/config/cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
159159

160160
self.track_memory_usage = cache_config.get("track_memory_usage", False)
161161
if self.track_memory_usage:
162-
check_requirements("cache_memory")
162+
check_requirements("cache-memory")
163163

164164
expire_caches = cache_config.get("expire_caches", True)
165165
cache_entry_ttl = cache_config.get("cache_entry_ttl", "30m")

0 commit comments

Comments
 (0)