Skip to content

Commit

Permalink
chore: blacken samples directories (#71)
Browse files Browse the repository at this point in the history
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 googleapis/synthtool#899 🦕
Closes googleapis/python-bigquery-reservation#66
  • Loading branch information
tswast authored Feb 3, 2021
1 parent 7c4093f commit 8633229
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions packages/google-cloud-bigquery-reservation/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)

0 comments on commit 8633229

Please sign in to comment.