Skip to content

Commit ed01f4e

Browse files
authored
Ensure that GRPC config file is included in MANIFEST.in after templating. (#7046)
* Pick up stub docstring fix in GAPIC generator. * Pick up order-of-enum fix from GAPIC generator. Closes #6931.
1 parent 9c488c4 commit ed01f4e

File tree

6 files changed

+64
-55
lines changed

6 files changed

+64
-55
lines changed

packages/google-cloud-spanner/google/cloud/spanner_admin_database_v1/gapic/transports/database_admin_grpc_transport.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def channel(self):
110110

111111
@property
112112
def list_databases(self):
113-
"""Return the gRPC stub for {$apiMethod.name}.
113+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.list_databases`.
114114
115115
Lists Cloud Spanner databases.
116116
@@ -123,7 +123,7 @@ def list_databases(self):
123123

124124
@property
125125
def create_database(self):
126-
"""Return the gRPC stub for {$apiMethod.name}.
126+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.create_database`.
127127
128128
Creates a new Cloud Spanner database and starts to prepare it for
129129
serving. The returned ``long-running operation`` will have a name of the
@@ -141,7 +141,7 @@ def create_database(self):
141141

142142
@property
143143
def get_database(self):
144-
"""Return the gRPC stub for {$apiMethod.name}.
144+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.get_database`.
145145
146146
Gets the state of a Cloud Spanner database.
147147
@@ -154,7 +154,7 @@ def get_database(self):
154154

155155
@property
156156
def update_database_ddl(self):
157-
"""Return the gRPC stub for {$apiMethod.name}.
157+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.update_database_ddl`.
158158
159159
Updates the schema of a Cloud Spanner database by
160160
creating/altering/dropping tables, columns, indexes, etc. The returned
@@ -172,7 +172,7 @@ def update_database_ddl(self):
172172

173173
@property
174174
def drop_database(self):
175-
"""Return the gRPC stub for {$apiMethod.name}.
175+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.drop_database`.
176176
177177
Drops (aka deletes) a Cloud Spanner database.
178178
@@ -185,7 +185,7 @@ def drop_database(self):
185185

186186
@property
187187
def get_database_ddl(self):
188-
"""Return the gRPC stub for {$apiMethod.name}.
188+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.get_database_ddl`.
189189
190190
Returns the schema of a Cloud Spanner database as a list of formatted
191191
DDL statements. This method does not show pending schema updates, those
@@ -200,7 +200,7 @@ def get_database_ddl(self):
200200

201201
@property
202202
def set_iam_policy(self):
203-
"""Return the gRPC stub for {$apiMethod.name}.
203+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.set_iam_policy`.
204204
205205
Sets the access control policy on a database resource. Replaces any
206206
existing policy.
@@ -217,7 +217,7 @@ def set_iam_policy(self):
217217

218218
@property
219219
def get_iam_policy(self):
220-
"""Return the gRPC stub for {$apiMethod.name}.
220+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.get_iam_policy`.
221221
222222
Gets the access control policy for a database resource. Returns an empty
223223
policy if a database exists but does not have a policy set.
@@ -234,7 +234,7 @@ def get_iam_policy(self):
234234

235235
@property
236236
def test_iam_permissions(self):
237-
"""Return the gRPC stub for {$apiMethod.name}.
237+
"""Return the gRPC stub for :meth:`DatabaseAdminClient.test_iam_permissions`.
238238
239239
Returns permissions that the caller has on the specified database
240240
resource.

packages/google-cloud-spanner/google/cloud/spanner_admin_instance_v1/gapic/transports/instance_admin_grpc_transport.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def channel(self):
110110

111111
@property
112112
def list_instance_configs(self):
113-
"""Return the gRPC stub for {$apiMethod.name}.
113+
"""Return the gRPC stub for :meth:`InstanceAdminClient.list_instance_configs`.
114114
115115
Lists the supported instance configurations for a given project.
116116
@@ -123,7 +123,7 @@ def list_instance_configs(self):
123123

124124
@property
125125
def get_instance_config(self):
126-
"""Return the gRPC stub for {$apiMethod.name}.
126+
"""Return the gRPC stub for :meth:`InstanceAdminClient.get_instance_config`.
127127
128128
Gets information about a particular instance configuration.
129129
@@ -136,7 +136,7 @@ def get_instance_config(self):
136136

137137
@property
138138
def list_instances(self):
139-
"""Return the gRPC stub for {$apiMethod.name}.
139+
"""Return the gRPC stub for :meth:`InstanceAdminClient.list_instances`.
140140
141141
Lists all instances in the given project.
142142
@@ -149,7 +149,7 @@ def list_instances(self):
149149

150150
@property
151151
def get_instance(self):
152-
"""Return the gRPC stub for {$apiMethod.name}.
152+
"""Return the gRPC stub for :meth:`InstanceAdminClient.get_instance`.
153153
154154
Gets information about a particular instance.
155155
@@ -162,7 +162,7 @@ def get_instance(self):
162162

163163
@property
164164
def create_instance(self):
165-
"""Return the gRPC stub for {$apiMethod.name}.
165+
"""Return the gRPC stub for :meth:`InstanceAdminClient.create_instance`.
166166
167167
Creates an instance and begins preparing it to begin serving. The
168168
returned ``long-running operation`` can be used to track the progress of
@@ -205,7 +205,7 @@ def create_instance(self):
205205

206206
@property
207207
def update_instance(self):
208-
"""Return the gRPC stub for {$apiMethod.name}.
208+
"""Return the gRPC stub for :meth:`InstanceAdminClient.update_instance`.
209209
210210
Updates an instance, and begins allocating or releasing resources as
211211
requested. The returned ``long-running operation`` can be used to track
@@ -253,7 +253,7 @@ def update_instance(self):
253253

254254
@property
255255
def delete_instance(self):
256-
"""Return the gRPC stub for {$apiMethod.name}.
256+
"""Return the gRPC stub for :meth:`InstanceAdminClient.delete_instance`.
257257
258258
Deletes an instance.
259259
@@ -276,7 +276,7 @@ def delete_instance(self):
276276

277277
@property
278278
def set_iam_policy(self):
279-
"""Return the gRPC stub for {$apiMethod.name}.
279+
"""Return the gRPC stub for :meth:`InstanceAdminClient.set_iam_policy`.
280280
281281
Sets the access control policy on an instance resource. Replaces any
282282
existing policy.
@@ -293,7 +293,7 @@ def set_iam_policy(self):
293293

294294
@property
295295
def get_iam_policy(self):
296-
"""Return the gRPC stub for {$apiMethod.name}.
296+
"""Return the gRPC stub for :meth:`InstanceAdminClient.get_iam_policy`.
297297
298298
Gets the access control policy for an instance resource. Returns an
299299
empty policy if an instance exists but does not have a policy set.
@@ -310,7 +310,7 @@ def get_iam_policy(self):
310310

311311
@property
312312
def test_iam_permissions(self):
313-
"""Return the gRPC stub for {$apiMethod.name}.
313+
"""Return the gRPC stub for :meth:`InstanceAdminClient.test_iam_permissions`.
314314
315315
Returns permissions that the caller has on the specified instance
316316
resource.

packages/google-cloud-spanner/google/cloud/spanner_v1/gapic/enums.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,24 @@ class TypeCode(enum.IntEnum):
7777
STRUCT = 9
7878

7979

80+
class ExecuteSqlRequest(object):
81+
class QueryMode(enum.IntEnum):
82+
"""
83+
Mode in which the statement must be processed.
84+
85+
Attributes:
86+
NORMAL (int): The default mode. Only the statement results are returned.
87+
PLAN (int): This mode returns only the query plan, without any results or
88+
execution statistics information.
89+
PROFILE (int): This mode returns both the query plan and the execution statistics along
90+
with the results.
91+
"""
92+
93+
NORMAL = 0
94+
PLAN = 1
95+
PROFILE = 2
96+
97+
8098
class PlanNode(object):
8199
class Kind(enum.IntEnum):
82100
"""
@@ -97,21 +115,3 @@ class Kind(enum.IntEnum):
97115
KIND_UNSPECIFIED = 0
98116
RELATIONAL = 1
99117
SCALAR = 2
100-
101-
102-
class ExecuteSqlRequest(object):
103-
class QueryMode(enum.IntEnum):
104-
"""
105-
Mode in which the statement must be processed.
106-
107-
Attributes:
108-
NORMAL (int): The default mode. Only the statement results are returned.
109-
PLAN (int): This mode returns only the query plan, without any results or
110-
execution statistics information.
111-
PROFILE (int): This mode returns both the query plan and the execution statistics along
112-
with the results.
113-
"""
114-
115-
NORMAL = 0
116-
PLAN = 1
117-
PROFILE = 2

packages/google-cloud-spanner/google/cloud/spanner_v1/gapic/transports/spanner_grpc_transport.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def channel(self):
108108

109109
@property
110110
def create_session(self):
111-
"""Return the gRPC stub for {$apiMethod.name}.
111+
"""Return the gRPC stub for :meth:`SpannerClient.create_session`.
112112
113113
Creates a new session. A session can be used to perform transactions
114114
that read and/or modify data in a Cloud Spanner database. Sessions are
@@ -137,7 +137,7 @@ def create_session(self):
137137

138138
@property
139139
def get_session(self):
140-
"""Return the gRPC stub for {$apiMethod.name}.
140+
"""Return the gRPC stub for :meth:`SpannerClient.get_session`.
141141
142142
Gets a session. Returns ``NOT_FOUND`` if the session does not exist.
143143
This is mainly useful for determining whether a session is still alive.
@@ -151,7 +151,7 @@ def get_session(self):
151151

152152
@property
153153
def list_sessions(self):
154-
"""Return the gRPC stub for {$apiMethod.name}.
154+
"""Return the gRPC stub for :meth:`SpannerClient.list_sessions`.
155155
156156
Lists all sessions in a given database.
157157
@@ -164,7 +164,7 @@ def list_sessions(self):
164164

165165
@property
166166
def delete_session(self):
167-
"""Return the gRPC stub for {$apiMethod.name}.
167+
"""Return the gRPC stub for :meth:`SpannerClient.delete_session`.
168168
169169
Ends a session, releasing server resources associated with it.
170170
@@ -177,7 +177,7 @@ def delete_session(self):
177177

178178
@property
179179
def execute_sql(self):
180-
"""Return the gRPC stub for {$apiMethod.name}.
180+
"""Return the gRPC stub for :meth:`SpannerClient.execute_sql`.
181181
182182
Executes an SQL statement, returning all results in a single reply. This
183183
method cannot be used to return a result set larger than 10 MiB; if the
@@ -200,7 +200,7 @@ def execute_sql(self):
200200

201201
@property
202202
def execute_streaming_sql(self):
203-
"""Return the gRPC stub for {$apiMethod.name}.
203+
"""Return the gRPC stub for :meth:`SpannerClient.execute_streaming_sql`.
204204
205205
Like ``ExecuteSql``, except returns the result set as a stream. Unlike
206206
``ExecuteSql``, there is no limit on the size of the returned result
@@ -216,7 +216,7 @@ def execute_streaming_sql(self):
216216

217217
@property
218218
def read(self):
219-
"""Return the gRPC stub for {$apiMethod.name}.
219+
"""Return the gRPC stub for :meth:`SpannerClient.read`.
220220
221221
Reads rows from the database using key lookups and scans, as a simple
222222
key/value style alternative to ``ExecuteSql``. This method cannot be
@@ -239,7 +239,7 @@ def read(self):
239239

240240
@property
241241
def streaming_read(self):
242-
"""Return the gRPC stub for {$apiMethod.name}.
242+
"""Return the gRPC stub for :meth:`SpannerClient.streaming_read`.
243243
244244
Like ``Read``, except returns the result set as a stream. Unlike
245245
``Read``, there is no limit on the size of the returned result set.
@@ -255,7 +255,7 @@ def streaming_read(self):
255255

256256
@property
257257
def begin_transaction(self):
258-
"""Return the gRPC stub for {$apiMethod.name}.
258+
"""Return the gRPC stub for :meth:`SpannerClient.begin_transaction`.
259259
260260
Begins a new transaction. This step can often be skipped: ``Read``,
261261
``ExecuteSql`` and ``Commit`` can begin a new transaction as a
@@ -270,7 +270,7 @@ def begin_transaction(self):
270270

271271
@property
272272
def commit(self):
273-
"""Return the gRPC stub for {$apiMethod.name}.
273+
"""Return the gRPC stub for :meth:`SpannerClient.commit`.
274274
275275
Commits a transaction. The request includes the mutations to be applied
276276
to rows in the database.
@@ -290,7 +290,7 @@ def commit(self):
290290

291291
@property
292292
def rollback(self):
293-
"""Return the gRPC stub for {$apiMethod.name}.
293+
"""Return the gRPC stub for :meth:`SpannerClient.rollback`.
294294
295295
Rolls back a transaction, releasing any locks it holds. It is a good
296296
idea to call this for any transaction that includes one or more ``Read``
@@ -309,7 +309,7 @@ def rollback(self):
309309

310310
@property
311311
def partition_query(self):
312-
"""Return the gRPC stub for {$apiMethod.name}.
312+
"""Return the gRPC stub for :meth:`SpannerClient.partition_query`.
313313
314314
Creates a set of partition tokens that can be used to execute a query
315315
operation in parallel. Each of the returned partition tokens can be used
@@ -332,7 +332,7 @@ def partition_query(self):
332332

333333
@property
334334
def partition_read(self):
335-
"""Return the gRPC stub for {$apiMethod.name}.
335+
"""Return the gRPC stub for :meth:`SpannerClient.partition_read`.
336336
337337
Creates a set of partition tokens that can be used to execute a read
338338
operation in parallel. Each of the returned partition tokens can be used

packages/google-cloud-spanner/synth.metadata

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"updateTime": "2018-12-07T13:26:48.951251Z",
2+
"updateTime": "2019-01-04T18:38:23.269891Z",
33
"sources": [
44
{
55
"generator": {
66
"name": "artman",
7-
"version": "0.16.2",
8-
"dockerImage": "googleapis/artman@sha256:2f6b261ee7fe1aedf238991c93a20b3820de37a343d0cacf3e3e9555c2aaf2ea"
7+
"version": "0.16.4",
8+
"dockerImage": "googleapis/artman@sha256:8b45fae963557c3299921037ecbb86f0689f41b1b4aea73408ebc50562cb2857"
99
}
1010
},
1111
{
1212
"git": {
1313
"name": "googleapis",
1414
"remote": "https://github.com/googleapis/googleapis.git",
15-
"sha": "200fbbe59cc7b0077ae525eb5f3d6420c0c53e61",
16-
"internalRef": "224174014"
15+
"sha": "c050b8885af23bfbc4e2858858db47e33e311da7",
16+
"internalRef": "227870263"
1717
}
1818
},
1919
{

packages/google-cloud-spanner/synth.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,13 @@
131131
templated_files = common.py_library(unit_cov_level=97, cov_level=100)
132132
s.move(templated_files)
133133

134+
# Template's MANIFEST.in does not include the needed GAPIC config file.
135+
# See PR #6928.
136+
s.replace(
137+
"MANIFEST.in",
138+
"include README.rst LICENSE\n",
139+
"include README.rst LICENSE\n"
140+
"include google/cloud/spanner_v1/gapic/transports/spanner.grpc.config\n",
141+
)
142+
134143
s.shell.run(["nox", "-s", "blacken"], hide_output=False)

0 commit comments

Comments
 (0)