Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

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 <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
  • Loading branch information
yoshi-automation committed Oct 16, 2020
1 parent b954411 commit bbe50e6
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
5 changes: 5 additions & 0 deletions samples/noxfile.py
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
5 changes: 5 additions & 0 deletions samples/snippets/noxfile.py
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 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 bbe50e6

Please sign in to comment.