Skip to content

Commit

Permalink
chore(recommender): use artman for generation instead of bazel (#10356)
Browse files Browse the repository at this point in the history
  • Loading branch information
busunkim96 authored Feb 7, 2020
1 parent 71705da commit e751df7
Showing 1 changed file with 12 additions and 3 deletions.
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

0 comments on commit e751df7

Please sign in to comment.