diff --git a/packages/google-cloud-bigquery-datatransfer/samples/noxfile.py b/packages/google-cloud-bigquery-datatransfer/samples/noxfile.py index ba55d7ce53ca..01686e4a0379 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/noxfile.py +++ b/packages/google-cloud-bigquery-datatransfer/samples/noxfile.py @@ -201,6 +201,11 @@ def _get_repo_root(): break if Path(p / ".git").exists(): return str(p) + # .git is not available in repos cloned via Cloud Build + # setup.py is always in the library's root, so use that instead + # https://github.com/googleapis/synthtool/issues/792 + if Path(p / "setup.py").exists(): + return str(p) p = p.parent raise Exception("Unable to detect repository root.") diff --git a/packages/google-cloud-bigquery-datatransfer/samples/snippets/noxfile.py b/packages/google-cloud-bigquery-datatransfer/samples/snippets/noxfile.py index ba55d7ce53ca..01686e4a0379 100644 --- a/packages/google-cloud-bigquery-datatransfer/samples/snippets/noxfile.py +++ b/packages/google-cloud-bigquery-datatransfer/samples/snippets/noxfile.py @@ -201,6 +201,11 @@ def _get_repo_root(): break if Path(p / ".git").exists(): return str(p) + # .git is not available in repos cloned via Cloud Build + # setup.py is always in the library's root, so use that instead + # https://github.com/googleapis/synthtool/issues/792 + if Path(p / "setup.py").exists(): + return str(p) p = p.parent raise Exception("Unable to detect repository root.") diff --git a/packages/google-cloud-bigquery-datatransfer/synth.metadata b/packages/google-cloud-bigquery-datatransfer/synth.metadata index a036d5945dea..759f6ddbe2e2 100644 --- a/packages/google-cloud-bigquery-datatransfer/synth.metadata +++ b/packages/google-cloud-bigquery-datatransfer/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-bigquery-datatransfer.git", - "sha": "cc2b9ff311dfa6ec9d181d4c2a4c952a609f5dec" + "sha": "b95441140f7c86dd3e833aef0532badd6280ef48" } }, { @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4" + "sha": "e0ae456852bf22f38796deb79cff30b516fde244" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4" + "sha": "e0ae456852bf22f38796deb79cff30b516fde244" } } ],