Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

chore: blacken samples directories #71

Merged
merged 5 commits into from
Feb 3, 2021
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
21 changes: 12 additions & 9 deletions synth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -28,26 +31,24 @@
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",
)

# ----------------------------------------------------------------------------
# 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
Expand All @@ -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)