1# Copyright 2020 Google LLC 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15"""This script is used to synthesize generated parts of this library.""" 16 17import synthtool as s 18from synthtool import gcp 19 20common = gcp.CommonTemplates() 21 22# ---------------------------------------------------------------------------- 23# Add templated files 24# ---------------------------------------------------------------------------- 25excludes = [ 26 "noxfile.py", # pytype 27 "setup.cfg", # pytype 28 ".flake8", # flake8-import-order, layout 29 ".coveragerc", # layout 30 "CONTRIBUTING.rst", # no systests 31] 32templated_files = common.py_library(microgenerator=True, cov_level=100) 33s.move(templated_files, excludes=excludes) 34 35# Add pytype support 36s.replace( 37 ".gitignore", 38 """\ 39.pytest_cache 40""", 41 """\ 42.pytest_cache 43.pytype 44""", 45) 46 47s.shell.run(["nox", "-s", "blacken"], hide_output=False) 48