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

Fix track_memory_usage on poetry-core 1.3.x installations #14221

Merged
merged 2 commits into from
Oct 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/14221.misc
Original file line number Diff line number Diff line change
@@ -0,0 +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.
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ jwt = ["authlib"]
# (if it is not installed, we fall back to slow code.)
redis = ["txredisapi", "hiredis"]
# Required to use experimental `caches.track_memory_usage` config option.
cache_memory = ["pympler"]
cache-memory = ["pympler"]
test = ["parameterized", "idna"]

# The duplication here is awful. I hate hate hate hate hate it. However, for now I want
Expand Down Expand Up @@ -258,7 +258,7 @@ all = [
"jaeger-client", "opentracing",
# redis
"txredisapi", "hiredis",
# cache_memory
# cache-memory
"pympler",
# omitted:
# - test: it's useful to have this separate from dev deps in the olddeps job
Expand Down
2 changes: 1 addition & 1 deletion synapse/config/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:

self.track_memory_usage = cache_config.get("track_memory_usage", False)
if self.track_memory_usage:
check_requirements("cache_memory")
check_requirements("cache-memory")

expire_caches = cache_config.get("expire_caches", True)
cache_entry_ttl = cache_config.get("cache_entry_ttl", "30m")
Expand Down