Skip to content

Commit 32f77ca

Browse files
authored
chore: add client post-processing to .librarian/generator-input (#14204)
This PR adds a `client-post-processing` directory and corresponding post-processing files to `.librarian/generator-input` as these files are needed for client library generation. This PR was created using the following commands ``` mkdir .librarian/generator-input/client-post-processing cp -r scripts/client-post-processing/* .librarian/generator-input/client-post-processing ``` The directory `scripts/client-post-processing` can be removed once all of the `.OwlBot.yaml` files have been removed and [owlbot automation](https://github.com/googleapis/repo-automation-bots/tree/main/packages/owl-bot) is no longer used.
1 parent 4967d97 commit 32f77ca

14 files changed

+3885
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright 2023 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+
description: Add missing dependency for google-cloud-common
15+
url: https://github.com/googleapis/gapic-generator-python/issues/1836
16+
replacements:
17+
- paths: [
18+
packages/google-cloud-filestore/setup.py,
19+
]
20+
before: |
21+
dependencies = \[
22+
"google-api-core\[grpc\] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
23+
# Exclude incompatible versions of `google-auth`
24+
# See https://github.com/googleapis/google-cloud-python/issues/12364
25+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
26+
"proto-plus >= 1.22.3, <2.0.0",
27+
after: |
28+
dependencies = [
29+
"google-api-core[grpc] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
30+
# Exclude incompatible versions of `google-auth`
31+
# See https://github.com/googleapis/google-cloud-python/issues/12364
32+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
33+
"google-cloud-common >= 1.0.0, <2.0.0",
34+
"proto-plus >= 1.22.3, <2.0.0",
35+
count: 1
36+
- paths: [
37+
packages/google-cloud-filestore/testing/constraints-3.7.txt
38+
]
39+
before: |
40+
google-api-core==1.34.1
41+
google-auth==2.14.1
42+
proto-plus==1.22.3
43+
after: |
44+
google-api-core==1.34.1
45+
google-auth==2.14.1
46+
google-cloud-common==1.0.0
47+
proto-plus==1.22.3
48+
count: 1
Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
# Copyright 2023 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+
description: setup.py and testing/constraints-3.7.txt are missing necessary dependencies
15+
url: https://github.com/googleapis/gapic-generator-python/issues/1831
16+
replacements:
17+
- paths: [
18+
packages/google-cloud-gke-hub/setup.py
19+
]
20+
before: |
21+
dependencies = \[
22+
"google-api-core\[grpc\] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
23+
# Exclude incompatible versions of `google-auth`
24+
# See https://github.com/googleapis/google-cloud-python/issues/12364
25+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
26+
"proto-plus >= 1.22.3, <2.0.0",
27+
after: |
28+
dependencies = [
29+
"google-api-core[grpc] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
30+
# Exclude incompatible versions of `google-auth`
31+
# See https://github.com/googleapis/google-cloud-python/issues/12364
32+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
33+
"grpc-google-iam-v1 >=0.12.4, <1.0.0",
34+
"proto-plus >= 1.22.3, <2.0.0",
35+
count: 1
36+
- paths: [
37+
packages/google-cloud-gke-hub/testing/constraints-3.7.txt
38+
]
39+
before: |
40+
google-api-core==1.34.1
41+
google-auth==2.14.1
42+
proto-plus==1.22.3
43+
after: |
44+
google-api-core==1.34.1
45+
google-auth==2.14.1
46+
grpc-google-iam-v1==0.12.4
47+
proto-plus==1.22.3
48+
count: 1
49+
- paths: [
50+
packages/google-cloud-build/setup.py
51+
]
52+
before: |
53+
dependencies = \[
54+
"google-api-core\[grpc\] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
55+
# Exclude incompatible versions of `google-auth`
56+
# See https://github.com/googleapis/google-cloud-python/issues/12364
57+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
58+
"proto-plus >= 1.22.3, <2.0.0",
59+
after: |
60+
dependencies = [
61+
"google-api-core[grpc] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
62+
# Exclude incompatible versions of `google-auth`
63+
# See https://github.com/googleapis/google-cloud-python/issues/12364
64+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
65+
"grpc-google-iam-v1 >=0.12.4, <1.0.0",
66+
"proto-plus >= 1.22.3, <2.0.0",
67+
count: 1
68+
- paths: [
69+
packages/google-cloud-build/testing/constraints-3.7.txt
70+
]
71+
before: |
72+
google-api-core==1.34.1
73+
google-auth==2.14.1
74+
proto-plus==1.22.3
75+
after: |
76+
google-api-core==1.34.1
77+
google-auth==2.14.1
78+
grpc-google-iam-v1==0.12.4
79+
proto-plus==1.22.3
80+
count: 1
81+
- paths: [
82+
packages/google-cloud-binary-authorization/setup.py
83+
]
84+
before: |
85+
dependencies = \[
86+
"google-api-core\[grpc\] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
87+
# Exclude incompatible versions of `google-auth`
88+
# See https://github.com/googleapis/google-cloud-python/issues/12364
89+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
90+
"proto-plus >= 1.22.3, <2.0.0",
91+
after: |
92+
dependencies = [
93+
"google-api-core[grpc] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
94+
# Exclude incompatible versions of `google-auth`
95+
# See https://github.com/googleapis/google-cloud-python/issues/12364
96+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
97+
"grafeas >= 1.1.2, <2.0",
98+
"proto-plus >= 1.22.3, <2.0.0",
99+
count: 1
100+
- paths: [
101+
packages/google-cloud-binary-authorization/testing/constraints-3.7.txt
102+
]
103+
before: |
104+
google-api-core==1.34.1
105+
google-auth==2.14.1
106+
proto-plus==1.22.3
107+
after: |
108+
google-api-core==1.34.1
109+
google-auth==2.14.1
110+
grafeas==1.1.2
111+
proto-plus==1.22.3
112+
count: 1
113+
- paths: [
114+
packages/google-cloud-iam/testing/constraints-3.7.txt
115+
]
116+
before: |
117+
google-api-core==1.34.1
118+
google-auth==2.14.1
119+
proto-plus==1.22.3
120+
after: |
121+
google-api-core==1.34.1
122+
google-auth==2.14.1
123+
grpc-google-iam-v1==0.12.4
124+
proto-plus==1.22.3
125+
count: 1
126+
- paths: [
127+
packages/google-cloud-iam/setup.py
128+
]
129+
before: |
130+
dependencies = \[
131+
"google-api-core\[grpc\] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
132+
# Exclude incompatible versions of `google-auth`
133+
# See https://github.com/googleapis/google-cloud-python/issues/12364
134+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
135+
"proto-plus >= 1.22.3, <2.0.0",
136+
after: |
137+
dependencies = [
138+
"google-api-core[grpc] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
139+
# Exclude incompatible versions of `google-auth`
140+
# See https://github.com/googleapis/google-cloud-python/issues/12364
141+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
142+
"grpc-google-iam-v1 >=0.12.4, <1.0.0",
143+
"proto-plus >= 1.22.3, <2.0.0",
144+
count: 1
145+
- paths: [
146+
packages/google-cloud-policysimulator/setup.py
147+
]
148+
before: |
149+
dependencies = \[
150+
"google-api-core\[grpc\] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
151+
# Exclude incompatible versions of `google-auth`
152+
# See https://github.com/googleapis/google-cloud-python/issues/12364
153+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
154+
"proto-plus >= 1.22.3, <2.0.0",
155+
after: |
156+
dependencies = [
157+
"google-api-core[grpc] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
158+
# Exclude incompatible versions of `google-auth`
159+
# See https://github.com/googleapis/google-cloud-python/issues/12364
160+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
161+
"google-cloud-org-policy >= 1.0.0, <2.0.0",
162+
"proto-plus >= 1.22.3, <2.0.0",
163+
count: 1
Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
# Copyright 2023 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+
description: Customizations related to the integration with grafeas
15+
url: https://github.com/googleapis/gapic-generator-python/issues/1830
16+
replacements:
17+
- paths: [
18+
packages/google-cloud-containeranalysis/setup.py
19+
]
20+
before: |
21+
dependencies = \[
22+
"google-api-core\[grpc\] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
23+
# Exclude incompatible versions of `google-auth`
24+
# See https://github.com/googleapis/google-cloud-python/issues/12364
25+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
26+
"proto-plus >= 1.22.3, <2.0.0",
27+
after: |
28+
dependencies = [
29+
"google-api-core[grpc] >= 1.34.1, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
30+
# Exclude incompatible versions of `google-auth`
31+
# See https://github.com/googleapis/google-cloud-python/issues/12364
32+
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
33+
"grafeas >=1.4.1, <2.0",
34+
"proto-plus >= 1.22.3, <2.0.0",
35+
count: 1
36+
- paths: [
37+
packages/google-cloud-containeranalysis/testing/constraints-3.7.txt
38+
]
39+
before: |
40+
google-api-core==1.34.1
41+
google-auth==2.14.1
42+
proto-plus==1.22.3
43+
after: |
44+
google-api-core==1.34.1
45+
google-auth==2.14.1
46+
grafeas==1.4.1
47+
proto-plus==1.22.3
48+
count: 1
49+
- paths: [
50+
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/client.py,
51+
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/async_client.py,
52+
]
53+
before: |
54+
from google.iam.v1 import policy_pb2 # type: ignore\n
55+
after: |
56+
from google.iam.v1 import policy_pb2 # type: ignore
57+
from grafeas import grafeas_v1
58+
from grafeas.grafeas_v1.services.grafeas import transports\n
59+
count: 2
60+
- paths: [
61+
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/client.py,
62+
]
63+
before: |
64+
\,\n "credentialsType": None,
65+
\ \},
66+
\ \)
67+
\
68+
\ def set_iam_policy\(
69+
after: |
70+
,\n "credentialsType": None,
71+
},
72+
)\n
73+
def get_grafeas_client(self) -> grafeas_v1.GrafeasClient:
74+
grafeas_transport = grafeas_v1.services.grafeas.transports.GrafeasGrpcTransport(
75+
credentials=self.transport._credentials,
76+
# Set ``credentials_file`` to ``None`` here as
77+
# transport._credentials contains the credentials
78+
# which are saved
79+
credentials_file=None,
80+
host=self.transport._host,
81+
scopes=self.transport.AUTH_SCOPES,
82+
)
83+
return grafeas_v1.GrafeasClient(transport=grafeas_transport)\n
84+
def set_iam_policy(
85+
count: 1
86+
- paths: [
87+
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/services/container_analysis/async_client.py,
88+
]
89+
before: |
90+
\,\n "credentialsType": None,
91+
\ \},
92+
\ \)
93+
\
94+
\ async def set_iam_policy\(
95+
after: |
96+
,\n "credentialsType": None,
97+
},
98+
)\n
99+
def get_grafeas_client(self) -> grafeas_v1.GrafeasClient:
100+
grafeas_transport = grafeas_v1.services.grafeas.transports.GrafeasGrpcTransport(
101+
credentials=self.transport._credentials,
102+
# Set ``credentials_file`` to ``None`` here as
103+
# transport._credentials contains the credentials
104+
# which are saved
105+
credentials_file=None,
106+
host=self.transport._host,
107+
scopes=self.transport.AUTH_SCOPES,
108+
)
109+
return grafeas_v1.GrafeasClient(transport=grafeas_transport)\n
110+
async def set_iam_policy(
111+
count: 1
112+
- paths: [
113+
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/types/containeranalysis.py
114+
]
115+
before: from grafeas.v1 import severity_pb2 # type: ignore
116+
after: import grafeas.grafeas_v1 # type: ignore
117+
count: 1
118+
- paths: [
119+
packages/google-cloud-containeranalysis/tests/unit/gapic/containeranalysis_v1/test_container_analysis.py
120+
]
121+
before: |
122+
\)
123+
\ create_channel.assert_called_with\(
124+
\ "containeranalysis.googleapis.com:443",
125+
\ credentials=file_creds,
126+
\ credentials_file=None,
127+
\ quota_project_id=None,
128+
\ default_scopes=\("https://www.googleapis.com/auth/cloud-platform",\),
129+
\ scopes=None,
130+
\ default_host="containeranalysis.googleapis.com",
131+
\ ssl_credentials=None,
132+
\ options=\[
133+
\ \("grpc.max_send_message_length", -1\),
134+
\ \("grpc.max_receive_message_length", -1\),
135+
\ \],
136+
\ \)\n\n
137+
after: |
138+
)
139+
create_channel.assert_called_with(
140+
"containeranalysis.googleapis.com:443",
141+
credentials=file_creds,
142+
credentials_file=None,
143+
quota_project_id=None,
144+
default_scopes=("https://www.googleapis.com/auth/cloud-platform",),
145+
scopes=None,
146+
default_host="containeranalysis.googleapis.com",
147+
ssl_credentials=None,
148+
options=[
149+
("grpc.max_send_message_length", -1),
150+
("grpc.max_receive_message_length", -1),
151+
],
152+
)
153+
154+
# Also check client.get_grafeas_client() to make sure that the file credentials are used
155+
assert file_creds == client.get_grafeas_client().transport._credentials\n\n
156+
count: 1
157+
- paths: [
158+
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/types/containeranalysis.py
159+
]
160+
before: grafeas.v1.severity_pb2.Severity
161+
after: grafeas.v1.grafeas.grafeas_v1.Severity
162+
count: 1
163+
- paths: [
164+
packages/google-cloud-containeranalysis/google/cloud/devtools/containeranalysis_v1/types/containeranalysis.py
165+
]
166+
before: severity_pb2
167+
after: grafeas.grafeas_v1
168+
count: 2

0 commit comments

Comments
 (0)