Skip to content

Commit

Permalink
Re-generate library, removing obsolete synth modifications. (#5825)
Browse files Browse the repository at this point in the history
  • Loading branch information
theacodes committed Aug 21, 2018
1 parent 6313584 commit d6fe5e1
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 46 deletions.
4 changes: 1 addition & 3 deletions pubsub/google/cloud/pubsub_v1/gapic/publisher_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import google.api_core.path_template
import google.api_core.grpc_helpers
import google.api_core.page_iterator
import google.api_core.path_template
import grpc

from google.cloud.pubsub_v1.gapic import publisher_client_config
Expand Down Expand Up @@ -164,9 +165,6 @@ def __init__(self,
credentials=credentials,
)

self.iam_policy_stub = (iam_policy_pb2.IAMPolicyStub(channel))
self.publisher_stub = (pubsub_pb2_grpc.PublisherStub(channel))

if client_info is None:
client_info = (
google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO)
Expand Down
4 changes: 1 addition & 3 deletions pubsub/google/cloud/pubsub_v1/gapic/subscriber_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import google.api_core.gapic_v1.method
import google.api_core.grpc_helpers
import google.api_core.page_iterator
import google.api_core.path_template
import google.api_core.protobuf_helpers
import grpc

Expand Down Expand Up @@ -185,9 +186,6 @@ def __init__(self,
credentials=credentials,
)

self.iam_policy_stub = (iam_policy_pb2.IAMPolicyStub(channel))
self.subscriber_stub = (pubsub_pb2_grpc.SubscriberStub(channel))

if client_info is None:
client_info = (
google.api_core.gapic_v1.client_info.DEFAULT_CLIENT_INFO)
Expand Down
38 changes: 0 additions & 38 deletions pubsub/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,26 +53,6 @@
' pubsub_v1',
' subscriber_client')

# iam_policy_pb2_grpc doesn't exist.
s.replace(
['google/cloud/pubsub_v1/gapic/publisher_client.py',
'google/cloud/pubsub_v1/gapic/subscriber_client.py'],
'from google.iam.v1 import iam_policy_pb2_grpc\n',
'')
s.replace(
['google/cloud/pubsub_v1/gapic/transports/publisher_grpc_transport.py',
'google/cloud/pubsub_v1/gapic/transports/subscriber_grpc_transport.py'],
'from google.iam.v1 import iam_policy_pb2_grpc\n',
'from google.iam.v1 import iam_policy_pb2\n')
s.replace(
'google/cloud/pubsub_v1/gapic/transports/publisher_grpc_transport.py',
'iam_policy_pb2_grpc',
'iam_policy_pb2')
s.replace(
'google/cloud/pubsub_v1/gapic/transports/subscriber_grpc_transport.py',
'iam_policy_pb2_grpc',
'iam_policy_pb2')

# DEFAULT SCOPES are being used. so let's force them in.
s.replace(
'google/cloud/pubsub_v1/gapic/*er_client.py',
Expand All @@ -86,24 +66,6 @@
\g<0>'''
)


# Stubs are missing
s.replace(
'google/cloud/pubsub_v1/gapic/subscriber_client.py',
'^(\s+)if client_info is None:\n',
'\g<1>self.iam_policy_stub = (iam_policy_pb2.IAMPolicyStub(channel))'
'\g<1>self.subscriber_stub = (pubsub_pb2_grpc.SubscriberStub(channel))\n'
'\g<0>'
)

s.replace(
'google/cloud/pubsub_v1/gapic/publisher_client.py',
'^(\s+)if client_info is None:\n',
'\g<1>self.iam_policy_stub = (iam_policy_pb2.IAMPolicyStub(channel))'
'\g<1>self.publisher_stub = (pubsub_pb2_grpc.PublisherStub(channel))\n'
'\g<0>'
)

s.replace(
'google/cloud/pubsub_v1/gapic/publisher_client.py',
'import google.api_core.gapic_v1.method\n',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def test_init_emulator(monkeypatch):
#
# Sadly, there seems to be no good way to do this without poking at
# the private API of gRPC.
channel = client.api.publisher_stub.Publish._channel
channel = client.api.transport.publish._channel
assert channel.target().decode('utf8') == '/foo/bar/'


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def test_init_emulator(monkeypatch):
#
# Sadly, there seems to be no good way to do this without poking at
# the private API of gRPC.
channel = client.api.subscriber_stub.Pull._channel
channel = client.api.transport.pull._channel
assert channel.target().decode('utf8') == '/baz/bacon/'


Expand Down

0 comments on commit d6fe5e1

Please sign in to comment.