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

Commit

Permalink
Fix track_memory_usage on poetry-core 1.3.x installations
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
David Robertson committed Oct 18, 2022
1 parent 6fee2f4 commit ce2c268
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit ce2c268

Please sign in to comment.