Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: creates linting-typing.cfg in presubmit #1881

Merged
merged 17 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
revise environmental variables
  • Loading branch information
chalmerlowe committed Mar 29, 2024
commit 286362e96ac43e14dd2f9ee67a64ade042b46def
6 changes: 1 addition & 5 deletions .kokoro/presubmit/presubmit.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ env_vars: {
value: "false"
}
env_vars: {
key: "RUN_TYPING_TESTS"
value: "false"
}
env_vars: {
key: "RUN_LINTING_TESTS"
key: "RUN_LINTING_TYPING_TESTS"
value: "false"
chalmerlowe marked this conversation as resolved.
Show resolved Hide resolved
}
24 changes: 12 additions & 12 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ def mypy(session):
"""Run type checks with mypy."""

# Check the value of `RUN_TYPING_TESTS` env var. It defaults to true.
chalmerlowe marked this conversation as resolved.
Show resolved Hide resolved
if os.environ.get("RUN_TYPING_TESTS", "true") == "false":
session.skip("RUN_TYPING_TESTS is set to false, skipping")
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)
Expand All @@ -158,8 +158,8 @@ def pytype(session):
# https://github.com/googleapis/python-bigquery/issues/655

# Check the value of `RUN_TYPING_TESTS` env var. It defaults to true.
chalmerlowe marked this conversation as resolved.
Show resolved Hide resolved
if os.environ.get("RUN_TYPING_TESTS", "true") == "false":
session.skip("RUN_TYPING_TESTS is set to false, skipping")
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]")
Expand Down Expand Up @@ -222,8 +222,8 @@ def mypy_samples(session):
"""Run type checks with mypy."""

# Check the value of `RUN_TYPING_TESTS` env var. It defaults to true.
chalmerlowe marked this conversation as resolved.
Show resolved Hide resolved
if os.environ.get("RUN_TYPING_TESTS", "true") == "false":
session.skip("RUN_TYPING_TESTS is set to false, skipping")
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"):
Expand Down Expand Up @@ -407,8 +407,8 @@ def lint(session):
"""

# Check the value of `RUN_LINTING_TESTS` env var. It defaults to true.
chalmerlowe marked this conversation as resolved.
Show resolved Hide resolved
if os.environ.get("RUN_LINTING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TESTS is set to false, skipping")
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", ".")
Expand All @@ -425,8 +425,8 @@ def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""

# Check the value of `RUN_LINTING_TESTS` env var. It defaults to true.
chalmerlowe marked this conversation as resolved.
Show resolved Hide resolved
if os.environ.get("RUN_LINTING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TESTS is set to false, skipping")
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")
Expand All @@ -439,8 +439,8 @@ def blacken(session):
"""

# Check the value of `RUN_LINTING_TESTS` env var. It defaults to true.
chalmerlowe marked this conversation as resolved.
Show resolved Hide resolved
if os.environ.get("RUN_LINTING_TESTS", "true") == "false":
session.skip("RUN_LINTING_TESTS is set to false, skipping")
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)
Expand Down