diff --git a/synthtool/gcp/templates/python_samples/noxfile.py.j2 b/synthtool/gcp/templates/python_samples/noxfile.py.j2 index 8e0f6c1fc..dfad4aaa5 100644 --- a/synthtool/gcp/templates/python_samples/noxfile.py.j2 +++ b/synthtool/gcp/templates/python_samples/noxfile.py.j2 @@ -96,6 +96,8 @@ IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] TESTED_VERSIONS = sorted([v for v in ALL_VERSIONS if v not in IGNORED_VERSIONS]) +INSTALL_LIBRARY_FROM_SOURCE = os.environ.get(bool("INSTALL_LIBRARY_FROM_SOURCE", False) + # # Style Checks # @@ -161,7 +163,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(): + if _is_client_library_repo() and INSTALL_LIBRARY_FROM_SOURCE: session.install('-e', _get_repo_root()) if post_install: