diff options
author | Mark Haines <mjark@negativecurvature.net> | 2015-09-18 18:52:08 +0100 |
---|---|---|
committer | Mark Haines <mjark@negativecurvature.net> | 2015-09-18 18:52:08 +0100 |
commit | 0b5c9adeb535304f04edae10079208c29ea730b7 (patch) | |
tree | b35e80b320fae727dee04e2d65e472c52aca4a7f /synapse/app/homeserver.py | |
parent | Remove run_on_reactor (diff) | |
parent | Add nacl.bindings to the list of modules checked. Re-arrange import order to ... (diff) | |
download | synapse-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/homeserver.py')
-rwxr-xr-x | synapse/app/homeserver.py | 17 |
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 ( |