From ddea73ddf64d9e670fb9f7652d398fe7b2cbfea6 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Fri, 23 Apr 2021 12:10:03 -0400 Subject: [PATCH] chore: migrate to owl bot (#137) --- .../samples/snippets/hybrid_glossaries/noxfile.py | 10 ++++++++-- translation/samples/snippets/noxfile.py | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/translation/samples/snippets/hybrid_glossaries/noxfile.py b/translation/samples/snippets/hybrid_glossaries/noxfile.py index 97bf7da80e39..956cdf4f9250 100644 --- a/translation/samples/snippets/hybrid_glossaries/noxfile.py +++ b/translation/samples/snippets/hybrid_glossaries/noxfile.py @@ -172,10 +172,16 @@ def blacken(session: nox.sessions.Session) -> None: def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: """Runs py.test for a particular project.""" if os.path.exists("requirements.txt"): - session.install("-r", "requirements.txt") + if os.path.exists("constraints.txt"): + session.install("-r", "requirements.txt", "-c", "constraints.txt") + else: + session.install("-r", "requirements.txt") if os.path.exists("requirements-test.txt"): - session.install("-r", "requirements-test.txt") + if os.path.exists("constraints-test.txt"): + session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") + else: + session.install("-r", "requirements-test.txt") if INSTALL_LIBRARY_FROM_SOURCE: session.install("-e", _get_repo_root()) diff --git a/translation/samples/snippets/noxfile.py b/translation/samples/snippets/noxfile.py index 97bf7da80e39..956cdf4f9250 100644 --- a/translation/samples/snippets/noxfile.py +++ b/translation/samples/snippets/noxfile.py @@ -172,10 +172,16 @@ def blacken(session: nox.sessions.Session) -> None: def _session_tests(session: nox.sessions.Session, post_install: Callable = None) -> None: """Runs py.test for a particular project.""" if os.path.exists("requirements.txt"): - session.install("-r", "requirements.txt") + if os.path.exists("constraints.txt"): + session.install("-r", "requirements.txt", "-c", "constraints.txt") + else: + session.install("-r", "requirements.txt") if os.path.exists("requirements-test.txt"): - session.install("-r", "requirements-test.txt") + if os.path.exists("constraints-test.txt"): + session.install("-r", "requirements-test.txt", "-c", "constraints-test.txt") + else: + session.install("-r", "requirements-test.txt") if INSTALL_LIBRARY_FROM_SOURCE: session.install("-e", _get_repo_root())