From 8633229184381853270640112d5b0d663e23cb93 Mon Sep 17 00:00:00 2001 From: Tim Swast Date: Wed, 3 Feb 2021 13:40:02 -0600 Subject: [PATCH] chore: blacken samples directories (#71) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-bigquery-reservation/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes https://github.com/googleapis/synthtool/issues/899 🦕 Closes https://github.com/googleapis/python-bigquery-reservation/pull/66 --- .../synth.py | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/google-cloud-bigquery-reservation/synth.py b/packages/google-cloud-bigquery-reservation/synth.py index 310c5cdb00ad..65cbb0a80752 100644 --- a/packages/google-cloud-bigquery-reservation/synth.py +++ b/packages/google-cloud-bigquery-reservation/synth.py @@ -13,12 +13,15 @@ # limitations under the License. """This script is used to synthesize generated parts of this library.""" -import os +import pathlib import synthtool as s import synthtool.gcp as gcp from synthtool.languages import python + +REPO_ROOT = pathlib.Path(__file__).parent.absolute() + gapic = gcp.GAPICBazel() common = gcp.CommonTemplates() @@ -28,14 +31,16 @@ library = gapic.py_library( service="bigquery/reservation", version="v1", - bazel_target=f"//google/cloud/bigquery/reservation/v1:bigquery-reservation-v1-py" + bazel_target=f"//google/cloud/bigquery/reservation/v1:bigquery-reservation-v1-py", ) s.move(library, excludes=["nox.py", "setup.py", "README.rst", "docs/index.rst"]) s.replace( - ["google/cloud/bigquery_reservation_v1/services/reservation_service/client.py", - "google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py"], + [ + "google/cloud/bigquery_reservation_v1/services/reservation_service/client.py", + "google/cloud/bigquery_reservation_v1/services/reservation_service/async_client.py", + ], "assignee=organizations/456``", "assignee=organizations/456``\n", ) @@ -43,11 +48,7 @@ # ---------------------------------------------------------------------------- # Add templated files # ---------------------------------------------------------------------------- -templated_files = common.py_library( - cov_level=100, - microgenerator=True, - samples=True, -) +templated_files = common.py_library(cov_level=100, microgenerator=True, samples=True,) s.move( templated_files, excludes=[".coveragerc"], # the microgenerator has a good coveragerc file @@ -64,3 +65,5 @@ # ---------------------------------------------------------------------------- s.shell.run(["nox", "-s", "blacken"], hide_output=False) +for noxfile in REPO_ROOT.glob("samples/**/noxfile.py"): + s.shell.run(["nox", "-s", "blacken"], cwd=noxfile.parent, hide_output=False)