Skip to content

Commit cbbe6df

Browse files
refactor: use upstream noxfile (googleapis#79)
1 parent bdd9c44 commit cbbe6df

13 files changed

+216
-268
lines changed

docs/conf.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,10 +347,7 @@
347347
intersphinx_mapping = {
348348
"python": ("http://python.readthedocs.org/en/latest/", None),
349349
"google-auth": ("https://google-auth.readthedocs.io/en/stable", None),
350-
"google.api_core": (
351-
"https://googleapis.dev/python/google-api-core/latest/",
352-
None,
353-
),
350+
"google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,),
354351
"grpc": ("https://grpc.io/grpc/python/", None),
355352
}
356353

google/cloud/logging_v2/gapic/config_service_v2_client.py

Lines changed: 20 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,7 @@
4040
from google.protobuf import field_mask_pb2
4141

4242

43-
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution(
44-
"google-cloud-logging",
45-
).version
43+
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-logging",).version
4644

4745

4846
class ConfigServiceV2Client(object):
@@ -79,8 +77,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
7977
def billing_path(cls, billing_account):
8078
"""Return a fully-qualified billing string."""
8179
return google.api_core.path_template.expand(
82-
"billingAccounts/{billing_account}",
83-
billing_account=billing_account,
80+
"billingAccounts/{billing_account}", billing_account=billing_account,
8481
)
8582

8683
@classmethod
@@ -113,10 +110,7 @@ def exclusion_path(cls, project, exclusion):
113110
@classmethod
114111
def folder_path(cls, folder):
115112
"""Return a fully-qualified folder string."""
116-
return google.api_core.path_template.expand(
117-
"folders/{folder}",
118-
folder=folder,
119-
)
113+
return google.api_core.path_template.expand("folders/{folder}", folder=folder,)
120114

121115
@classmethod
122116
def folder_exclusion_path(cls, folder, exclusion):
@@ -131,17 +125,14 @@ def folder_exclusion_path(cls, folder, exclusion):
131125
def folder_sink_path(cls, folder, sink):
132126
"""Return a fully-qualified folder_sink string."""
133127
return google.api_core.path_template.expand(
134-
"folders/{folder}/sinks/{sink}",
135-
folder=folder,
136-
sink=sink,
128+
"folders/{folder}/sinks/{sink}", folder=folder, sink=sink,
137129
)
138130

139131
@classmethod
140132
def organization_path(cls, organization):
141133
"""Return a fully-qualified organization string."""
142134
return google.api_core.path_template.expand(
143-
"organizations/{organization}",
144-
organization=organization,
135+
"organizations/{organization}", organization=organization,
145136
)
146137

147138
@classmethod
@@ -166,17 +157,14 @@ def organization_sink_path(cls, organization, sink):
166157
def project_path(cls, project):
167158
"""Return a fully-qualified project string."""
168159
return google.api_core.path_template.expand(
169-
"projects/{project}",
170-
project=project,
160+
"projects/{project}", project=project,
171161
)
172162

173163
@classmethod
174164
def sink_path(cls, project, sink):
175165
"""Return a fully-qualified sink string."""
176166
return google.api_core.path_template.expand(
177-
"projects/{project}/sinks/{sink}",
178-
project=project,
179-
sink=sink,
167+
"projects/{project}/sinks/{sink}", project=project, sink=sink,
180168
)
181169

182170
def __init__(
@@ -265,12 +253,8 @@ def __init__(
265253
)
266254
self.transport = transport
267255
else:
268-
self.transport = (
269-
config_service_v2_grpc_transport.ConfigServiceV2GrpcTransport(
270-
address=api_endpoint,
271-
channel=channel,
272-
credentials=credentials,
273-
)
256+
self.transport = config_service_v2_grpc_transport.ConfigServiceV2GrpcTransport(
257+
address=api_endpoint, channel=channel, credentials=credentials,
274258
)
275259

276260
if client_info is None:
@@ -376,8 +360,7 @@ def list_sinks(
376360
)
377361

378362
request = logging_config_pb2.ListSinksRequest(
379-
parent=parent,
380-
page_size=page_size,
363+
parent=parent, page_size=page_size,
381364
)
382365
if metadata is None:
383366
metadata = []
@@ -467,9 +450,7 @@ def get_sink(
467450
client_info=self._client_info,
468451
)
469452

470-
request = logging_config_pb2.GetSinkRequest(
471-
sink_name=sink_name,
472-
)
453+
request = logging_config_pb2.GetSinkRequest(sink_name=sink_name,)
473454
if metadata is None:
474455
metadata = []
475456
metadata = list(metadata)
@@ -573,9 +554,7 @@ def create_sink(
573554
)
574555

575556
request = logging_config_pb2.CreateSinkRequest(
576-
parent=parent,
577-
sink=sink,
578-
unique_writer_identity=unique_writer_identity,
557+
parent=parent, sink=sink, unique_writer_identity=unique_writer_identity,
579558
)
580559
if metadata is None:
581560
metadata = []
@@ -780,9 +759,7 @@ def delete_sink(
780759
client_info=self._client_info,
781760
)
782761

783-
request = logging_config_pb2.DeleteSinkRequest(
784-
sink_name=sink_name,
785-
)
762+
request = logging_config_pb2.DeleteSinkRequest(sink_name=sink_name,)
786763
if metadata is None:
787764
metadata = []
788765
metadata = list(metadata)
@@ -880,8 +857,7 @@ def list_exclusions(
880857
)
881858

882859
request = logging_config_pb2.ListExclusionsRequest(
883-
parent=parent,
884-
page_size=page_size,
860+
parent=parent, page_size=page_size,
885861
)
886862
if metadata is None:
887863
metadata = []
@@ -971,9 +947,7 @@ def get_exclusion(
971947
client_info=self._client_info,
972948
)
973949

974-
request = logging_config_pb2.GetExclusionRequest(
975-
name=name,
976-
)
950+
request = logging_config_pb2.GetExclusionRequest(name=name,)
977951
if metadata is None:
978952
metadata = []
979953
metadata = list(metadata)
@@ -1064,8 +1038,7 @@ def create_exclusion(
10641038
)
10651039

10661040
request = logging_config_pb2.CreateExclusionRequest(
1067-
parent=parent,
1068-
exclusion=exclusion,
1041+
parent=parent, exclusion=exclusion,
10691042
)
10701043
if metadata is None:
10711044
metadata = []
@@ -1169,9 +1142,7 @@ def update_exclusion(
11691142
)
11701143

11711144
request = logging_config_pb2.UpdateExclusionRequest(
1172-
name=name,
1173-
exclusion=exclusion,
1174-
update_mask=update_mask,
1145+
name=name, exclusion=exclusion, update_mask=update_mask,
11751146
)
11761147
if metadata is None:
11771148
metadata = []
@@ -1247,9 +1218,7 @@ def delete_exclusion(
12471218
client_info=self._client_info,
12481219
)
12491220

1250-
request = logging_config_pb2.DeleteExclusionRequest(
1251-
name=name,
1252-
)
1221+
request = logging_config_pb2.DeleteExclusionRequest(name=name,)
12531222
if metadata is None:
12541223
metadata = []
12551224
metadata = list(metadata)
@@ -1337,9 +1306,7 @@ def get_cmek_settings(
13371306
client_info=self._client_info,
13381307
)
13391308

1340-
request = logging_config_pb2.GetCmekSettingsRequest(
1341-
name=name,
1342-
)
1309+
request = logging_config_pb2.GetCmekSettingsRequest(name=name,)
13431310
if metadata is None:
13441311
metadata = []
13451312
metadata = list(metadata)
@@ -1455,9 +1422,7 @@ def update_cmek_settings(
14551422
)
14561423

14571424
request = logging_config_pb2.UpdateCmekSettingsRequest(
1458-
name=name,
1459-
cmek_settings=cmek_settings,
1460-
update_mask=update_mask,
1425+
name=name, cmek_settings=cmek_settings, update_mask=update_mask,
14611426
)
14621427
if metadata is None:
14631428
metadata = []

google/cloud/logging_v2/gapic/logging_service_v2_client.py

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@
4444
from google.protobuf import field_mask_pb2
4545

4646

47-
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution(
48-
"google-cloud-logging",
49-
).version
47+
_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-logging",).version
5048

5149

5250
class LoggingServiceV2Client(object):
@@ -83,8 +81,7 @@ def from_service_account_file(cls, filename, *args, **kwargs):
8381
def billing_path(cls, billing_account):
8482
"""Return a fully-qualified billing string."""
8583
return google.api_core.path_template.expand(
86-
"billingAccounts/{billing_account}",
87-
billing_account=billing_account,
84+
"billingAccounts/{billing_account}", billing_account=billing_account,
8885
)
8986

9087
@classmethod
@@ -99,35 +96,27 @@ def billing_log_path(cls, billing_account, log):
9996
@classmethod
10097
def folder_path(cls, folder):
10198
"""Return a fully-qualified folder string."""
102-
return google.api_core.path_template.expand(
103-
"folders/{folder}",
104-
folder=folder,
105-
)
99+
return google.api_core.path_template.expand("folders/{folder}", folder=folder,)
106100

107101
@classmethod
108102
def folder_log_path(cls, folder, log):
109103
"""Return a fully-qualified folder_log string."""
110104
return google.api_core.path_template.expand(
111-
"folders/{folder}/logs/{log}",
112-
folder=folder,
113-
log=log,
105+
"folders/{folder}/logs/{log}", folder=folder, log=log,
114106
)
115107

116108
@classmethod
117109
def log_path(cls, project, log):
118110
"""Return a fully-qualified log string."""
119111
return google.api_core.path_template.expand(
120-
"projects/{project}/logs/{log}",
121-
project=project,
122-
log=log,
112+
"projects/{project}/logs/{log}", project=project, log=log,
123113
)
124114

125115
@classmethod
126116
def organization_path(cls, organization):
127117
"""Return a fully-qualified organization string."""
128118
return google.api_core.path_template.expand(
129-
"organizations/{organization}",
130-
organization=organization,
119+
"organizations/{organization}", organization=organization,
131120
)
132121

133122
@classmethod
@@ -143,8 +132,7 @@ def organization_log_path(cls, organization, log):
143132
def project_path(cls, project):
144133
"""Return a fully-qualified project string."""
145134
return google.api_core.path_template.expand(
146-
"projects/{project}",
147-
project=project,
135+
"projects/{project}", project=project,
148136
)
149137

150138
def __init__(
@@ -233,12 +221,8 @@ def __init__(
233221
)
234222
self.transport = transport
235223
else:
236-
self.transport = (
237-
logging_service_v2_grpc_transport.LoggingServiceV2GrpcTransport(
238-
address=api_endpoint,
239-
channel=channel,
240-
credentials=credentials,
241-
)
224+
self.transport = logging_service_v2_grpc_transport.LoggingServiceV2GrpcTransport(
225+
address=api_endpoint, channel=channel, credentials=credentials,
242226
)
243227

244228
if client_info is None:
@@ -327,9 +311,7 @@ def delete_log(
327311
client_info=self._client_info,
328312
)
329313

330-
request = logging_pb2.DeleteLogRequest(
331-
log_name=log_name,
332-
)
314+
request = logging_pb2.DeleteLogRequest(log_name=log_name,)
333315
if metadata is None:
334316
metadata = []
335317
metadata = list(metadata)
@@ -794,10 +776,7 @@ def list_logs(
794776
client_info=self._client_info,
795777
)
796778

797-
request = logging_pb2.ListLogsRequest(
798-
parent=parent,
799-
page_size=page_size,
800-
)
779+
request = logging_pb2.ListLogsRequest(parent=parent, page_size=page_size,)
801780
if metadata is None:
802781
metadata = []
803782
metadata = list(metadata)

0 commit comments

Comments
 (0)