File tree Expand file tree Collapse file tree 2 files changed +13
-3
lines changed
translation/samples/snippets Expand file tree Collapse file tree 2 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -199,6 +199,11 @@ def _get_repo_root():
199199 break
200200 if Path (p / ".git" ).exists ():
201201 return str (p )
202+ # .git is not available in repos cloned via Cloud Build
203+ # setup.py is always in the library's root, so use that instead
204+ # https://github.com/googleapis/synthtool/issues/792
205+ if Path (p / "setup.py" ).exists ():
206+ return str (p )
202207 p = p .parent
203208 raise Exception ("Unable to detect repository root." )
204209
Original file line number Diff line number Diff line change @@ -180,9 +180,9 @@ def py(session):
180180 if session .python in TESTED_VERSIONS :
181181 _session_tests (session )
182182 else :
183- session .skip (
184- "SKIPPED: {} tests are disabled for this sample." . format ( session .python )
185- )
183+ session .skip ("SKIPPED: {} tests are disabled for this sample." . format (
184+ session .python
185+ ))
186186
187187
188188#
@@ -199,6 +199,11 @@ def _get_repo_root():
199199 break
200200 if Path (p / ".git" ).exists ():
201201 return str (p )
202+ # .git is not available in repos cloned via Cloud Build
203+ # setup.py is always in the library's root, so use that instead
204+ # https://github.com/googleapis/synthtool/issues/792
205+ if Path (p / "setup.py" ).exists ():
206+ return str (p )
202207 p = p .parent
203208 raise Exception ("Unable to detect repository root." )
204209
You can’t perform that action at this time.
0 commit comments