-
Notifications
You must be signed in to change notification settings - Fork 88
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
Test regression when grpcio is installed but grpcio-status is not #301
Comments
Hi @mgorny, Thanks for opening an issue. The intent was that Lines 38 to 42 in d2a729e
That said, I don't think separating the imports into two try/except blocks will make the code terribly more complicated.
Could you go into more details on this? Is it difficult to add |
The point is more like there's no clean way of expressing "if you have grpcio installed, install grpcio-status as well" from the point of python-api-core. We could technically make grpcio always install grpcio-status but if that was the right thing to do, why are they separate packages in the first place? That said, I'm not maintaining grpcio in Gentoo and i have no interest in it. From my perspective, it's just an optional dependency that now started causing trouble. |
Experiencing the same issue indirectly with google pubsub client, the stacktrace is:
|
Thanks for taking a look at this! I've noticed that while the fix in #355 is helpful in figuring out what's going on, consumer libraries (such as Could the relevant code here: python-api-core/google/api_core/exceptions.py Lines 600 to 611 in 112049e
grpc.Call actually exists, falling through to just returning an "generic" GoogleAPICallError if that's not the case?
|
CC @atulep
The following commit causes a regression in the test suite:
Prior to this commit, the package handled both missing and present
grpc
consistently. However, the following condition inexceptions.py
:means that if
grpc_status
module is not installed, the exception module behaves as ifgrpc
wasn't present even though other modules (notably tests) behave as if it was present. As a result, people having one but not the other module installed get a bunch of test failures because grpc-based tests are run but e.g. theexception
module'sfrom_grpc_error()
function fails sincegrpc
is forced toNone
.This is especially problematic since
grpcio-status
is a new optional dependency, and since it's not packaged on Gentoo, we'd effectively have to force people to uninstallgrpcio
.Environment details
python --version
3.8.12, 3.9.7pip --version
n/agoogle-api-core
version:pip show google-api-core
2.2.0, 2.2.1, git master (d2a729e)Steps to reproduce
git clone https://github.com/googleapis/python-api-core
cd python-api-core
python3.9 -m venv .venv
. .venv/bin/activate
pip install . grpcio pytest mock proto-plus pytest-asyncio
pytest
Stack trace
Example test failure:
The text was updated successfully, but these errors were encountered: