summary refs log tree commit diff
path: root/synapse/config/repository.py
diff options
context:
space:
mode:
authorDavid Robertson <davidr@element.io>2022-03-01 17:44:41 +0000
committerGitHub <noreply@github.com>2022-03-01 17:44:41 +0000
commit313581e4e9bc2ec3d59ccff86e3a0c02661f71c4 (patch)
treee7cca1740f8fb1011201a3e05a973e6c9f513654 /synapse/config/repository.py
parentFix rare error in `ReadWriteLock` when writers complete immediately (#12105) (diff)
downloadsynapse-313581e4e9bc2ec3d59ccff86e3a0c02661f71c4.tar.xz
Use importlib.metadata to read requirements (#12088)
* Pull runtime dep checks into their own module
* Reimplement `check_requirements` using `importlib`

I've tried to make this clearer. We start by working out which of
Synapse's requirements we need to be installed here and now. I was
surprised that there wasn't an easier way to see which packages were
installed by a given extra.

I've pulled out the error messages into functions that deal with "is
this for an extra or not". And I've rearranged the loop over two
different sets of requirements into one loop with a "must be instaled"
flag.

I hope you agree that this is clearer.

* Test cases
Diffstat (limited to 'synapse/config/repository.py')
-rw-r--r--synapse/config/repository.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/synapse/config/repository.py b/synapse/config/repository.py
index 1980351e77..0a0d901bfb 100644
--- a/synapse/config/repository.py
+++ b/synapse/config/repository.py
@@ -20,8 +20,8 @@ from urllib.request import getproxies_environment  # type: ignore
 import attr
 
 from synapse.config.server import DEFAULT_IP_RANGE_BLACKLIST, generate_ip_set
-from synapse.python_dependencies import DependencyException, check_requirements
 from synapse.types import JsonDict
+from synapse.util.check_dependencies import DependencyException, check_requirements
 from synapse.util.module_loader import load_module
 
 from ._base import Config, ConfigError