summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorSilke Hofstra <silkeh@users.noreply.github.com>2019-04-16 12:41:17 +0200
committerAmber Brown <hawkowl@atleastfornow.net>2019-04-16 20:41:17 +1000
commita137f4eac028fefda0787a168dd8853653155bc3 (patch)
treefb81c255fdf0f384aa4d69aa24322dcda9fa6add /synapse
parentMerge pull request #5063 from matrix-org/erikj/move_endpoints (diff)
downloadsynapse-a137f4eac028fefda0787a168dd8853653155bc3.tar.xz
Add systemd-python to optional dependencies (#4339)
Using systemd-python allows for logging to the systemd journal,
as is documented in: `synapse/contrib/systemd/log_config.yaml`.

Signed-off-by: Silke Hofstra <silke@slxh.eu>
Diffstat (limited to 'synapse')
-rw-r--r--synapse/python_dependencies.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py
index 62c1748665..779f36dbed 100644
--- a/synapse/python_dependencies.py
+++ b/synapse/python_dependencies.py
@@ -86,18 +86,22 @@ CONDITIONAL_REQUIREMENTS = {
     "acme": ["txacme>=0.9.2"],
 
     "saml2": ["pysaml2>=4.5.0"],
+    "systemd": ["systemd-python>=231"],
     "url_preview": ["lxml>=3.5.0"],
     "test": ["mock>=2.0", "parameterized"],
     "sentry": ["sentry-sdk>=0.7.2"],
 }
 
+ALL_OPTIONAL_REQUIREMENTS = set()
+
+for name, optional_deps in CONDITIONAL_REQUIREMENTS.items():
+    # Exclude systemd as it's a system-based requirement.
+    if name not in ["systemd"]:
+        ALL_OPTIONAL_REQUIREMENTS = set(optional_deps) | ALL_OPTIONAL_REQUIREMENTS
 
-def list_requirements():
-    deps = set(REQUIREMENTS)
-    for opt in CONDITIONAL_REQUIREMENTS.values():
-        deps = set(opt) | deps
 
-    return list(deps)
+def list_requirements():
+    return list(set(REQUIREMENTS) | ALL_OPTIONAL_REQUIREMENTS)
 
 
 class DependencyException(Exception):