Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message for optional dependencies #4450

Merged
merged 1 commit into from Feb 13, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.
+7 −2
Diff settings

Always

Just for now

Fix error message for optional dependencies

Signed-off-by: Willem Mulder <willemmaster@hotmail.com>
  • Loading branch information...
14mRh4X0r committed Jan 23, 2019
commit d528406cb875b78907c7f7dc9872c1d2c22dc46c
Copy path View 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:
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
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.