Skip to content

Commit

Permalink
chore(python): use 'setup.py' to detect repo root (#65)
Browse files Browse the repository at this point in the history
Closes #792

Source-Author: Bu Sun Kim <[email protected]>
Source-Date: Fri Oct 9 15:06:33 2020 -0600
Source-Repo: googleapis/synthtool
Source-Sha: e0ae456852bf22f38796deb79cff30b516fde244
Source-Link: googleapis/synthtool@e0ae456
  • Loading branch information
yoshi-automation authored Oct 16, 2020
1 parent e7cb216 commit 09061cc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand Down
6 changes: 3 additions & 3 deletions packages/google-cloud-bigquery-datatransfer/synth.metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-bigquery-datatransfer.git",
"sha": "cc2b9ff311dfa6ec9d181d4c2a4c952a609f5dec"
"sha": "b95441140f7c86dd3e833aef0532badd6280ef48"
}
},
{
Expand All @@ -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"
}
}
],
Expand Down

0 comments on commit 09061cc

Please sign in to comment.