From 55b70316c94e0412039d7e7fff649c61abd43df9 Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Tue, 19 May 2020 19:32:29 +0000 Subject: [PATCH 1/3] Add 'INSTALL_LIBRARY_FROM_SOURCE' to noxfile-template --- noxfile-template.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/noxfile-template.py b/noxfile-template.py index 5f98325dbcd..61648e261ed 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -88,6 +88,7 @@ def get_pytest_env_vars(): TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) +INSTALL_LIBRARY_FROM_SOURCE = bool(os.environ.get("INSTALL_LIBRARY_FROM_SOURCE", False)) # # Style Checks # @@ -159,6 +160,9 @@ def _session_tests(session, post_install=None): if os.path.exists("requirements-test.txt"): session.install("-r", "requirements-test.txt") + if _is_client_library_repo() and INSTALL_LIBRARY_FROM_SOURCE: + session.install("-e", _get_repo_root()) + if post_install: post_install(session) @@ -183,6 +187,10 @@ def py(session): session.python )) +def _is_client_library_repo(): + """Returns true if in a client library repository""" + root = _get_repo_root() + return os.path.exists(os.path.join(root, "setup.py")) # # Readmegen From 6991c81e8154c428cf06739839ad99150eb0dd2d Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Tue, 19 May 2020 13:01:00 -0700 Subject: [PATCH 2/3] chore: fix lint --- noxfile-template.py | 1 + 1 file changed, 1 insertion(+) diff --git a/noxfile-template.py b/noxfile-template.py index 61648e261ed..6e8e1f48e46 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -187,6 +187,7 @@ def py(session): session.python )) + def _is_client_library_repo(): """Returns true if in a client library repository""" root = _get_repo_root() From 873f7cb57fc098fb0b8da9f4f1c05b8450b4ef1a Mon Sep 17 00:00:00 2001 From: Bu Sun Kim Date: Tue, 19 May 2020 20:54:29 +0000 Subject: [PATCH 3/3] fix: remove check for client library repo --- noxfile-template.py | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/noxfile-template.py b/noxfile-template.py index 6e8e1f48e46..b23055f14a6 100644 --- a/noxfile-template.py +++ b/noxfile-template.py @@ -160,7 +160,7 @@ def _session_tests(session, post_install=None): if os.path.exists("requirements-test.txt"): session.install("-r", "requirements-test.txt") - if _is_client_library_repo() and INSTALL_LIBRARY_FROM_SOURCE: + if INSTALL_LIBRARY_FROM_SOURCE: session.install("-e", _get_repo_root()) if post_install: @@ -188,11 +188,6 @@ def py(session): )) -def _is_client_library_repo(): - """Returns true if in a client library repository""" - root = _get_repo_root() - return os.path.exists(os.path.join(root, "setup.py")) - # # Readmegen #