Skip to content

Commit

Permalink
chore(python): use 'setup.py' to detect repo root (#795)
Browse files Browse the repository at this point in the history
Closes #792
  • Loading branch information
busunkim96 committed Oct 9, 2020
1 parent b6164c2 commit e0ae456
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions synthtool/gcp/templates/python_samples/noxfile.py.j2
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

0 comments on commit e0ae456

Please sign in to comment.