Content-Length: 3686 | pFad | http://github.com/googleapis/python-bigquery/pull/1881.diff
thub.com diff --git a/.kokoro/presubmit/linting-typing.cfg b/.kokoro/presubmit/linting-typing.cfg new file mode 100644 index 000000000..b1a7406c2 --- /dev/null +++ b/.kokoro/presubmit/linting-typing.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Only run these nox sessions. +env_vars: { + key: "NOX_SESSION" + value: "lint lint_setup_py blacken mypy mypy_samples pytype" +} diff --git a/.kokoro/presubmit/presubmit.cfg b/.kokoro/presubmit/presubmit.cfg index 17d071cae..fa39b1118 100644 --- a/.kokoro/presubmit/presubmit.cfg +++ b/.kokoro/presubmit/presubmit.cfg @@ -9,3 +9,7 @@ env_vars: { key: "RUN_SNIPPETS_TESTS" value: "false" } +env_vars: { + key: "RUN_LINTING_TYPING_TESTS" + value: "false" +} diff --git a/noxfile.py b/noxfile.py index 3adb4ba70..034bb843a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -132,6 +132,10 @@ def unit_noextras(session): def mypy(session): """Run type checks with mypy.""" + # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true. + if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false": + session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping") + session.install("-e", ".[all]") session.install(MYPY_VERSION) @@ -153,6 +157,10 @@ def pytype(session): # recent version avoids the error until a possibly better fix is found. # https://github.com/googleapis/python-bigquery/issues/655 + # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true. + if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false": + session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping") + session.install("attrs==20.3.0") session.install("-e", ".[all]") session.install(PYTYPE_VERSION) @@ -213,6 +221,10 @@ def system(session): def mypy_samples(session): """Run type checks with mypy.""" + # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true. + if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false": + session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping") + session.install("pytest") for requirements_path in CURRENT_DIRECTORY.glob("samples/*/requirements.txt"): session.install("-r", str(requirements_path)) @@ -394,6 +406,10 @@ def lint(session): serious code quality issues. """ + # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true. + if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false": + session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping") + session.install("flake8", BLACK_VERSION) session.install("-e", ".") session.run("flake8", os.path.join("google", "cloud", "bigquery")) @@ -408,6 +424,10 @@ def lint(session): def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" + # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true. + if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false": + session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping") + session.install("docutils", "Pygments") session.run("python", "setup.py", "check", "--restructuredtext", "--strict") @@ -418,6 +438,10 @@ def blacken(session): Format code to uniform standard. """ + # Check the value of `RUN_LINTING_TYPING_TESTS` env var. It defaults to true. + if os.environ.get("RUN_LINTING_TYPING_TESTS", "true") == "false": + session.skip("RUN_LINTING_TYPING_TESTS is set to false, skipping") + session.install(BLACK_VERSION) session.run("black", *BLACK_PATHS)Fetched URL: http://github.com/googleapis/python-bigquery/pull/1881.diff
Alternative Proxies: