|
86 | 86 | s.remove_staging_dirs()
|
87 | 87 |
|
88 | 88 | # only run post processor when there are changes to the generated code
|
89 |
| -if has_generator_updates: |
90 |
| - |
91 |
| -# ---------------------------------------------------------------------------- |
92 |
| -# Add templated files |
93 |
| -# ---------------------------------------------------------------------------- |
94 |
| - |
95 |
| - templated_files = common.py_library( |
96 |
| - cov_level=98, |
97 |
| - system_test_python_versions=["3.8"], |
98 |
| - unit_test_python_versions=["3.7", "3.8", "3.9", "3.10"], |
99 |
| - unit_test_extras=["testing"], |
100 |
| - system_test_extras=["testing"], |
101 |
| - microgenerator=True, |
102 |
| - ) |
103 |
| - s.move( |
104 |
| - templated_files, |
105 |
| - excludes=[ |
106 |
| - ".coveragerc", |
107 |
| - ".kokoro/continuous/common.cfg", |
108 |
| - ".kokoro/presubmit/presubmit.cfg", |
109 |
| - ".kokoro/continuous/prerelease-deps.cfg", |
110 |
| - ".kokoro/presubmit/prerelease-deps.cfg", |
111 |
| - # exclude sample configs so periodic samples are tested against main |
112 |
| - # instead of pypi |
113 |
| - ".kokoro/samples/python3.7/periodic.cfg", |
114 |
| - ".kokoro/samples/python3.8/periodic.cfg", |
115 |
| - ".kokoro/samples/python3.9/periodic.cfg", |
116 |
| - ".kokoro/samples/python3.10/periodic.cfg", |
117 |
| - ".github/CODEOWNERS", |
118 |
| - ".github/PULL_REQUEST_TEMPLATE.md", |
119 |
| - ".github/workflows", # exclude gh actions as credentials are needed for tests |
120 |
| - "README.rst", |
121 |
| - ".github/release-please.yml", # use release please manifest |
122 |
| - ], |
123 |
| - ) # the microgenerator has a good coveragerc file |
124 |
| - |
125 |
| - python.py_samples(skip_readmes=True) |
126 |
| - |
127 |
| - python.configure_previous_major_version_branches() |
128 |
| - |
129 |
| - # Update samples config to use `ucaip-sample-tests` project |
130 |
| - s.replace( |
131 |
| - ".kokoro/samples/python3.*/common.cfg", |
132 |
| - """env_vars: \{ |
| 89 | +#if has_generator_updates: |
| 90 | + |
| 91 | + # ---------------------------------------------------------------------------- |
| 92 | + # Add templated files |
| 93 | + # ---------------------------------------------------------------------------- |
| 94 | + |
| 95 | +templated_files = common.py_library( |
| 96 | + cov_level=98, |
| 97 | + system_test_python_versions=["3.8"], |
| 98 | + unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11"], |
| 99 | + unit_test_extras=["testing"], |
| 100 | + system_test_extras=["testing"], |
| 101 | + microgenerator=True, |
| 102 | +) |
| 103 | +s.move( |
| 104 | + templated_files, |
| 105 | + excludes=[ |
| 106 | + ".coveragerc", |
| 107 | + ".kokoro/continuous/common.cfg", |
| 108 | + ".kokoro/presubmit/presubmit.cfg", |
| 109 | + ".kokoro/continuous/prerelease-deps.cfg", |
| 110 | + ".kokoro/presubmit/prerelease-deps.cfg", |
| 111 | + # exclude sample configs so periodic samples are tested against main |
| 112 | + # instead of pypi |
| 113 | + ".kokoro/samples/python3.7/periodic.cfg", |
| 114 | + ".kokoro/samples/python3.8/periodic.cfg", |
| 115 | + ".kokoro/samples/python3.9/periodic.cfg", |
| 116 | + ".kokoro/samples/python3.10/periodic.cfg", |
| 117 | + ".github/CODEOWNERS", |
| 118 | + ".github/PULL_REQUEST_TEMPLATE.md", |
| 119 | + ".github/workflows", # exclude gh actions as credentials are needed for tests |
| 120 | + "README.rst", |
| 121 | + ".github/release-please.yml", # use release please manifest |
| 122 | + ], |
| 123 | +) # the microgenerator has a good coveragerc file |
| 124 | + |
| 125 | +python.py_samples(skip_readmes=True) |
| 126 | + |
| 127 | +python.configure_previous_major_version_branches() |
| 128 | + |
| 129 | +# Update samples config to use `ucaip-sample-tests` project |
| 130 | +s.replace( |
| 131 | + ".kokoro/samples/python3.*/common.cfg", |
| 132 | + """env_vars: \{ |
133 | 133 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
|
134 | 134 | value: "python-docs-samples-tests-.*?"
|
135 | 135 | \}""",
|
136 |
| - """env_vars: { |
| 136 | + """env_vars: { |
137 | 137 | key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
|
138 | 138 | value: "ucaip-sample-tests"
|
139 | 139 | }""",
|
140 |
| - ) |
| 140 | +) |
141 | 141 |
|
142 |
| - s.replace( |
143 |
| - ".kokoro/test-samples-impl.sh", |
144 |
| - "python3.9", |
145 |
| - "python3", |
146 |
| - ) |
| 142 | +s.replace( |
| 143 | + ".kokoro/test-samples-impl.sh", |
| 144 | + "python3.9", |
| 145 | + "python3", |
| 146 | +) |
147 | 147 |
|
148 |
| - # Don't treat docs warnings as errors |
149 |
| - s.replace("noxfile.py", """ ["']-W["'], # warnings as errors\n""", "") |
| 148 | +# Don't treat docs warnings as errors |
| 149 | +s.replace("noxfile.py", """ ["']-W["'], # warnings as errors\n""", "") |
150 | 150 |
|
151 |
| - # Don't include tests in calculation of test coverage |
152 |
| - s.replace("noxfile.py", """ \"--cov=tests/unit\",\n""", "") |
| 151 | +# Don't include tests in calculation of test coverage |
| 152 | +s.replace("noxfile.py", """ \"--cov=tests/unit\",\n""", "") |
153 | 153 |
|
154 |
| - # Include prediction to be installed for documentation. |
155 |
| - s.replace( |
156 |
| - "noxfile.py", |
157 |
| - "\"alabaster\"", |
158 |
| - "\"alabaster\",\n \"google-cloud-aiplatform[prediction]\"", |
159 |
| - ) |
| 154 | +# Include prediction to be installed for documentation. |
| 155 | +s.replace( |
| 156 | + "noxfile.py", |
| 157 | + "\"alabaster\"", |
| 158 | + "\"alabaster\",\n \"google-cloud-aiplatform[prediction]\"", |
| 159 | +) |
160 | 160 |
|
161 |
| - s.shell.run(["nox", "-s", "blacken"], hide_output=False) |
| 161 | +s.shell.run(["nox", "-s", "blacken"], hide_output=False) |
0 commit comments