Bu Sun Kim | e72202e | 2020-02-19 17:58:47 -0800 | [diff] [blame] | 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 | |
Bu Sun Kim | e72202e | 2020-02-19 17:58:47 -0800 | [diff] [blame] | 17 | import synthtool as s |
| 18 | from synthtool import gcp |
| 19 | |
| 20 | common = gcp.CommonTemplates() |
| 21 | |
| 22 | # ---------------------------------------------------------------------------- |
| 23 | # Add templated files |
| 24 | # ---------------------------------------------------------------------------- |
Tres Seaver | a30f004 | 2021-08-03 13:59:25 -0400 | [diff] [blame] | 25 | excludes = [ |
| 26 | "noxfile.py", # pytype |
| 27 | "setup.cfg", # pytype |
| 28 | ".flake8", # flake8-import-order, layout |
| 29 | ".coveragerc", # layout |
| 30 | "CONTRIBUTING.rst", # no systests |
| 31 | ] |
| 32 | templated_files = common.py_library(microgenerator=True, cov_level=100) |
| 33 | s.move(templated_files, excludes=excludes) |
Tres Seaver | 000d0a0 | 2020-10-06 15:47:28 -0400 | [diff] [blame] | 34 | |
| 35 | # Add pytype support |
| 36 | s.replace( |
| 37 | ".gitignore", |
| 38 | """\ |
| 39 | .pytest_cache |
| 40 | """, |
| 41 | """\ |
| 42 | .pytest_cache |
| 43 | .pytype |
| 44 | """, |
| 45 | ) |
Tres Seaver | fbf447c | 2021-06-16 13:45:41 -0400 | [diff] [blame] | 46 | |
| 47 | s.shell.run(["nox", "-s", "blacken"], hide_output=False) |