Skip to content

Commit

Permalink
chore!: promote Tpu to v2
Browse files Browse the repository at this point in the history
  • Loading branch information
bshaffer committed Dec 16, 2024
1 parent 70dd30d commit 8faa0e4
Show file tree
Hide file tree
Showing 70 changed files with 292 additions and 7,057 deletions.
2 changes: 1 addition & 1 deletion Tpu/.OwlBot.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
deep-copy-regex:
- source: /google/cloud/tpu/(v1|v2)/.*-php/(.*)
- source: /google/cloud/tpu/(v2)/.*-php/(.*)
dest: /owl-bot-staging/Tpu/$1/$2
api-name: Tpu
Binary file removed Tpu/metadata/V1/CloudTpu.php
Binary file not shown.
50 changes: 15 additions & 35 deletions Tpu/owlbot.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2021 Google LLC
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -30,14 +30,7 @@
# Added so that we can pass copy_excludes in the owlbot_main() call
_tracked_paths.add(src)

php.owlbot_main(
src=src,
dest=dest,
copy_excludes=[
src / "**/[A-Z]*_*.php",
src / "**/*GrpcClient.php",
]
)
php.owlbot_main(src=src, dest=dest)

# remove class_alias code
s.replace(
Expand All @@ -48,29 +41,16 @@
+ "\n",
'')


### [START] protoc backwards compatibility fixes

# roll back to private properties.
s.replace(
"src/**/V*/**/*.php",
r"Generated from protobuf field ([^\n]{0,})\n\s{5}\*/\n\s{4}protected \$",
r"""Generated from protobuf field \1
*/
private $""")

# Replace "Unwrapped" with "Value" for method names.
s.replace(
"src/**/V*/**/*.php",
r"public function ([s|g]\w{3,})Unwrapped",
r"public function \1Value"
)

### [END] protoc backwards compatibility fixes

# fix relative cloud.google.com links
s.replace(
"src/**/V*/**/*.php",
r"(.{0,})\]\((/.{0,})\)",
r"\1](https://cloud.google.com\2)"
)
# format generated clients
subprocess.run([
'npm',
'exec',
'--yes',
'--package=@prettier/plugin-php@^0.16',
'--',
'prettier',
'**/Client/*',
'--write',
'--parser=php',
'--single-quote',
'--print-width=120'])
101 changes: 0 additions & 101 deletions Tpu/src/V1/AcceleratorType.php

This file was deleted.

145 changes: 0 additions & 145 deletions Tpu/src/V1/CreateNodeRequest.php

This file was deleted.

67 changes: 0 additions & 67 deletions Tpu/src/V1/DeleteNodeRequest.php

This file was deleted.

Loading

0 comments on commit 8faa0e4

Please sign in to comment.