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

Commit 9e219fb

Browse files
David RobertsonFizzadar
authored andcommitted
Fix track_memory_usage on poetry-core 1.3.x installations (matrix-org#14221)
* Fix `track_memory_usage` on poetry-core 1.3.x installations The same kind of problem as discussed in matrix-org#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 # Conflicts: # pyproject.toml
1 parent d506eb3 commit 9e219fb

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
@@ -228,7 +228,7 @@ jwt = ["authlib"]
228228
# (if it is not installed, we fall back to slow code.)
229229
redis = ["txredisapi", "hiredis", "jump-consistent-hash"]
230230
# Required to use experimental `caches.track_memory_usage` config option.
231-
cache_memory = ["pympler"]
231+
cache-memory = ["pympler"]
232232
test = ["parameterized", "idna"]
233233

234234
# The duplication here is awful. I hate hate hate hate hate it. However, for now I want
@@ -259,7 +259,7 @@ all = [
259259
"jaeger-client", "opentracing",
260260
# redis
261261
"txredisapi", "hiredis", "jump-consistent-hash",
262-
# cache_memory
262+
# cache-memory
263263
"pympler",
264264
# omitted:
265265
# - 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)