Skip to content

Commit 714f508

Browse files
dpebotJon Wayne Parrott
authored andcommitted
Auto-update dependencies. (#1093)
* Auto-update dependencies. * Fix storage notification poll sample Change-Id: I6afbc79d15e050531555e4c8e51066996717a0f3 * Fix spanner samples Change-Id: I40069222c60d57e8f3d3878167591af9130895cb * Drop coverage because it's not useful Change-Id: Iae399a7083d7866c3c7b9162d0de244fbff8b522 * Try again to fix flaky logging test Change-Id: I6225c074701970c17c426677ef1935bb6d7e36b4
1 parent 491da30 commit 714f508

File tree

45 files changed

+129
-129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+129
-129
lines changed

.coveragerc

Lines changed: 0 additions & 12 deletions
This file was deleted.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask==0.12.2
22
Flask-SQLAlchemy==2.2
33
gunicorn==19.7.1
4-
psycopg2==2.7.3
4+
psycopg2==2.7.3.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==0.12.2
2-
google-cloud-datastore==1.2.0
2+
google-cloud-datastore==1.3.0
33
gunicorn==19.7.1

appengine/flexible/django_cloudsql/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Django==1.11.4
22
mysqlclient==1.3.10
33
wheel==0.29.0
44
gunicorn==19.7.1
5-
psycopg2==2.7.3
5+
psycopg2==2.7.3.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Flask==0.12.2
2-
google-cloud-storage==1.3.2
2+
google-cloud-storage==1.4.0
33
gunicorn==19.7.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-endpoints==2.2.0
1+
google-endpoints==2.2.1
22
google-endpoints-api-management==1.1.3

auth/cloud-client/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-storage==1.3.2
1+
google-cloud-storage==1.4.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
google-cloud-bigquery==0.26.0
1+
google-cloud-bigquery==0.27.0
22
google-auth-oauthlib==0.1.0
33
pytz==2017.2

bigtable/hello/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-bigtable==0.26.0
2-
google-cloud-core==0.26.0
1+
google-cloud-bigtable==0.27.0
2+
google-cloud-core==0.27.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
google-cloud-happybase==0.26.0
2-
google-cloud-bigtable==0.26.0
3-
google-cloud-core==0.26.0
2+
google-cloud-bigtable==0.27.0
3+
google-cloud-core==0.27.0
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-bigtable==0.26.0
2-
google-cloud-monitoring==0.26.0
1+
google-cloud-bigtable==0.27.0
2+
google-cloud-monitoring==0.27.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-datastore==1.2.0
1+
google-cloud-datastore==1.3.0
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Flask==0.12.2
22
gunicorn==19.7.1
3-
google-cloud-vision==0.26.0
4-
google-cloud-storage==1.3.2
5-
google-cloud-datastore==1.2.0
3+
google-cloud-vision==0.27.0
4+
google-cloud-storage==1.4.0
5+
google-cloud-datastore==1.3.0

container_engine/django_tutorial/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ Django==1.11.4
22
mysqlclient==1.3.10
33
wheel==0.29.0
44
gunicorn==19.7.1
5-
psycopg2==2.7.3
5+
psycopg2==2.7.3.1
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-datastore==1.2.0
1+
google-cloud-datastore==1.3.0

dns/api/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-dns==0.26.0
1+
google-cloud-dns==0.27.0

error_reporting/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-error-reporting==0.26.0
1+
google-cloud-error-reporting==0.27.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-pubsub==0.27.0
1+
google-cloud-pubsub==0.28.2
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-language==0.27.0
1+
google-cloud-language==0.28.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-language==0.27.0
1+
google-cloud-language==0.28.0

language/sentiment/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-language==0.27.0
1+
google-cloud-language==0.28.0

logging/cloud-client/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-logging==1.2.0
1+
google-cloud-logging==1.3.0

logging/cloud-client/snippets_test.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,6 @@ def test_write():
4343

4444

4545
def test_delete(example_log):
46-
snippets.delete_logger(TEST_LOGGER_NAME)
46+
@eventually_consistent.call
47+
def _():
48+
snippets.delete_logger(TEST_LOGGER_NAME)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-monitoring==0.26.0
1+
google-cloud-monitoring==0.27.0

nox.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,7 @@ def _setup_appengine_sdk(session):
133133
#
134134

135135

136-
PYTEST_COMMON_ARGS = [
137-
'--cov',
138-
'--cov-config', os.path.abspath('.coveragerc'),
139-
'--cov-report', 'term']
136+
PYTEST_COMMON_ARGS = []
140137

141138
FLAKE8_COMMON_ARGS = [
142139
'--show-source', '--builtin', 'gettext', '--max-complexity', '20',

spanner/cloud-client/quickstart.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,11 @@ def run_quickstart():
3636
database = instance.database(database_id)
3737

3838
# Execute a simple SQL statement.
39-
results = database.execute_sql('SELECT 1')
39+
with database.snapshot() as snapshot:
40+
results = snapshot.execute_sql('SELECT 1')
4041

41-
for row in results:
42-
print(row)
42+
for row in results:
43+
print(row)
4344
# [END spanner_quickstart]
4445

4546

spanner/cloud-client/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-spanner==0.26.0
1+
google-cloud-spanner==0.27.0

spanner/cloud-client/snippets.py

Lines changed: 50 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,12 @@ def query_data(instance_id, database_id):
9494
instance = spanner_client.instance(instance_id)
9595
database = instance.database(database_id)
9696

97-
results = database.execute_sql(
98-
'SELECT SingerId, AlbumId, AlbumTitle FROM Albums')
97+
with database.snapshot() as snapshot:
98+
results = snapshot.execute_sql(
99+
'SELECT SingerId, AlbumId, AlbumTitle FROM Albums')
99100

100-
for row in results:
101-
print(u'SingerId: {}, AlbumId: {}, AlbumTitle: {}'.format(*row))
101+
for row in results:
102+
print(u'SingerId: {}, AlbumId: {}, AlbumTitle: {}'.format(*row))
102103

103104

104105
def read_data(instance_id, database_id):
@@ -107,14 +108,15 @@ def read_data(instance_id, database_id):
107108
instance = spanner_client.instance(instance_id)
108109
database = instance.database(database_id)
109110

110-
keyset = spanner.KeySet(all_=True)
111-
results = database.read(
112-
table='Albums',
113-
columns=('SingerId', 'AlbumId', 'AlbumTitle',),
114-
keyset=keyset,)
111+
with database.snapshot() as snapshot:
112+
keyset = spanner.KeySet(all_=True)
113+
results = snapshot.read(
114+
table='Albums',
115+
columns=('SingerId', 'AlbumId', 'AlbumTitle',),
116+
keyset=keyset,)
115117

116-
for row in results:
117-
print(u'SingerId: {}, AlbumId: {}, AlbumTitle: {}'.format(*row))
118+
for row in results:
119+
print(u'SingerId: {}, AlbumId: {}, AlbumTitle: {}'.format(*row))
118120

119121

120122
def query_data_with_new_column(instance_id, database_id):
@@ -130,11 +132,13 @@ def query_data_with_new_column(instance_id, database_id):
130132
instance = spanner_client.instance(instance_id)
131133
database = instance.database(database_id)
132134

133-
results = database.execute_sql(
134-
'SELECT SingerId, AlbumId, MarketingBudget FROM Albums')
135+
with database.snapshot() as snapshot:
136+
results = snapshot.execute_sql(
137+
'SELECT SingerId, AlbumId, MarketingBudget FROM Albums')
135138

136-
for row in results:
137-
print(u'SingerId: {}, AlbumId: {}, MarketingBudget: {}'.format(*row))
139+
for row in results:
140+
print(
141+
u'SingerId: {}, AlbumId: {}, MarketingBudget: {}'.format(*row))
138142

139143

140144
def add_index(instance_id, database_id):
@@ -183,16 +187,18 @@ def query_data_with_index(
183187
'start_title': type_pb2.Type(code=type_pb2.STRING),
184188
'end_title': type_pb2.Type(code=type_pb2.STRING)
185189
}
186-
results = database.execute_sql(
187-
"SELECT AlbumId, AlbumTitle, MarketingBudget "
188-
"FROM Albums@{FORCE_INDEX=AlbumsByAlbumTitle} "
189-
"WHERE AlbumTitle >= @start_title AND AlbumTitle < @end_title",
190-
params=params, param_types=param_types)
191190

192-
for row in results:
193-
print(
194-
u'AlbumId: {}, AlbumTitle: {}, '
195-
'MarketingBudget: {}'.format(*row))
191+
with database.snapshot() as snapshot:
192+
results = snapshot.execute_sql(
193+
"SELECT AlbumId, AlbumTitle, MarketingBudget "
194+
"FROM Albums@{FORCE_INDEX=AlbumsByAlbumTitle} "
195+
"WHERE AlbumTitle >= @start_title AND AlbumTitle < @end_title",
196+
params=params, param_types=param_types)
197+
198+
for row in results:
199+
print(
200+
u'AlbumId: {}, AlbumTitle: {}, '
201+
'MarketingBudget: {}'.format(*row))
196202

197203

198204
def read_data_with_index(instance_id, database_id):
@@ -209,15 +215,16 @@ def read_data_with_index(instance_id, database_id):
209215
instance = spanner_client.instance(instance_id)
210216
database = instance.database(database_id)
211217

212-
keyset = spanner.KeySet(all_=True)
213-
results = database.read(
214-
table='Albums',
215-
columns=('AlbumId', 'AlbumTitle'),
216-
keyset=keyset,
217-
index='AlbumsByAlbumTitle')
218+
with database.snapshot() as snapshot:
219+
keyset = spanner.KeySet(all_=True)
220+
results = snapshot.read(
221+
table='Albums',
222+
columns=('AlbumId', 'AlbumTitle'),
223+
keyset=keyset,
224+
index='AlbumsByAlbumTitle')
218225

219-
for row in results:
220-
print('AlbumId: {}, AlbumTitle: {}'.format(*row))
226+
for row in results:
227+
print('AlbumId: {}, AlbumTitle: {}'.format(*row))
221228

222229

223230
def add_storing_index(instance_id, database_id):
@@ -252,17 +259,18 @@ def read_data_with_storing_index(instance_id, database_id):
252259
instance = spanner_client.instance(instance_id)
253260
database = instance.database(database_id)
254261

255-
keyset = spanner.KeySet(all_=True)
256-
results = database.read(
257-
table='Albums',
258-
columns=('AlbumId', 'AlbumTitle', 'MarketingBudget'),
259-
keyset=keyset,
260-
index='AlbumsByAlbumTitle2')
262+
with database.snapshot() as snapshot:
263+
keyset = spanner.KeySet(all_=True)
264+
results = snapshot.read(
265+
table='Albums',
266+
columns=('AlbumId', 'AlbumTitle', 'MarketingBudget'),
267+
keyset=keyset,
268+
index='AlbumsByAlbumTitle2')
261269

262-
for row in results:
263-
print(
264-
u'AlbumId: {}, AlbumTitle: {}, '
265-
'MarketingBudget: {}'.format(*row))
270+
for row in results:
271+
print(
272+
u'AlbumId: {}, AlbumTitle: {}, '
273+
'MarketingBudget: {}'.format(*row))
266274

267275

268276
def add_column(instance_id, database_id):

speech/cloud-client/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-speech==0.28.0
1+
google-cloud-speech==0.29.0

storage/cloud-client/notification_polling.py

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,14 @@
4646

4747
import argparse
4848
import json
49-
import sys
49+
import time
5050

51-
from google.cloud import pubsub
51+
from google.cloud import pubsub_v1
5252

5353

5454
def summarize(message):
5555
# [START parse_message]
56-
data = message.data
56+
data = message.data.decode('utf-8')
5757
attributes = message.attributes
5858

5959
event_type = attributes['eventType']
@@ -87,24 +87,24 @@ def summarize(message):
8787
# [END parse_message]
8888

8989

90-
def poll_notifications(subscription_id):
90+
def poll_notifications(project, subscription_name):
9191
"""Polls a Cloud Pub/Sub subscription for new GCS events for display."""
9292
# [BEGIN poll_notifications]
93-
client = pubsub.Client()
94-
subscription = pubsub.subscription.Subscription(
95-
subscription_id, client=client)
93+
subscriber = pubsub_v1.SubscriberClient()
94+
subscription_path = subscriber.subscription_path(
95+
project, subscription_name)
9696

97-
if not subscription.exists():
98-
sys.stderr.write('Cannot find subscription {0}\n'.format(sys.argv[1]))
99-
return
97+
def callback(message):
98+
print('Received message:\n{1}'.format(summarize(message)))
99+
message.ack()
100100

101-
print('Polling for messages. Press ctrl+c to exit.')
101+
subscriber.subscribe(subscription_path, callback=callback)
102+
103+
# The subscriber is non-blocking, so we must keep the main thread from
104+
# exiting to allow it to process messages in the background.
105+
print('Listening for messages on {}'.format(subscription_path))
102106
while True:
103-
pulled = subscription.pull(max_messages=100)
104-
for ack_id, message in pulled:
105-
print('Received message {0}:\n{1}'.format(
106-
message.message_id, summarize(message)))
107-
subscription.acknowledge([ack_id])
107+
time.sleep(60)
108108
# [END poll_notifications]
109109

110110

storage/cloud-client/notification_polling_test.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@
1313
# limitations under the License.
1414

1515

16-
from google.cloud.pubsub.message import Message
16+
from google.cloud.pubsub_v1.subscriber.message import Message
17+
import mock
1718

1819
from notification_polling import summarize
1920

@@ -31,12 +32,15 @@ def test_parse_json_message():
3132
'notificationConfig': ('projects/_/buckets/mybucket/'
3233
'notificationConfigs/5'),
3334
'payloadFormat': 'JSON_API_V1'}
34-
data = ('{'
35-
' "size": 12345,'
36-
' "contentType": "text/html",'
37-
' "metageneration": 1'
38-
'}')
39-
message = Message(data, MESSAGE_ID, attributes=attributes)
35+
data = (b'{'
36+
b' "size": 12345,'
37+
b' "contentType": "text/html",'
38+
b' "metageneration": 1'
39+
b'}')
40+
message = Message(
41+
mock.Mock(data=data, attributes=attributes),
42+
MESSAGE_ID,
43+
mock.Mock())
4044
assert summarize(message) == (
4145
'\tEvent type: OBJECT_FINALIZE\n'
4246
'\tBucket ID: mybucket\n'

storage/cloud-client/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
google-cloud-storage==1.3.2
2-
google-cloud-pubsub==0.27.0
1+
google-cloud-storage==1.4.0
2+
google-cloud-pubsub==0.28.2

testing/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@ responses==0.7.0
1313
WebTest==2.0.28
1414
webapp2==2.5.2
1515
google-api-python-client==1.6.2
16-
google-cloud-core==0.26.0
16+
google-cloud-core==0.27.0
1717
gcp-devrel-py-tools==0.0.11
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-translate==1.1.0
1+
google-cloud-translate==1.2.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-videointelligence==0.25.0
1+
google-cloud-videointelligence==0.26.0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
google-cloud-videointelligence==0.25.0
1+
google-cloud-videointelligence==0.26.0

0 commit comments

Comments
 (0)