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

Add helpful error messages when importing optional dependencies #125

Merged
merged 2 commits into from
Mar 6, 2017

Conversation

theacodes
Copy link
Contributor

Resolves #101

Copy link
Contributor

@dhermes dhermes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. How exhaustive were you in searching for places where this fails?
  2. Can you add a tox environment without the deps instead of doing the pragma: NO COVER? Then you can integrate that into the coverage report?

import grpc
except ImportError: # pragma: NO COVER
raise ImportError(
'gRPC is not installed, please install grpcio to use the gRPC '

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor Author

How exhaustive were you in searching for places where this fails?

Pretty exhaustive

Can you add a tox environment without the deps instead of doing the pragma: NO COVER? Then you can integrate that into the coverage report?

This'll make the coverage environment impossible to run standalone, unless I'm misunderstanding the request?

@dhermes
Copy link
Contributor

dhermes commented Mar 1, 2017

This'll make the coverage environment impossible to run standalone, unless I'm misunderstanding the request?

That's correct, but the contents of this PR indicate that true coverage could not be done in a single environment.

@theacodes
Copy link
Contributor Author

That's correct, but the contents of this PR indicate that true coverage could not be done in a single environment.

@dhermes that was already the case, we have several import guards.

@dhermes
Copy link
Contributor

dhermes commented Mar 1, 2017

We can do better than sprinkling the NO COVER-s, so why not do better?

@theacodes
Copy link
Contributor Author

@dhermes per our side conversion, created #127 to discuss this separately.

@dhermes
Copy link
Contributor

dhermes commented Mar 1, 2017

SGTM LGTM

@theacodes theacodes merged commit b9101e3 into master Mar 6, 2017
@theacodes theacodes deleted the import-errors branch March 6, 2017 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants