Skip to content

Commit e0ae456

Browse files
authored
chore(python): use 'setup.py' to detect repo root (#795)
Closes #792
1 parent b6164c2 commit e0ae456

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

synthtool/gcp/templates/python_samples/noxfile.py.j2

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

0 commit comments

Comments
 (0)