|
35 | 35 | if clean_up_generated_samples: |
36 | 36 | shutil.rmtree("samples/generated_samples", ignore_errors=True) |
37 | 37 | clean_up_generated_samples = False |
38 | | - |
39 | | - # Apply workarounds to fix the generated docstrings. |
40 | | - # Issue filed upstream in https://github.com/googleapis/gapic-generator-python/issues/1345 |
41 | | - s.replace( |
42 | | - library / f"google/cloud/gke_backup_{library.name}/**/*.py", |
43 | | - """must:[\n]* |
44 | | - - be between 1 and 63 characters long |
45 | | - \(inclusive\) - consist of only |
46 | | - lower-case ASCII letters, numbers, and |
47 | | - dashes - start with a lower-case letter |
48 | | - - end with a lower-case letter or |
49 | | - number""", |
50 | | - """must: |
51 | | -
|
52 | | - - be between 1 and 63 characters long (inclusive) |
53 | | - - consist of only lower-case ASCII letters, numbers, and dashes |
54 | | - - start with a lower-case letter |
55 | | - - end with a lower-case letter or number""" |
56 | | - ) |
57 | | - s.replace( |
58 | | - library / f"google/cloud/gke_backup_{library.name}/**/*.py", |
59 | | - """must:[\n]* |
60 | | - - be between 1 and 63 characters long |
61 | | - \(inclusive\) - consist of only lower-case ASCII |
62 | | - letters, numbers, and dashes - start with a |
63 | | - lower-case letter |
64 | | - - end with a lower-case letter or number |
65 | | - - be unique within the set of BackupPlans in |
66 | | - this location""", |
67 | | - """must: |
68 | | -
|
69 | | - - be between 1 and 63 characters long (inclusive) |
70 | | - - consist of only lower-case ASCII letters, numbers, and dashes |
71 | | - - start with a lower-case letter |
72 | | - - end with a lower-case letter or number |
73 | | - - be unique within the set of BackupPlans in this location""") |
74 | | - s.replace( |
75 | | - library / f"google/cloud/gke_backup_{library.name}/**/*.py", |
76 | | - """must:[\n]* |
77 | | - - be between 1 and 63 characters long |
78 | | - \(inclusive\) - consist of only lower-case ASCII |
79 | | - letters, numbers, and dashes - start with a |
80 | | - lower-case letter |
81 | | - - end with a lower-case letter or number |
82 | | - - be unique within the set of Backups in this |
83 | | - BackupPlan""", |
84 | | - """must: |
85 | | -
|
86 | | - - be between 1 and 63 characters long (inclusive) |
87 | | - - consist of only lower-case ASCII letters, numbers, and dashes |
88 | | - - start with a lower-case letter |
89 | | - - end with a lower-case letter or number |
90 | | - - be unique within the set of Backups in this BackupPlan""") |
91 | | - s.replace( |
92 | | - library / f"google/cloud/gke_backup_{library.name}/**/*.py", |
93 | | - """must:[\n]* |
94 | | - - be between 1 and 63 characters long |
95 | | - \(inclusive\) - consist of only lower-case ASCII |
96 | | - letters, numbers, and dashes - start with a |
97 | | - lower-case letter |
98 | | - - end with a lower-case letter or number |
99 | | - - be unique within the set of RestorePlans in |
100 | | - this location""", |
101 | | - """must: |
102 | | -
|
103 | | - - be between 1 and 63 characters long (inclusive) |
104 | | - - consist of only lower-case ASCII letters, numbers, and dashes |
105 | | - - start with a lower-case letter |
106 | | - - end with a lower-case letter or number |
107 | | - - be unique within the set of RestorePlans in this location""") |
108 | | - s.replace( |
109 | | - library / f"google/cloud/gke_backup_{library.name}/**/*.py", |
110 | | - """must:[\n]* |
111 | | - - be between 1 and 63 characters long |
112 | | - \(inclusive\) - consist of only lower-case ASCII |
113 | | - letters, numbers, and dashes - start with a |
114 | | - lower-case letter |
115 | | - - end with a lower-case letter or number |
116 | | - - be unique within the set of Restores in this |
117 | | - RestorePlan.""", |
118 | | - """must: |
119 | | -
|
120 | | - - be between 1 and 63 characters long (inclusive) |
121 | | - - consist of only lower-case ASCII letters, numbers, and dashes |
122 | | - - start with a lower-case letter |
123 | | - - end with a lower-case letter or number |
124 | | - - be unique within the set of Restores in this RestorePlan.""") |
125 | | - |
126 | | - s.replace(library / f"google/cloud/gke_backup_{library.name}/services/**/*.py", |
127 | | - """be unique within the set of Backups |
128 | | - in this BackupPlan""", |
129 | | - """be unique within the set of Backups in this BackupPlan""") |
130 | | - s.replace(library / f"google/cloud/gke_backup_{library.name}/services/**/*.py", |
131 | | - """be unique within the set of Restores |
132 | | - in this RestorePlan""", |
133 | | - """be unique within the set of Restores in this RestorePlan""") |
134 | | - s.replace(library / f"google/cloud/gke_backup_{library.name}/services/**/*.py", |
135 | | - """be unique within the set of |
136 | | - RestorePlans in this location""", |
137 | | - """be unique within the set of RestorePlans in this location""") |
138 | | - |
139 | | - # workaround issue with docstrings |
140 | | - s.replace( |
141 | | - library / f"google/cloud/**/*.py", |
142 | | - """projects/\\\ \*/locations/\*\n""", |
143 | | - "``projects/*/locations/*``\n", |
144 | | - ) |
145 | | - s.replace( |
146 | | - library / f"google/cloud/**/*.py", |
147 | | - """projects/\\\ \*/locations/\*/backupPlans/\\\\\*\n""", |
148 | | - "``projects/*/locations/*/backupPlans/*``\n", |
149 | | - ) |
150 | | - s.replace( |
151 | | - library / f"google/cloud/**/*.py", |
152 | | - """projects/\\\ \*/locations/\*/backupPlans/\*.\n""", |
153 | | - "``projects/*/locations/*/backupPlans/*``.\n", |
154 | | - ) |
155 | | - s.replace( |
156 | | - library / f"google/cloud/**/*.py", |
157 | | - """projects/\\\ \*/locations/\*/backupPlans/\*/backups/\*\n""", |
158 | | - "``projects/*/locations/*/backupPlans/*/backups/*``\n", |
159 | | - ) |
160 | | - s.replace( |
161 | | - library / f"google/cloud/**/*.py", |
162 | | - """projects/\\\ \*/locations/\*/backupPlans/\*/backups/\*.\n""", |
163 | | - "``projects/*/locations/*/backupPlans/*/backups/*``.\n", |
164 | | - ) |
165 | | - |
166 | | - s.replace( |
167 | | - library / f"google/cloud/**/*.py", |
168 | | - "projects/\\\ \*/locations/\*/backupPlans/\*/backups/\*/volumeBackups/\\\\\*\n", |
169 | | - "``projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*``\n", |
170 | | - ) |
171 | | - s.replace( |
172 | | - library / f"google/cloud/**/*.py", |
173 | | - "projects/\\\ \*/locations/\*/backupPlans/\*/backups/\*/volumeBackups/\*.\n", |
174 | | - "``projects/*/locations/*/backupPlans/*/backups/*/volumeBackups/*``.\n", |
175 | | - ) |
176 | | - s.replace( |
177 | | - library / f"google/cloud/**/*.py", |
178 | | - "projects/\\\ \*/locations/\*/restorePlans/\\\\\*\n", |
179 | | - "``projects/*/locations/*/restorePlans/*``\n", |
180 | | - ) |
181 | | - s.replace( |
182 | | - library / f"google/cloud/**/*.py", |
183 | | - "projects/\\\ \*/locations/\*/restorePlans/\*.\n", |
184 | | - "``projects/*/locations/*/restorePlans/*``.\n", |
185 | | - ) |
186 | | - s.replace( |
187 | | - library / f"google/cloud/**/*.py", |
188 | | - "projects/\\\ \*/locations/\*/restorePlans/\*/restores/\*\n", |
189 | | - "``projects/*/locations/*/restorePlans/*/restores/*``\n", |
190 | | - ) |
191 | | - s.replace( |
192 | | - library / f"google/cloud/**/*.py", |
193 | | - "projects/\\\ \*/locations/\*/restorePlans/\*/restores/\*/volumeRestores/\\\\\*\n", |
194 | | - "``projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*``\n", |
195 | | - ) |
196 | | - s.replace( |
197 | | - library / f"google/cloud/**/*.py", |
198 | | - "projects/\\\ \*/locations/\*/restorePlans/\*/restores/\*/volumeRestores/\*.\n", |
199 | | - "``projects/*/locations/*/restorePlans/*/restores/*/volumeRestores/*``.\n", |
200 | | - ) |
201 | | - s.replace( |
202 | | - library / f"google/cloud/**/*.py", |
203 | | - """- projects/\\\ \*/locations/\*/clusters/\\\\\* |
204 | | - - projects/\\\ \*/zones/\*/clusters/\\\\\*""", |
205 | | - """- ``projects/*/locations/*/clusters/*`` |
206 | | - - ``projects/*/zones/*/clusters/*``""", |
207 | | - ) |
208 | | - s.replace( |
209 | | - library / f"google/cloud/**/*.py", |
210 | | - """- projects/\\\ \*/locations/\*/clusters/\\\\\* |
211 | | - - projects/\\\ \*/zones/\*/clusters/\\\\\*""", |
212 | | - """- ``projects/*/locations/*/clusters/*`` |
213 | | - - ``projects/*/zones/*/clusters/*``""", |
214 | | - ) |
215 | | - s.replace( |
216 | | - library / f"google/cloud/**/*.py", |
217 | | - """projects/\\\ \*/locations/\*/keyRings/\*/cryptoKeys/\*""", |
218 | | - """``projects/*/locations/*/keyRings/*/cryptoKeys/*``""", |
219 | | - ) |
220 | | - |
221 | 38 | s.move([library], excludes=["**/gapic_version.py"]) |
222 | | - |
223 | 39 | s.remove_staging_dirs() |
224 | 40 |
|
225 | 41 | # ---------------------------------------------------------------------------- |
|
0 commit comments