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

chore(python): use 'setup.py' to detect repo root #65

Merged
merged 1 commit into from
Oct 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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