summary refs log tree commit diff
path: root/synapse/app
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-09-18 18:52:08 +0100
committerMark Haines <mjark@negativecurvature.net>2015-09-18 18:52:08 +0100
commit0b5c9adeb535304f04edae10079208c29ea730b7 (patch)
treeb35e80b320fae727dee04e2d65e472c52aca4a7f /synapse/app
parentRemove run_on_reactor (diff)
parentAdd nacl.bindings to the list of modules checked. Re-arrange import order to ... (diff)
downloadsynapse-0b5c9adeb535304f04edae10079208c29ea730b7.tar.xz
Merge pull request #267 from matrix-org/markjh/missing_requirements
Print an example "pip install" line for a missing requirement
Diffstat (limited to 'synapse/app')
-rwxr-xr-xsynapse/app/homeserver.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/synapse/app/homeserver.py b/synapse/app/homeserver.py
index 68d37e5bda..15c0a4a003 100755
--- a/synapse/app/homeserver.py
+++ b/synapse/app/homeserver.py
@@ -16,10 +16,23 @@
 
 import sys
 sys.dont_write_bytecode = True
-from synapse.python_dependencies import check_requirements, DEPENDENCY_LINKS
+from synapse.python_dependencies import (
+    check_requirements, DEPENDENCY_LINKS, MissingRequirementError
+)
 
 if __name__ == '__main__':
-    check_requirements()
+    try:
+        check_requirements()
+    except MissingRequirementError as e:
+        message = "\n".join([
+            "Missing Requirement: %s" % (e.message,),
+            "To install run:",
+            "    pip install --upgrade --force \"%s\"" % (e.dependency,),
+            "",
+        ])
+        sys.stderr.writelines(message)
+        sys.exit(1)
+
 
 from synapse.storage.engines import create_engine, IncorrectDatabaseSetup
 from synapse.storage import (