Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Add helpful error messages when importing optional dependencies#125

Merged
theacodes merged 2 commits intomasterfrom
import-errors
Mar 6, 2017
Merged

Add helpful error messages when importing optional dependencies#125
theacodes merged 2 commits intomasterfrom
import-errors

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 subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants