Repository navigation
Closed
Labels
api: loggingIssues related to the Cloud Logging API.Issues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.grpc
Description
/cc @bjwatson, @tbetbetbe
Recent grcpcio releases actually install and work on Python 3.4+, so I'm trying to get our system tests running with GAX enabled. Both pubsub and logging show errors like:
======================================================================
ERROR: test_create_metric (logging_.TestLogging)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/system_tests/logging_.py", line 156, in test_create_metric
self.assertFalse(metric.exists())
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/system-tests3/lib/python3.4/site-packages/gcloud/logging/metric.py", line 128, in exists
client.metrics_api.metric_get(self.project, self.name)
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/system-tests3/lib/python3.4/site-packages/gcloud/logging/client.py", line 117, in metrics_api
generated = GeneratedMetricsAPI()
File "/home/tseaver/projects/agendaless/Google/src/gcloud-python/.tox/system-tests3/lib/python3.4/site-packages/google/logging/v2/metrics_service_v2_api.py", line 168, in __init__
__name__, 'metrics_service_v2_client_config.json'))
File "/opt/Python-3.4.3/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'To reproduce:
$ git clone git@github:GoogleCloudPlatform/gcloud-python
$ cd gcloud-python
$ tox -e system-tests3 --notest
$ GCLOUD_ENABLE_GAX=1 .tox/system-tests3/bin/python system_tests/run_system_test.py --package=pubsub # or loggingMetadata
Metadata
Assignees
Labels
api: loggingIssues related to the Cloud Logging API.Issues related to the Cloud Logging API.api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.grpc
Activity
bjwatson commentedon Jun 29, 2016
@geigerj Can you take a look?
geigerj commentedon Jun 29, 2016
We currently develop/test GAX and GAPIC only on Python 2.7. @bjwatson @tbetbetbe -- we should discuss support for Python 3. I'll update this afterward.
bjwatson commentedon Jun 29, 2016
Thanks @geigerj. I just noticed that, too.
@tseaver Do you need to support python3 now? Do you have an alternative to using the GAPIC surface for now?
tseaver commentedon Jun 29, 2016
@bjwatson We have JSON-over-HTTP support as the default for both pubsub and logging (including Python2). We require that the user explicitly enable gax/grpc with an environment variable (which I forgot to show in the "to reproduce" example until just now). The packages all install cleanly on Python3, which is nice; getting them to work cleanly there would be nicer. :) But it isn't an emergency.
bjwatson commentedon Jun 30, 2016
@tseaver Cool, thanks for the context.
tseaver commentedon Jul 11, 2016
@rok987 this issue.
bjwatson commentedon Aug 9, 2016
@tseaver Can you see if this is still an issue? Thanks!
tseaver commentedon Aug 9, 2016
The 0.8.0 wrappers for pubsub/logging still don't work on Py3k. See this gist for details.
geigerj commentedon Aug 10, 2016
I've uploaded 0.8.1 wrappers for logging and pubsub (with other APIs to follow) that should fix the JSON load error. Please try again and update.
(I wasn't able to repro; on the last step, I'm getting a
Missing variables: GOOGLE_APPLICATION_CREDENTIALSeven after following the instructions at https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/CONTRIBUTING.rst#running-system-tests and setting that environment variable explicitly.)tseaver commentedon Aug 10, 2016
@geigerj did you set the
GCLOUD_TESTS_PROJECT_IDvariable?geigerj commentedon Aug 10, 2016
Yup, both
GCLOUD_TESTS_PROJECT_IDandGOOGLE_APPLICATION_CREDENTIALSare set.tseaver commentedon Aug 10, 2016
With the
0.8.1wrappers, bothpubsubandloggingsystem tests pass for me on Python 3.4 withGCLOUD_ENABLE_GAXset:tseaver commentedon Aug 10, 2016
@geigerj Can you show the failing output? And the result of
$ env | grep GCLOUD?geigerj commentedon Aug 10, 2016
Excellent, I'm glad the tests are passing now.
I've figured my problem out. It was my fault: the path that I stored in
GOOGLE_APPLICATION_CREDENTIALSwas wrong. (Although, the error messageMissing variables: GOOGLE_APPLICATION_CREDENTIALSdoesn't distinguish between the variable being unset and the credentials file not being found.)tseaver commentedon Aug 10, 2016
Testing envvar issue tracked at #2084.
fix: resolve issue with missing import for certain enums in **/types/… (
chore(tests): add cryptography to constraints file (#1944)
fix: create query job in job.result() if doesn't exist (#1944)
samples: add cloud client samples from python-docs-samples (#626)
feat: Can cast locally in hybrid engine (#1944)