mirror of
https://github.com/vale981/ray
synced 2025-03-06 02:21:39 -05:00
Fix github_repository(path=...) accidentally requiring other fields that shouldn't be necessary (#7275)
Co-authored-by: GitHub Web Flow <noreply@github.com>
This commit is contained in:
parent
669bb403c3
commit
b97b8c2be1
1 changed files with 7 additions and 7 deletions
|
@ -26,22 +26,22 @@ def github_repository(*, name=None, remote=None, commit=None, tag=None,
|
|||
GIT_SUFFIX = ".git"
|
||||
|
||||
treeish = commit or tag or branch
|
||||
if not treeish: fail("Missing commit, tag, or branch argument")
|
||||
if remote == None: fail("Missing remote argument")
|
||||
if path == None and not treeish: fail("Missing commit, tag, or branch argument")
|
||||
if path == None and remote == None: fail("Missing remote argument")
|
||||
|
||||
if remote.endswith(GIT_SUFFIX):
|
||||
if path == None and remote.endswith(GIT_SUFFIX):
|
||||
remote_no_suffix = remote[:len(remote) - len(GIT_SUFFIX)]
|
||||
else:
|
||||
remote_no_suffix = remote
|
||||
project = remote_no_suffix.split("//", 1)[1].split("/")[2]
|
||||
project = remote_no_suffix.split("//", 1)[1].split("/")[2] if remote_no_suffix else None
|
||||
|
||||
if name == None:
|
||||
if project != None and name == None:
|
||||
name = project.replace("-", "_")
|
||||
if strip_prefix == True:
|
||||
if project != None and strip_prefix == True:
|
||||
strip_prefix = "%s-%s" % (project, treeish)
|
||||
if url == None:
|
||||
url = "%s/archive/%s%s" % (remote_no_suffix, treeish, archive_suffix)
|
||||
if build_file == True:
|
||||
if name != None and build_file == True:
|
||||
build_file = "@//%s:%s" % ("bazel", "BUILD." + name)
|
||||
|
||||
if path != None:
|
||||
|
|
Loading…
Add table
Reference in a new issue