File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,9 @@ def get_base_dir():
4545def join_path (* paths ):
4646 return os .path .join (get_base_dir (), * paths )
4747
48+ # return the python version as a string like "310" or "311" etc
49+ def get_python_version ():
50+ return f"{ sys .version_info .major } { sys .version_info .minor } "
4851
4952def get_version ():
5053 # first read from environment variable
@@ -398,9 +401,9 @@ def run(self):
398401 self .run_command ('test' )
399402
400403 if self .arch == 'arm' :
401- ext_path = get_base_dir () + "/build/lib.linux-aarch64-cpython-311 /"
404+ ext_path = get_base_dir () + f "/build/lib.linux-aarch64-cpython-{ get_python_version () } /"
402405 else :
403- ext_path = get_base_dir () + "/build/lib.linux-x86_64-cpython-311 /"
406+ ext_path = get_base_dir () + f "/build/lib.linux-x86_64-cpython-{ get_python_version () } /"
404407 if len (ext_path ) == 0 :
405408 print ("Build wheel failed, not found path." )
406409 exit (1 )
Original file line number Diff line number Diff line change 11import importlib .util
22import os
33import xllm
4- install_path_x86 = os .path .dirname (xllm .__file__ ) + "/xllm_export.cpython-311-x86_64-linux-gnu.so"
5- install_path_arm = os .path .dirname (xllm .__file__ ) + "/xllm_export.cpython-311-aarch64-linux-gnu.so"
4+ import sys
5+
6+ def get_python_version ():
7+ return f"{ sys .version_info .major } { sys .version_info .minor } "
8+
9+ install_path_x86 = os .path .dirname (xllm .__file__ ) + f"/xllm_export.cpython-{ get_python_version ()} -x86_64-linux-gnu.so"
10+ install_path_arm = os .path .dirname (xllm .__file__ ) + f"/xllm_export.cpython-{ get_python_version ()} -aarch64-linux-gnu.so"
611if os .path .exists (install_path_x86 ):
712 install_path = install_path_x86
813elif os .path .exists (install_path_arm ):
You can’t perform that action at this time.
0 commit comments