Skip to content

Commit 09061cc

Browse files
chore(python): use 'setup.py' to detect repo root (#65)
Closes #792 Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Fri Oct 9 15:06:33 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: e0ae456852bf22f38796deb79cff30b516fde244 Source-Link: googleapis/synthtool@e0ae456
1 parent e7cb216 commit 09061cc

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

packages/google-cloud-bigquery-datatransfer/samples/noxfile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ def _get_repo_root():
201201
break
202202
if Path(p / ".git").exists():
203203
return str(p)
204+
# .git is not available in repos cloned via Cloud Build
205+
# setup.py is always in the library's root, so use that instead
206+
# https://github.com/googleapis/synthtool/issues/792
207+
if Path(p / "setup.py").exists():
208+
return str(p)
204209
p = p.parent
205210
raise Exception("Unable to detect repository root.")
206211

packages/google-cloud-bigquery-datatransfer/samples/snippets/noxfile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ def _get_repo_root():
201201
break
202202
if Path(p / ".git").exists():
203203
return str(p)
204+
# .git is not available in repos cloned via Cloud Build
205+
# setup.py is always in the library's root, so use that instead
206+
# https://github.com/googleapis/synthtool/issues/792
207+
if Path(p / "setup.py").exists():
208+
return str(p)
204209
p = p.parent
205210
raise Exception("Unable to detect repository root.")
206211

packages/google-cloud-bigquery-datatransfer/synth.metadata

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"git": {
55
"name": ".",
66
"remote": "https://github.com/googleapis/python-bigquery-datatransfer.git",
7-
"sha": "cc2b9ff311dfa6ec9d181d4c2a4c952a609f5dec"
7+
"sha": "b95441140f7c86dd3e833aef0532badd6280ef48"
88
}
99
},
1010
{
@@ -19,14 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4"
22+
"sha": "e0ae456852bf22f38796deb79cff30b516fde244"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4"
29+
"sha": "e0ae456852bf22f38796deb79cff30b516fde244"
3030
}
3131
}
3232
],

0 commit comments

Comments
 (0)