mirror of
https://mau.dev/maunium/synapse.git
synced 2024-12-16 11:43:51 +01:00
Fix error message for optional dependencies
Signed-off-by: Willem Mulder <willemmaster@hotmail.com>
This commit is contained in:
parent
6b90ae6efc
commit
d528406cb8
2 changed files with 7 additions and 2 deletions
2
changelog.d/4450.bugfix
Normal file
2
changelog.d/4450.bugfix
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
The dependency checker now correctly reports a version mismatch for optional
|
||||||
|
dependencies, instead of reporting the dependency missing.
|
|
@ -143,9 +143,12 @@ def check_requirements(for_feature=None, _get_distribution=get_distribution):
|
||||||
for dependency in OPTS:
|
for dependency in OPTS:
|
||||||
try:
|
try:
|
||||||
_get_distribution(dependency)
|
_get_distribution(dependency)
|
||||||
except VersionConflict:
|
except VersionConflict as e:
|
||||||
deps_needed.append(dependency)
|
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:
|
except DistributionNotFound:
|
||||||
# If it's not found, we don't care
|
# If it's not found, we don't care
|
||||||
pass
|
pass
|
||||||
|
|
Loading…
Reference in a new issue