Skip to content

Commit

Permalink
test: use 3.8 for system tests (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoshi-automation authored Jun 26, 2020
1 parent 71d7082 commit 73e06c1
Show file tree
Hide file tree
Showing 10 changed files with 99 additions and 77 deletions.
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@
intersphinx_mapping = {
"python": ("http://python.readthedocs.org/en/latest/", None),
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None),
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
"grpc": ("https://grpc.io/grpc/python/", None),
}

Expand Down
6 changes: 5 additions & 1 deletion google/cloud/pubsub.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,8 @@
from google.cloud.pubsub_v1 import types


__all__ = ("types", "PublisherClient", "SubscriberClient")
__all__ = (
"types",
"PublisherClient",
"SubscriberClient",
)
36 changes: 19 additions & 17 deletions google/cloud/pubsub_v1/gapic/publisher_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
from google.protobuf import field_mask_pb2


_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-pubsub").version
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-pubsub",).version


# TODO: remove conditional import after Python 2 support is dropped
Expand Down Expand Up @@ -116,7 +116,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
def project_path(cls, project):
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
"projects/{project}", project=project,
)

@classmethod
Expand All @@ -132,7 +132,7 @@ def subscription_path(cls, project, subscription):
def topic_path(cls, project, topic):
"""Return a fully-qualified topic string."""
return google.api_core.path_template.expand(
"projects/{project}/topics/{topic}", project=project, topic=topic
"projects/{project}/topics/{topic}", project=project, topic=topic,
)

def __init__(
Expand Down Expand Up @@ -219,12 +219,12 @@ def __init__(
self.transport = transport
else:
self.transport = publisher_grpc_transport.PublisherGrpcTransport(
address=api_endpoint, channel=channel, credentials=credentials
address=api_endpoint, channel=channel, credentials=credentials,
)

if client_info is None:
client_info = google.api_core.gapic_v1.client_info.ClientInfo(
gapic_version=_GAPIC_LIBRARY_VERSION
gapic_version=_GAPIC_LIBRARY_VERSION,
)
else:
client_info.gapic_version = _GAPIC_LIBRARY_VERSION
Expand All @@ -235,7 +235,7 @@ def __init__(
# (Ordinarily, these are the defaults specified in the `*_config.py`
# file next to this one.)
self._method_configs = google.api_core.gapic_v1.config.parse_method_configs(
client_config["interfaces"][self._INTERFACE_NAME]
client_config["interfaces"][self._INTERFACE_NAME],
)

# Save a dictionary of cached API call functions.
Expand Down Expand Up @@ -411,7 +411,7 @@ def update_topic(
client_info=self._client_info,
)

request = pubsub_pb2.UpdateTopicRequest(topic=topic, update_mask=update_mask)
request = pubsub_pb2.UpdateTopicRequest(topic=topic, update_mask=update_mask,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -490,7 +490,7 @@ def publish(
client_info=self._client_info,
)

request = pubsub_pb2.PublishRequest(topic=topic, messages=messages)
request = pubsub_pb2.PublishRequest(topic=topic, messages=messages,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -560,7 +560,7 @@ def get_topic(
client_info=self._client_info,
)

request = pubsub_pb2.GetTopicRequest(topic=topic)
request = pubsub_pb2.GetTopicRequest(topic=topic,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -651,7 +651,7 @@ def list_topics(
client_info=self._client_info,
)

request = pubsub_pb2.ListTopicsRequest(project=project, page_size=page_size)
request = pubsub_pb2.ListTopicsRequest(project=project, page_size=page_size,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -754,7 +754,7 @@ def list_topic_subscriptions(
)

request = pubsub_pb2.ListTopicSubscriptionsRequest(
topic=topic, page_size=page_size
topic=topic, page_size=page_size,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -862,7 +862,9 @@ def list_topic_snapshots(
client_info=self._client_info,
)

request = pubsub_pb2.ListTopicSnapshotsRequest(topic=topic, page_size=page_size)
request = pubsub_pb2.ListTopicSnapshotsRequest(
topic=topic, page_size=page_size,
)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -945,7 +947,7 @@ def delete_topic(
client_info=self._client_info,
)

request = pubsub_pb2.DeleteTopicRequest(topic=topic)
request = pubsub_pb2.DeleteTopicRequest(topic=topic,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1031,7 +1033,7 @@ def set_iam_policy(
client_info=self._client_info,
)

request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy)
request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1110,7 +1112,7 @@ def get_iam_policy(
)

request = iam_policy_pb2.GetIamPolicyRequest(
resource=resource, options=options_
resource=resource, options=options_,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1197,7 +1199,7 @@ def test_iam_permissions(
)

request = iam_policy_pb2.TestIamPermissionsRequest(
resource=resource, permissions=permissions
resource=resource, permissions=permissions,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1271,7 +1273,7 @@ def detach_subscription(
client_info=self._client_info,
)

request = pubsub_pb2.DetachSubscriptionRequest(subscription=subscription)
request = pubsub_pb2.DetachSubscriptionRequest(subscription=subscription,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down
46 changes: 24 additions & 22 deletions google/cloud/pubsub_v1/gapic/subscriber_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
from google.protobuf import timestamp_pb2


_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-pubsub").version
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-pubsub",).version


class SubscriberClient(object):
Expand Down Expand Up @@ -94,7 +94,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
def project_path(cls, project):
"""Return a fully-qualified project string."""
return google.api_core.path_template.expand(
"projects/{project}", project=project
"projects/{project}", project=project,
)

@classmethod
Expand All @@ -119,7 +119,7 @@ def subscription_path(cls, project, subscription):
def topic_path(cls, project, topic):
"""Return a fully-qualified topic string."""
return google.api_core.path_template.expand(
"projects/{project}/topics/{topic}", project=project, topic=topic
"projects/{project}/topics/{topic}", project=project, topic=topic,
)

def __init__(
Expand Down Expand Up @@ -209,12 +209,12 @@ def __init__(
self.transport = transport
else:
self.transport = subscriber_grpc_transport.SubscriberGrpcTransport(
address=api_endpoint, channel=channel, credentials=credentials
address=api_endpoint, channel=channel, credentials=credentials,
)

if client_info is None:
client_info = google.api_core.gapic_v1.client_info.ClientInfo(
gapic_version=_GAPIC_LIBRARY_VERSION
gapic_version=_GAPIC_LIBRARY_VERSION,
)
else:
client_info.gapic_version = _GAPIC_LIBRARY_VERSION
Expand All @@ -225,7 +225,7 @@ def __init__(
# (Ordinarily, these are the defaults specified in the `*_config.py`
# file next to this one.)
self._method_configs = google.api_core.gapic_v1.config.parse_method_configs(
client_config["interfaces"][self._INTERFACE_NAME]
client_config["interfaces"][self._INTERFACE_NAME],
)

# Save a dictionary of cached API call functions.
Expand Down Expand Up @@ -490,7 +490,7 @@ def get_subscription(
client_info=self._client_info,
)

request = pubsub_pb2.GetSubscriptionRequest(subscription=subscription)
request = pubsub_pb2.GetSubscriptionRequest(subscription=subscription,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -578,7 +578,7 @@ def update_subscription(
)

request = pubsub_pb2.UpdateSubscriptionRequest(
subscription=subscription, update_mask=update_mask
subscription=subscription, update_mask=update_mask,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -671,7 +671,7 @@ def list_subscriptions(
)

request = pubsub_pb2.ListSubscriptionsRequest(
project=project, page_size=page_size
project=project, page_size=page_size,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -755,7 +755,7 @@ def delete_subscription(
client_info=self._client_info,
)

request = pubsub_pb2.DeleteSubscriptionRequest(subscription=subscription)
request = pubsub_pb2.DeleteSubscriptionRequest(subscription=subscription,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -829,7 +829,7 @@ def get_snapshot(
client_info=self._client_info,
)

request = pubsub_pb2.GetSnapshotRequest(snapshot=snapshot)
request = pubsub_pb2.GetSnapshotRequest(snapshot=snapshot,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1002,7 +1002,7 @@ def acknowledge(
)

request = pubsub_pb2.AcknowledgeRequest(
subscription=subscription, ack_ids=ack_ids
subscription=subscription, ack_ids=ack_ids,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1253,7 +1253,7 @@ def modify_push_config(
)

request = pubsub_pb2.ModifyPushConfigRequest(
subscription=subscription, push_config=push_config
subscription=subscription, push_config=push_config,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1350,7 +1350,7 @@ def list_snapshots(
client_info=self._client_info,
)

request = pubsub_pb2.ListSnapshotsRequest(project=project, page_size=page_size)
request = pubsub_pb2.ListSnapshotsRequest(project=project, page_size=page_size,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1462,7 +1462,7 @@ def create_snapshot(
)

request = pubsub_pb2.CreateSnapshotRequest(
name=name, subscription=subscription, labels=labels
name=name, subscription=subscription, labels=labels,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1556,7 +1556,7 @@ def update_snapshot(
)

request = pubsub_pb2.UpdateSnapshotRequest(
snapshot=snapshot, update_mask=update_mask
snapshot=snapshot, update_mask=update_mask,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1633,7 +1633,7 @@ def delete_snapshot(
client_info=self._client_info,
)

request = pubsub_pb2.DeleteSnapshotRequest(snapshot=snapshot)
request = pubsub_pb2.DeleteSnapshotRequest(snapshot=snapshot,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1727,10 +1727,12 @@ def seek(

# Sanity check: We have some fields which are mutually exclusive;
# raise ValueError if more than one is sent.
google.api_core.protobuf_helpers.check_oneof(time=time, snapshot=snapshot)
google.api_core.protobuf_helpers.check_oneof(
time=time, snapshot=snapshot,
)

request = pubsub_pb2.SeekRequest(
subscription=subscription, time=time, snapshot=snapshot
subscription=subscription, time=time, snapshot=snapshot,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1817,7 +1819,7 @@ def set_iam_policy(
client_info=self._client_info,
)

request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy)
request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy,)
if metadata is None:
metadata = []
metadata = list(metadata)
Expand Down Expand Up @@ -1896,7 +1898,7 @@ def get_iam_policy(
)

request = iam_policy_pb2.GetIamPolicyRequest(
resource=resource, options=options_
resource=resource, options=options_,
)
if metadata is None:
metadata = []
Expand Down Expand Up @@ -1983,7 +1985,7 @@ def test_iam_permissions(
)

request = iam_policy_pb2.TestIamPermissionsRequest(
resource=resource, permissions=permissions
resource=resource, permissions=permissions,
)
if metadata is None:
metadata = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
# exception (channels come with credentials baked in already).
if channel is not None and credentials is not None:
raise ValueError(
"The `channel` and `credentials` arguments are mutually " "exclusive."
"The `channel` and `credentials` arguments are mutually " "exclusive.",
)

# Create the channel.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(
# exception (channels come with credentials baked in already).
if channel is not None and credentials is not None:
raise ValueError(
"The `channel` and `credentials` arguments are mutually " "exclusive."
"The `channel` and `credentials` arguments are mutually " "exclusive.",
)

# Create the channel.
Expand Down
Loading

0 comments on commit 73e06c1

Please sign in to comment.