@@ -35,9 +35,24 @@ def main():
3535
3636 with open ("pyproject.toml" , "rb" ) as f :
3737 data = tomllib .load (f )
38- current_version = parse_current_version (
39- vllm_string = data ["project" ]["optional-dependencies" ]["vllm" ][0 ]
38+ # Find appropriate index
39+ vllm_deps = data ["project" ]["optional-dependencies" ]["vllm" ]
40+ vllm_git_index = next (
41+ (i for i , item in enumerate (vllm_deps ) if item .startswith ("vllm @ git" )),
42+ None ,
4043 )
44+ vllm_darwin_index = next (
45+ (
46+ i
47+ for i , item in enumerate (vllm_deps )
48+ if item .startswith ("vllm>" ) or item .startswith ("vllm=" )
49+ ),
50+ None ,
51+ )
52+ if not vllm_git_index or not vllm_darwin_index :
53+ print (f"vllm dependencies to be overwritten are missing - skipping update" )
54+ sys .exit (0 )
55+ current_version = parse_current_version (vllm_string = vllm_deps [vllm_git_index ])
4156 if current_version == args .vllm_version :
4257 print (
4358 f"VLLM already updated to latest version, skipping update and setting 'SKIP_VERSION' output!"
@@ -47,10 +62,10 @@ def main():
4762 sys .exit (0 )
4863 else :
4964 data ["project" ]["optional-dependencies" ]["vllm" ][
50- 0
65+ vllm_git_index
5166 ] = f"vllm @ git+https://github.com/vllm-project/vllm.git@v{ args .vllm_version } ; sys_platform == 'darwin'"
5267 data ["project" ]["optional-dependencies" ]["vllm" ][
53- 1
68+ vllm_darwin_index
5469 ] = f"vllm=={ args .vllm_version } ; sys_platform != 'darwin'"
5570
5671 with open ("pyproject.toml" , "wb" ) as f :
0 commit comments