Skip to content

Commit 04b01ed

Browse files
authored
chore: make the gapic code private (#1519)
1 parent 87f27e4 commit 04b01ed

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

owlbot.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"""This script is used to synthesize generated parts of this library."""
1616

1717
import json
18+
from pathlib import Path
1819

1920
import synthtool as s
2021
from synthtool import gcp
@@ -28,12 +29,6 @@
2829
default_version = json.load(open(".repo-metadata.json", "rt")).get("default_version")
2930

3031
for library in s.get_staging_dirs(default_version):
31-
s.replace(
32-
library / "google/cloud/storage_v2/__init__.py",
33-
"from google.cloud.storage import gapic_version as package_version",
34-
"from google.cloud.storage_v2 import gapic_version as package_version",
35-
)
36-
3732
s.move(
3833
[library],
3934
excludes=[
@@ -51,6 +46,19 @@
5146
"tests/unit/__init__.py",
5247
],
5348
)
49+
50+
source_path = Path("google/cloud/storage_v2")
51+
renamed_path = Path("google/cloud/_storage_v2")
52+
if source_path.exists():
53+
source_path.rename(renamed_path)
54+
55+
if renamed_path.exists():
56+
s.replace(
57+
renamed_path / "__init__.py",
58+
"from google.cloud.storage_v2 import gapic_version as package_version",
59+
"from google.cloud._storage_v2 import gapic_version as package_version",
60+
)
61+
5462
s.remove_staging_dirs()
5563

5664
common = gcp.CommonTemplates()

0 commit comments

Comments
 (0)