diff --git a/synth.py b/synth.py index a08acd814..afd261a14 100644 --- a/synth.py +++ b/synth.py @@ -17,13 +17,18 @@ import synthtool as s from synthtool import gcp -gapic = gcp.GAPICGenerator() +gapic = gcp.GAPICBazel() versions = ["v2beta1", "v2"] for version in versions: - library = gapic.py_library("dialogflow", version, config_path=version + '/artman_dialogflow_' + version + '.yaml', include_protos=True) + library = gapic.py_library( + "dialogflow", + version, + bazel_target=f"//google/cloud/dialogflow/{version}:dialogflow-{version}-py", + include_protos=True, + ) s.move( library, @@ -95,29 +100,26 @@ ) # Docstring has '-----' which is interpreted as RST section title -s.replace( - "dialogflow_v2beta1/proto/intent_pb2.py", - "\s+-----------", - "" -) +s.replace("dialogflow_v2beta1/proto/intent_pb2.py", "\s+-----------", "") s.replace( "dialogflow_*/proto/session_pb2.py", "============================================================================", - "" + "", ) # Replace bad hyperlink references -s.replace( - "dialogflow_*/proto/audio_config_pb2.py", - "\s*\<\>`__", - "`" -) +s.replace("dialogflow_*/proto/audio_config_pb2.py", "\s*\<\>`__", "`") -s.replace('dialogflow_v2/proto/agent_pb2.py', ':math:', '') -s.replace('dialogflow_v2/proto/agent_pb2.py', ':raw-latex:', '') +s.replace("dialogflow_v2/proto/agent_pb2.py", ":math:", "") +s.replace("dialogflow_v2/proto/agent_pb2.py", ":raw-latex:", "") -s.shell.run(["nox", "-s", "blacken"], hide_output=False) +# ignore sphinx warnings +# TODO: remove with microgenerator transition +s.replace("noxfile.py", +"""['"]-W['"], # warnings as errors""", +"") +s.shell.run(["nox", "-s", "blacken"], hide_output=False)