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

python3 system tests fail to use gRPC #2001

Closed
dhermes opened this issue Jul 19, 2016 · 22 comments
Closed

python3 system tests fail to use gRPC #2001

dhermes opened this issue Jul 19, 2016 · 22 comments
Assignees

Comments

@dhermes
Copy link
Contributor

dhermes commented Jul 19, 2016

@tseaver Can you confirm? I'm seeing basic imports failing.

For example:

======================================================================
ERROR: test_log_struct (logging_.TestLogging)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/travis/build/GoogleCloudPlatform/gcloud-python/system_tests/logging_.py", line 149, in test_log_struct
    entries, _ = _retry_backoff(_has_entries, logger.list_entries)
  File "/home/travis/build/GoogleCloudPlatform/gcloud-python/system_tests/logging_.py", line 37, in _retry_backoff
    from grpc.beta.interfaces import StatusCode
ImportError: cannot import name 'StatusCode'
@tseaver
Copy link
Contributor

tseaver commented Jul 20, 2016

@dhermes Looks like they need to dump the PYTHONPATH=_testing bit.

@dhermes
Copy link
Contributor Author

dhermes commented Jul 20, 2016

But grpcio successfully installs in the Python 3 environment otherwise?

UPDATE: Or you're saying that the GAX version wouldn't be used if the import failed?

@tseaver
Copy link
Contributor

tseaver commented Jul 20, 2016

I've run the Py3k system tests with grpcio installed (and the gax-* libraries), but suppressing having _testing on the PYTHONPATH.

@dhermes
Copy link
Contributor Author

dhermes commented Jul 20, 2016

On my machine pip3 install grpcio fails with

could not find grpc_python_plugin (protoc plugin for GRPC Python)

I could put grpc_python_plugin on my path but that won't help Travis.

@tseaver
Copy link
Contributor

tseaver commented Jul 20, 2016

I'm beginning to think we should back out all the "just pretend grpc works" stuff we've done (make it a pure extra), disabled by default. I also want to shoot the _testing directory in the head.

@dhermes
Copy link
Contributor Author

dhermes commented Jul 20, 2016

The _testing directory was just there for unit tests (so imports didn't break), never intended to be used in system tests. The real culprit is grpcio.

@tseaver
Copy link
Contributor

tseaver commented Jul 20, 2016

I think unit tests don't really need it, either: the bigtable tests could just use `unittest2.skipUnless' like the GAX-related tests in logging and pubsub.

@dhermes
Copy link
Contributor Author

dhermes commented Jul 20, 2016

At the time it was added, there was no Travis environment where grpcio installed, so that was the only way. I'm fine with your suggestion given the current state of things.

@tseaver
Copy link
Contributor

tseaver commented Jul 21, 2016

W00t! https://pypi.python.org/pypi/grpcio/1.0.0rc1/#downloads has wheels for Python 3.4 on Linux/Mac/Windows!

@dhermes
Copy link
Contributor Author

dhermes commented Jul 21, 2016

I'm surprised they're at / near a 1.0

@tseaver
Copy link
Contributor

tseaver commented Jul 21, 2016

I wonder if pinning the RC would unbreak Travis system-tests3 and Appveyor.

@nathanielmanistaatgoogle

Apologies for the gap in 3.4-on-Windows.

@daspecster
Copy link
Contributor

@tseaver https://ci.appveyor.com/project/daspecster/gcloud-python-utjkc/build/job/ibd6g2k1a4gkumjo

Installed c:\users\appveyor\appdata\local\temp\1\easy_install-idvc8i\grpcio-1.0.0rc1\.eggs\markupsafe-0.23-py2.7-win32.egg
warning: no files found matching '*.h' under directory 'src\python\grpcio\grpc'
warning: no files found matching '*.python' under directory 'src\python\grpcio\grpc'
warning: no previously-included files matching '*.so' found under directory 'src\python\grpcio\grpc\_cython'
warning: no previously-included files matching '*.pyd' found under directory 'src\python\grpcio\grpc\_cython'
warning: no files found matching 'src\python\grpcio\precompiled.py'
cygrpc.c
include\grpc/impl/codegen/compression_types.h(38) : fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory
a.c

@soltanmm
Copy link

@daspecster Looks like Appveyor is trying to build from source on Windows for Python 2.7.

https://pypi.python.org/packages/3f/81/b14dc4e143d1eb0efabb0c8a4d88fafc6798d6392e26867f4e45a44d617a/grpcio-1.0.0rc1.tar.gz#md5=ce2462a64aa86670696a50c6d947d5e6

It should be downloading the wheels...

@dhermes
Copy link
Contributor Author

dhermes commented Jul 22, 2016

I think the issue is that pip install grpcio won't grab he RC version so it's trying a pre-1.0 release. Either that or your wheel doesn't support Windows?

@soltanmm
Copy link

Note that here you'll need to use the --pre flag to get 1.0.0rc1 unless you want to be grabbing it during nosetests as part of the command's potentially problematic gathering of (constrained to egg or .tar.gz?) dependencies (AFAICT).

@daspecster
Copy link
Contributor

Thanks @soltanmm, I actually just forced the version with pip install grpcio==1.0.0rc1 for now to try it in my branch.

https://ci.appveyor.com/project/daspecster/gcloud-python-pjqjn

@daspecster
Copy link
Contributor

@dhermes
Copy link
Contributor Author

dhermes commented Jul 25, 2016

64-bit 3.4 fails with

    include\grpc/impl/codegen/compression_types.h(38) : fatal error C1083: Cannot open include file: 'stdbool.h': No such file or directory
    creating Users
    creating Users\appveyor

while both versions of 3.5 fail with an OpenSSL issue

@soltanmm
Copy link

soltanmm commented Jul 26, 2016

IIRC grpcio can be built within a MinGW 64-bit Windows environment with vanilla Python 3.4 (NOT e.g. MSYS2's) if configured to use the GCC toolchain via e.g. -c mingw32. grpcio-tools will fail with linker errors that might be alleviated by compiling with TDM-GCC (haven't tried that yet) or finishing up C++98-ifying the plug-in code enough for MSVC 2010 to handle it.

It looks like y'all just need grpcio, not grpcio-tools, though. Is that the case?

EDIT: Turns out I recalled incorrectly and that grpcio also fails with linker errors.

@tseaver
Copy link
Contributor

tseaver commented Jul 26, 2016

@soltanmm Correct: users of gcloud-python only need grpcio: developers may need grpcio-tools for regenerating proto-based files, but we don't have any Windows-based developers, and we don't do that task via Windows CI.

@tseaver
Copy link
Contributor

tseaver commented Aug 25, 2016

Via #2065, #2085.

@tseaver tseaver closed this as completed Aug 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants