diff options
author | Willem Mulder <willemmaster@hotmail.com> | 2019-01-23 18:41:59 +0100 |
---|---|---|
committer | Willem Mulder <willemmaster@hotmail.com> | 2019-01-23 18:44:57 +0100 |
commit | d528406cb875b78907c7f7dc9872c1d2c22dc46c (patch) | |
tree | c0c9c2d0ad5c63403726c813e85d80da6af39564 | |
parent | Merge pull request #4445 from matrix-org/anoa/user_dir_develop_backport (diff) | |
download | synapse-d528406cb875b78907c7f7dc9872c1d2c22dc46c.tar.xz |
Fix error message for optional dependencies
Signed-off-by: Willem Mulder <willemmaster@hotmail.com>
-rw-r--r-- | changelog.d/4450.bugfix | 2 | ||||
-rw-r--r-- | synapse/python_dependencies.py | 7 |
2 files changed, 7 insertions, 2 deletions
diff --git a/changelog.d/4450.bugfix b/changelog.d/4450.bugfix new file mode 100644 index 0000000000..b194e94c15 --- /dev/null +++ b/changelog.d/4450.bugfix @@ -0,0 +1,2 @@ +The dependency checker now correctly reports a version mismatch for optional +dependencies, instead of reporting the dependency missing. diff --git a/synapse/python_dependencies.py b/synapse/python_dependencies.py index 756721e304..df3e94dee0 100644 --- a/synapse/python_dependencies.py +++ b/synapse/python_dependencies.py @@ -143,9 +143,12 @@ def check_requirements(for_feature=None, _get_distribution=get_distribution): for dependency in OPTS: try: _get_distribution(dependency) - except VersionConflict: + except VersionConflict as e: deps_needed.append(dependency) - errors.append("Needed %s but it was not installed" % (dependency,)) + errors.append( + "Needed optional %s, got %s==%s" + % (dependency, e.dist.project_name, e.dist.version) + ) except DistributionNotFound: # If it's not found, we don't care pass |