Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit f6fd32c

Browse filesBrowse files
chore: Update gapic-generator-python to v1.6.1 (#120)
* chore: update to gapic-generator-python 1.5.0 feat: add support for `google.cloud.<api>.__version__` PiperOrigin-RevId: 484665853 Source-Link: googleapis/googleapis@8eb249a Source-Link: https://github.com/googleapis/googleapis-gen/commit/c8aa327b5f478865fc3fd91e3c2768e54e26ad44 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzhhYTMyN2I1ZjQ3ODg2NWZjM2ZkOTFlM2MyNzY4ZTU0ZTI2YWQ0NCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update version in gapic_version.py * add .release-please-manifest.json with correct version * add owlbot.py to exclude generated gapic_version.py * set manifest to true in .github/release-please.yml * chore: Update to gapic-generator-python 1.6.0 feat(python): Add typing to proto.Message based class attributes feat(python): Snippetgen handling of repeated enum field PiperOrigin-RevId: 487326846 Source-Link: googleapis/googleapis@da380c7 Source-Link: https://github.com/googleapis/googleapis-gen/commit/61ef5762ee6731a0cbbfea22fd0eecee51ab1c8e Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNjFlZjU3NjJlZTY3MzFhMGNiYmZlYTIyZmQwZWVjZWU1MWFiMWM4ZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: Update gapic-generator-python to v1.6.1 PiperOrigin-RevId: 488036204 Source-Link: googleapis/googleapis@08f275f Source-Link: https://github.com/googleapis/googleapis-gen/commit/555c0945e60649e38739ae64bc45719cdf72178f Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNTU1YzA5NDVlNjA2NDllMzg3MzlhZTY0YmM0NTcxOWNkZjcyMTc4ZiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * set library type to OTHER * add release-please-config.json Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent d1b7fc0 commit f6fd32c
Copy full SHA for f6fd32c
Expand file treeCollapse file tree

16 files changed

+181
-45
lines changed

‎.github/release-please.yml

Copy file name to clipboardExpand all lines: .github/release-please.yml
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
releaseType: python
22
handleGHRelease: true
3+
manifest: true
34
# NOTE: this section is generated by synthtool.languages.python
45
# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py
56
branches:

‎.release-please-manifest.json

Copy file name to clipboard
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
".": "1.2.8"
3+
}

‎.repo-metadata.json

Copy file name to clipboardExpand all lines: .repo-metadata.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"issue_tracker": "http://github.com/googleapis/python-source-context/issues",
77
"release_level": "stable",
88
"language": "python",
9-
"library_type": "GAPIC_AUTO",
9+
"library_type": "OTHER",
1010
"repo": "googleapis/python-source-context",
1111
"distribution_name": "google-cloud-source-context",
1212
"api_id": "source.googleapis.com",

‎docs/source_context_v1/types.rst

Copy file name to clipboardExpand all lines: docs/source_context_v1/types.rst
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,4 @@ Types for Google Cloud Source Context v1 API
33

44
.. automodule:: google.cloud.source_context_v1.types
55
:members:
6-
:undoc-members:
76
:show-inheritance:

‎google/cloud/source_context/__init__.py

Copy file name to clipboardExpand all lines: google/cloud/source_context/__init__.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.source_context import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
1619

1720

1821
from google.cloud.source_context_v1.types.source_context import (
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# -*- coding: utf-8 -*-
2+
# Copyright 2022 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
__version__ = "1.2.8" # {x-release-please-version}

‎google/cloud/source_context_v1/__init__.py

Copy file name to clipboardExpand all lines: google/cloud/source_context_v1/__init__.py
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from google.cloud.source_context import gapic_version as package_version
17+
18+
__version__ = package_version.__version__
1619

1720

1821
from .types.source_context import (

‎google/cloud/source_context_v1/types/source_context.py

Copy file name to clipboardExpand all lines: google/cloud/source_context_v1/types/source_context.py
+30-28Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16+
from typing import MutableMapping, MutableSequence
17+
1618
import proto # type: ignore
1719

1820
__protobuf__ = proto.module(
@@ -67,25 +69,25 @@ class SourceContext(proto.Message):
6769
This field is a member of `oneof`_ ``context``.
6870
"""
6971

70-
cloud_repo = proto.Field(
72+
cloud_repo: "CloudRepoSourceContext" = proto.Field(
7173
proto.MESSAGE,
7274
number=1,
7375
oneof="context",
7476
message="CloudRepoSourceContext",
7577
)
76-
cloud_workspace = proto.Field(
78+
cloud_workspace: "CloudWorkspaceSourceContext" = proto.Field(
7779
proto.MESSAGE,
7880
number=2,
7981
oneof="context",
8082
message="CloudWorkspaceSourceContext",
8183
)
82-
gerrit = proto.Field(
84+
gerrit: "GerritSourceContext" = proto.Field(
8385
proto.MESSAGE,
8486
number=3,
8587
oneof="context",
8688
message="GerritSourceContext",
8789
)
88-
git = proto.Field(
90+
git: "GitSourceContext" = proto.Field(
8991
proto.MESSAGE,
9092
number=6,
9193
oneof="context",
@@ -100,16 +102,16 @@ class ExtendedSourceContext(proto.Message):
100102
Attributes:
101103
context (google.cloud.source_context_v1.types.SourceContext):
102104
Any source context.
103-
labels (Mapping[str, str]):
105+
labels (MutableMapping[str, str]):
104106
Labels with user defined metadata.
105107
"""
106108

107-
context = proto.Field(
109+
context: "SourceContext" = proto.Field(
108110
proto.MESSAGE,
109111
number=1,
110112
message="SourceContext",
111113
)
112-
labels = proto.MapField(
114+
labels: MutableMapping[str, str] = proto.MapField(
113115
proto.STRING,
114116
proto.STRING,
115117
number=2,
@@ -133,12 +135,12 @@ class Kind(proto.Enum):
133135
MOVABLE = 2
134136
OTHER = 4
135137

136-
kind = proto.Field(
138+
kind: Kind = proto.Field(
137139
proto.ENUM,
138140
number=1,
139141
enum=Kind,
140142
)
141-
name = proto.Field(
143+
name: str = proto.Field(
142144
proto.STRING,
143145
number=2,
144146
)
@@ -172,22 +174,22 @@ class CloudRepoSourceContext(proto.Message):
172174
This field is a member of `oneof`_ ``revision``.
173175
"""
174176

175-
repo_id = proto.Field(
177+
repo_id: "RepoId" = proto.Field(
176178
proto.MESSAGE,
177179
number=1,
178180
message="RepoId",
179181
)
180-
revision_id = proto.Field(
182+
revision_id: str = proto.Field(
181183
proto.STRING,
182184
number=2,
183185
oneof="revision",
184186
)
185-
alias_name = proto.Field(
187+
alias_name: str = proto.Field(
186188
proto.STRING,
187189
number=3,
188190
oneof="revision",
189191
)
190-
alias_context = proto.Field(
192+
alias_context: "AliasContext" = proto.Field(
191193
proto.MESSAGE,
192194
number=4,
193195
oneof="revision",
@@ -207,12 +209,12 @@ class CloudWorkspaceSourceContext(proto.Message):
207209
most recent snapshot.
208210
"""
209211

210-
workspace_id = proto.Field(
212+
workspace_id: "CloudWorkspaceId" = proto.Field(
211213
proto.MESSAGE,
212214
number=1,
213215
message="CloudWorkspaceId",
214216
)
215-
snapshot_id = proto.Field(
217+
snapshot_id: str = proto.Field(
216218
proto.STRING,
217219
number=2,
218220
)
@@ -250,25 +252,25 @@ class GerritSourceContext(proto.Message):
250252
This field is a member of `oneof`_ ``revision``.
251253
"""
252254

253-
host_uri = proto.Field(
255+
host_uri: str = proto.Field(
254256
proto.STRING,
255257
number=1,
256258
)
257-
gerrit_project = proto.Field(
259+
gerrit_project: str = proto.Field(
258260
proto.STRING,
259261
number=2,
260262
)
261-
revision_id = proto.Field(
263+
revision_id: str = proto.Field(
262264
proto.STRING,
263265
number=3,
264266
oneof="revision",
265267
)
266-
alias_name = proto.Field(
268+
alias_name: str = proto.Field(
267269
proto.STRING,
268270
number=4,
269271
oneof="revision",
270272
)
271-
alias_context = proto.Field(
273+
alias_context: "AliasContext" = proto.Field(
272274
proto.MESSAGE,
273275
number=5,
274276
oneof="revision",
@@ -288,11 +290,11 @@ class GitSourceContext(proto.Message):
288290
required.
289291
"""
290292

291-
url = proto.Field(
293+
url: str = proto.Field(
292294
proto.STRING,
293295
number=1,
294296
)
295-
revision_id = proto.Field(
297+
revision_id: str = proto.Field(
296298
proto.STRING,
297299
number=2,
298300
)
@@ -321,13 +323,13 @@ class RepoId(proto.Message):
321323
This field is a member of `oneof`_ ``id``.
322324
"""
323325

324-
project_repo_id = proto.Field(
326+
project_repo_id: "ProjectRepoId" = proto.Field(
325327
proto.MESSAGE,
326328
number=1,
327329
oneof="id",
328330
message="ProjectRepoId",
329331
)
330-
uid = proto.Field(
332+
uid: str = proto.Field(
331333
proto.STRING,
332334
number=2,
333335
oneof="id",
@@ -346,11 +348,11 @@ class ProjectRepoId(proto.Message):
346348
default repo.
347349
"""
348350

349-
project_id = proto.Field(
351+
project_id: str = proto.Field(
350352
proto.STRING,
351353
number=1,
352354
)
353-
repo_name = proto.Field(
355+
repo_name: str = proto.Field(
354356
proto.STRING,
355357
number=2,
356358
)
@@ -370,12 +372,12 @@ class CloudWorkspaceId(proto.Message):
370372
the Source API's CreateWorkspace method.
371373
"""
372374

373-
repo_id = proto.Field(
375+
repo_id: "RepoId" = proto.Field(
374376
proto.MESSAGE,
375377
number=1,
376378
message="RepoId",
377379
)
378-
name = proto.Field(
380+
name: str = proto.Field(
379381
proto.STRING,
380382
number=2,
381383
)

‎owlbot.py

Copy file name to clipboard
+56Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Copyright 2022 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
import json
16+
from pathlib import Path
17+
import shutil
18+
19+
import synthtool as s
20+
import synthtool.gcp as gcp
21+
from synthtool.languages import python
22+
23+
# ----------------------------------------------------------------------------
24+
# Copy the generated client from the owl-bot staging directory
25+
# ----------------------------------------------------------------------------
26+
27+
clean_up_generated_samples = True
28+
29+
# Load the default version defined in .repo-metadata.json.
30+
default_version = json.load(open(".repo-metadata.json", "rt")).get(
31+
"default_version"
32+
)
33+
34+
for library in s.get_staging_dirs(default_version):
35+
if clean_up_generated_samples:
36+
shutil.rmtree("samples/generated_samples", ignore_errors=True)
37+
clean_up_generated_samples = False
38+
s.move([library], excludes=["**/gapic_version.py"])
39+
s.remove_staging_dirs()
40+
41+
# ----------------------------------------------------------------------------
42+
# Add templated files
43+
# ----------------------------------------------------------------------------
44+
45+
templated_files = gcp.CommonTemplates().py_library(
46+
cov_level=100,
47+
microgenerator=True,
48+
versions=gcp.common.detect_versions(path="./google", default_first=True),
49+
)
50+
s.move(templated_files, excludes=[".coveragerc", ".github/release-please.yml"])
51+
52+
python.py_samples(skip_readmes=True)
53+
54+
# run format session for all directories which have a noxfile
55+
for noxfile in Path(".").glob("**/noxfile.py"):
56+
s.shell.run(["nox", "-s", "format"], cwd=noxfile.parent, hide_output=False)

‎release-please-config.json

Copy file name to clipboard
+19Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
3+
"packages": {
4+
".": {
5+
"release-type": "python",
6+
"extra-files": [
7+
"google/cloud/source_context/gapic_version.py"
8+
]
9+
}
10+
},
11+
"release-type": "python",
12+
"plugins": [
13+
{
14+
"type": "sentence-case"
15+
}
16+
],
17+
"initial-version": "0.1.0"
18+
}
19+

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.