File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
synthtool/gcp/templates/python_samples Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,10 @@ TEST_CONFIG = {
3939 # You can opt out from the test for specific Python versions.
4040 'ignored_versions': ["2.7"],
4141
42+ # Old samples are opted out of enforcing Python type hints
43+ # All new samples should feature them
44+ 'enforce_type_hints': False,
45+
4246 # An envvar key for determining the project id to use. Change it
4347 # to 'BUILD_SPECIFIC_GCLOUD_PROJECT' if you want to opt in using a
4448 # build specific Cloud project. You can also use your own string
@@ -132,7 +136,10 @@ FLAKE8_COMMON_ARGS = [
132136
133137@nox.session
134138def lint(session):
135- session.install("flake8", "flake8-import-order")
139+ if not TEST_CONFIG['enforce_type_hints']:
140+ session.install("flake8", "flake8-import-order")
141+ else:
142+ session.install("flake8", "flake8-import-order", "flake8-annotations")
136143
137144 local_names = _determine_local_import_names(".")
138145 args = FLAKE8_COMMON_ARGS + [
You can’t perform that action at this time.
0 commit comments