Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions recommender/synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from synthtool import gcp
from synthtool.languages import python

gapic = gcp.GAPICBazel()
gapic = gcp.GAPICGenerator()
versions = ["v1beta1", "v1"]
common = gcp.CommonTemplates()

Expand All @@ -28,7 +28,11 @@
# Generate Cloud Recommender
# ----------------------------------------------------------------------------
for version in versions:
library = gapic.py_library("recommender", version)
library = gapic.py_library(
"recommender",
version,
config_path=f"/google/cloud/recommender/{version}/artman_recommender_{version}.yaml",
)
s.move(library, excludes=["nox.py", "docs/index.rst", "README.rst", "setup.py"])

# Fix docstring with regex pattern that breaks docgen
Expand All @@ -37,7 +41,12 @@
# Fix more regex in docstrings
s.replace("google/**/*_pb2.py", ":math:`(/)", "\g<1>")
s.replace("google/**/*_pb2.py", "`/\.", "/.")
s.replace("google/**/*_pb2.py", "(regex\s+)(/.*?/)\.", "\g<1>``\g<2>``.", flags=re.MULTILINE | re.DOTALL,)
s.replace(
"google/**/*_pb2.py",
"(regex\s+)(/.*?/)\.",
"\g<1>``\g<2>``.",
flags=re.MULTILINE | re.DOTALL,
)

# Fix docstring with JSON example by wrapping with backticks
s.replace(
Expand Down