Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
0a74bfce
Unverified
Commit
0a74bfce
authored
Mar 17, 2025
by
Russell Bryant
Committed by
GitHub
Mar 17, 2025
Browse files
setup.py: drop assumption about local `main` branch (#14692)
Signed-off-by:
Russell Bryant
<
rbryant@redhat.com
>
parent
dd3b8658
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
14 deletions
+16
-14
setup.py
setup.py
+16
-14
No files found.
setup.py
View file @
0a74bfce
...
@@ -294,26 +294,28 @@ class repackage_wheel(build_ext):
...
@@ -294,26 +294,28 @@ class repackage_wheel(build_ext):
]).
decode
(
"utf-8"
)
]).
decode
(
"utf-8"
)
upstream_main_commit
=
json
.
loads
(
resp_json
)[
"sha"
]
upstream_main_commit
=
json
.
loads
(
resp_json
)[
"sha"
]
# Check if the local main branch is up-to-date. This is to ensure
# Check if the upstream_main_commit exists in the local repo
# the base commit we found is the most recent commit on the main
try
:
# branch.
subprocess
.
check_output
(
local_main_commit
=
subprocess
.
check_output
(
[
"git"
,
"cat-file"
,
"-e"
,
f
"
{
upstream_main_commit
}
"
])
[
"git"
,
"rev-parse"
,
"main"
]).
decode
(
"utf-8"
).
strip
()
except
subprocess
.
CalledProcessError
:
if
local_main_commit
!=
upstream_main_commit
:
# If not present, fetch it from the remote repository.
raise
ValueError
(
# Note that this does not update any local branches,
f
"Local main branch (
{
local_main_commit
}
) is not "
# but ensures that this commit ref and its history are
"up-to-date with upstream main branch "
# available in our local repo.
f
"(
{
upstream_main_commit
}
). Please pull the latest "
subprocess
.
check_call
([
"changes from upstream main branch first."
)
"git"
,
"fetch"
,
"https://github.com/vllm-project/vllm"
,
"main"
])
# Then get the commit hash of the current branch that is the same as
# Then get the commit hash of the current branch that is the same as
# the upstream main commit.
# the upstream main commit.
current_branch
=
subprocess
.
check_output
(
current_branch
=
subprocess
.
check_output
(
[
"git"
,
"branch"
,
"--show-current"
]).
decode
(
"utf-8"
).
strip
()
[
"git"
,
"branch"
,
"--show-current"
]).
decode
(
"utf-8"
).
strip
()
base_commit
=
subprocess
.
check_output
(
base_commit
=
subprocess
.
check_output
(
[
[
"git"
,
"merge-base"
,
"main"
,
"git"
,
"merge-base"
,
f
"
{
upstream_main_commit
}
"
,
current_branch
current_branch
]).
decode
(
"utf-8"
).
strip
()
]).
decode
(
"utf-8"
).
strip
()
return
base_commit
return
base_commit
except
ValueError
as
err
:
except
ValueError
as
err
:
raise
ValueError
(
err
)
from
None
raise
ValueError
(
err
)
from
None
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment