Skip to content

Commit cba28a3

Browse files
authored
chore: Migrate python-firestore synth.py from artman to bazel (#35)
1 parent 931d90b commit cba28a3

File tree

1 file changed

+11
-24
lines changed

1 file changed

+11
-24
lines changed

packages/google-cloud-firestore/synth.py

Lines changed: 11 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,20 @@
1616
import synthtool as s
1717
from synthtool import gcp
1818

19-
gapic = gcp.GAPICGenerator()
19+
gapic = gcp.GAPICBazel()
2020
common = gcp.CommonTemplates()
21-
versions = [
22-
("v1beta1", "artman_firestore.yaml"),
23-
("v1", "artman_firestore_v1.yaml"),
24-
]
25-
admin_versions = [
26-
("v1", "artman_firestore_v1.yaml"),
27-
]
21+
versions = ["v1beta1", "v1"]
22+
admin_versions = ["v1"]
2823

2924

3025
# ----------------------------------------------------------------------------
3126
# Generate firestore GAPIC layer
3227
# ----------------------------------------------------------------------------
33-
for version, artman_config in versions:
28+
for version in versions:
3429
library = gapic.py_library(
35-
"firestore",
36-
version,
37-
config_path=f"/google/firestore/{artman_config}",
38-
artman_output_name=f"firestore-{version}",
30+
service="firestore",
31+
version=version,
32+
bazel_target=f"//google/firestore/{version}:firestore-{version}-py",
3933
include_protos=True,
4034
)
4135

@@ -59,12 +53,11 @@
5953
# ----------------------------------------------------------------------------
6054
# Generate firestore admin GAPIC layer
6155
# ----------------------------------------------------------------------------
62-
for version, artman_config in admin_versions:
56+
for version in admin_versions:
6357
library = gapic.py_library(
64-
"firestore_admin",
65-
f"{version}",
66-
config_path=f"/google/firestore/admin/{artman_config}",
67-
artman_output_name=f"firestore-admin-{version}",
58+
service="firestore_admin",
59+
version=version,
60+
bazel_target=f"//google/firestore/admin/{version}:firestore-admin-{version}-py",
6861
include_protos=True,
6962
)
7063
s.move(library / f"google/cloud/firestore_admin_{version}")
@@ -76,12 +69,6 @@
7669
"'google-cloud-firestore'",
7770
)
7871

79-
s.replace(
80-
"google/**/*.py",
81-
f"from google\.cloud\.firestore\.admin_{version}.proto",
82-
f"from google.cloud.firestore_admin_{version}.proto",
83-
)
84-
8572
# ----------------------------------------------------------------------------
8673
# Add templated files
8774
# ----------------------------------------------------------------------------

0 commit comments

Comments
 (0)