-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Adding gcloud.bigtable package. #1122
Conversation
I'm having a hard time finding my way around this - what problem are we solving? |
Point of this PR: Add the basic Extra helpful in this PR: In Problem to solve (thing I asked Nathaniel about): Importing gRPC in unit tests (in a Dan's solution to above problem: Make a fake |
@tseaver Any thoughts? @nathanielmanistaatgoogle Does my last comment clarify the purpose? |
It helps! I'm still not completely clear though - why bend over backwards to function in an environment in which "the gRPC core system libs are not on the What's the relationship between I'm not saying anything's wrong here; I just don't yet understand. |
We don't want users of This is really just a stop-gap until users can reliably install gRPC core and |
Okay. Then it's crazy, but once one has bought into its particular craziness, there's nothing wrong with it. Since it's a stop-gap I counsel filing a clean-up bug and including at least one |
RE: "crazy". I am very open to other ideas, if you have any. This just seemed like the only way to rely on an "upstream" dependency without hurting users that didn't need / want it. |
@tseaver WDYT here? |
The only other idea I have is "catch a raised |
@@ -11,6 +11,8 @@ deps = | |||
nose | |||
unittest2 | |||
protobuf==3.0.0-alpha-1 | |||
setenv = | |||
PYTHONPATH = {toxinidir}/_testing |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@nathanielmanistaatgoogle "catch a raised |
Thanks for saying that; I think I get it now. |
Initial commit just adds the basic import time check for gRPC and testing for all possible install states. It also adds a shadowed _testing/grpc that we can use to mock the installed library for tests.
26be1c8
to
75809ae
Compare
@tseaver PTAL. I dropped the The |
LGTM |
Adding gcloud.bigtable package.
Initial commit just adds the basic import time check for gRPC and testing for all possible install states. It also adds a shadowed _testing/grpc that we can use to mock the installed library for tests.
We can discuss alternatives to mocking out
grpc
imports in dhermes/gcloud-python-bigtable#10 or right here. As far as I know, there is no way to globally (i.e. between / before modules) step in front of__import__
without doing some serious engineering.@nathanielmanistaatgoogle Any better ideas than this one for allowing unit tests that "depend" on grpc to run? (None of the gRPC code is ever called in unit tests, just in system tests. Though the gRPC objects get mocked out, the imports need to work so
nose
doesn't get angry.)