From af918e8ef422438aaca0c468de8b3b2c184d884e Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 25 Nov 2020 19:58:04 -0500 Subject: [PATCH] feat: Update synth.py to copy discovery files from discovery-artifact-manager (#1104) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update synth.py to copy discovery files from discovery-artifact-manager Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [x] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/google-api-python-client/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [x] Ensure the tests and linter pass - [x] Code coverage does not decrease (if any source code was changed) - [x] Appropriate docs were updated (if necessary) Closes #1103 🦕 --- synth.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/synth.py b/synth.py index e68036bbe5f..5799074cb78 100644 --- a/synth.py +++ b/synth.py @@ -14,6 +14,9 @@ import synthtool as s from synthtool import gcp +from synthtool.sources import git + +DISCOVERY_ARTIFACT_MANAGER_REPO = "googleapis/discovery-artifact-manager" common = gcp.CommonTemplates() @@ -29,4 +32,20 @@ # Also move issue templates s.move(templated_files / '.github') -s.shell.run(["nox", "-s", "docs"], hide_output=False) \ No newline at end of file +# ---------------------------------------------------------------------------- +# Copy discoveries folder from discovery-artifact-manager repo +# ---------------------------------------------------------------------------- + +discovery_artifact_manager_url = git.make_repo_clone_url(DISCOVERY_ARTIFACT_MANAGER_REPO) +discovery_artifacts = git.clone(discovery_artifact_manager_url) / "discoveries" + +excludes = [ + "**/BUILD.bazel", +] +s.copy(discovery_artifacts, + "googleapiclient/discovery_cache/documents", excludes=excludes) + +# ---------------------------------------------------------------------------- +# Generate docs +# ---------------------------------------------------------------------------- +s.shell.run(["nox", "-s", "docs"], hide_output=False)