diff --git a/django_cloud_deploy/cloudlib/project.py b/django_cloud_deploy/cloudlib/project.py index c6ec8402..94dae056 100644 --- a/django_cloud_deploy/cloudlib/project.py +++ b/django_cloud_deploy/cloudlib/project.py @@ -1,4 +1,4 @@ -# Copyright 2018 Google LLC +# Copyright 2019 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,6 +16,7 @@ See https://gcloud-python.readthedocs.io/en/latest/resource-manager/api.html """ +from django_cloud_deploy import __version__ from typing import Any, Dict, List import backoff @@ -50,10 +51,9 @@ def __init__(self, cloudresourcemanager_service: discovery.Resource): @classmethod def from_credentials(cls, credentials: credentials.Credentials): - http_client = http.set_user_agent(http.build_http(), - 'django-cloud-deploy') - auth_http = google_auth_httplib2.AuthorizedHttp(credentials, - http=http_client) + auth_http = google_auth_httplib2.AuthorizedHttp(credentials) + user_agent = '/'.join(['django-cloud-deploy', __version__.__version__]) + http.set_user_agent(auth_http, user_agent) return cls( discovery.build('cloudresourcemanager', 'v1', diff --git a/django_cloud_deploy/nox.py b/django_cloud_deploy/nox.py index 36875610..3470e708 100644 --- a/django_cloud_deploy/nox.py +++ b/django_cloud_deploy/nox.py @@ -32,7 +32,7 @@ 'google-cloud-storage==1.10.0', 'pexpect==4.6.0', 'psycopg2-binary==2.7.5', - 'google-api-python-client==1.7.4', + 'google-api-python-client==1.7.9', 'google-auth-httplib2==0.0.3', 'selenium==3.141.0', 'google-cloud-logging==1.8.0', diff --git a/setup.py b/setup.py index 1eb96e9c..29cca6bd 100644 --- a/setup.py +++ b/setup.py @@ -40,7 +40,7 @@ 'kubernetes>=6.0.0', 'grpcio>=1.14.1', 'pexpect>=4.6.0', - 'google-api-python-client>=1.7.4', + 'google-api-python-client>=1.7.9', 'google-auth-httplib2>=0.0.3', 'progressbar2>=3.38.0', 'portpicker>=1.2.0',