Skip to content

Commit

Permalink
🦉 Updates from OwlBot post-processor
Browse files Browse the repository at this point in the history
  • Loading branch information
gcf-owl-bot[bot] committed Nov 7, 2024
1 parent 9dbe9c8 commit db75791
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions .kokoro/test-samples-impl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ export PYTHONUNBUFFERED=1
env | grep KOKORO

# Install nox
# `virtualenv==20.26.6` is added for Python 3.7 compatibility
python3.9 -m pip install --upgrade --quiet nox virtualenv==20.26.6
python3.9 -m pip install --upgrade --quiet nox

# Use secrets acessor service account to get secrets
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
Expand Down
16 changes: 8 additions & 8 deletions samples/beam/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import nox


# WARNING - WARNING - WARNING - WARNING - WARNING
# WARNING - WARNING - WARNING - WARNING - WARNING
# DO NOT EDIT THIS FILE EVER!
Expand Down Expand Up @@ -157,7 +158,6 @@ def blacken(session: nox.sessions.Session) -> None:
# format = isort + black
#


@nox.session
def format(session: nox.sessions.Session) -> None:
"""
Expand Down Expand Up @@ -185,9 +185,7 @@ def _session_tests(
session: nox.sessions.Session, post_install: Callable = None
) -> None:
# check for presence of tests
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob(
"**/test_*.py", recursive=True
)
test_list = glob.glob("**/*_test.py", recursive=True) + glob.glob("**/test_*.py", recursive=True)
test_list.extend(glob.glob("**/tests", recursive=True))

if len(test_list) == 0:
Expand All @@ -209,7 +207,9 @@ def _session_tests(

if os.path.exists("requirements-test.txt"):
if os.path.exists("constraints-test.txt"):
session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt")
session.install(
"-r", "requirements-test.txt", "-c", "constraints-test.txt"
)
else:
session.install("-r", "requirements-test.txt")
with open("requirements-test.txt") as rtfile:
Expand All @@ -222,9 +222,9 @@ def _session_tests(
post_install(session)

if "pytest-parallel" in packages:
concurrent_args.extend(["--workers", "auto", "--tests-per-worker", "auto"])
concurrent_args.extend(['--workers', 'auto', '--tests-per-worker', 'auto'])
elif "pytest-xdist" in packages:
concurrent_args.extend(["-n", "auto"])
concurrent_args.extend(['-n', 'auto'])

session.run(
"pytest",
Expand Down Expand Up @@ -254,7 +254,7 @@ def py(session: nox.sessions.Session) -> None:


def _get_repo_root() -> Optional[str]:
"""Returns the root folder of the project."""
""" Returns the root folder of the project. """
# Get root of this repository. Assume we don't have directories nested deeper than 10 items.
p = Path(os.getcwd())
for i in range(10):
Expand Down

0 comments on commit db75791

Please sign in to comment.