File tree Expand file tree Collapse file tree 8 files changed +25
-7
lines changed Expand file tree Collapse file tree 8 files changed +25
-7
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " kcl-lang"
3- version = " 0.8.0-alpha.3 "
3+ version = " 0.8.0-alpha.4 "
44edition = " 2021"
55readme = " README.md"
66documentation = " kcl-lang.io"
Original file line number Diff line number Diff line change 88 "runtime"
99)
1010
11- const KCLVM_VERSION = "v0.8.0-alpha.3 "
11+ const KCLVM_VERSION = "v0.8.0-alpha.4 "
1212
1313func findPath (name string ) string {
1414 if path , err := exec .LookPath (name ); err == nil {
Original file line number Diff line number Diff line change 66
77 <groupId >com.kcl</groupId >
88 <artifactId >kcl-lib</artifactId >
9- <version >0.8.0-alpha.3 </version >
9+ <version >0.8.0-alpha.4 </version >
1010 <name >KCL Arifact Library for Java</name >
1111 <description >
1212 KCL is an open-source constraint-based record and functional language mainly
Original file line number Diff line number Diff line change 1212
1313fmt :
1414 python3 -m black .
15+
16+ test :
17+ python3 -m pip install pytest && python3 -m pytest
Original file line number Diff line number Diff line change 88 lib_full_name ,
99 install_kclvm ,
1010)
11+ from kcl_lib .bootstrap .artifact import lib_path
1112from .spec_pb2 import *
1213from ctypes import c_char_p , c_void_p
1314from google .protobuf import message as _message
@@ -108,8 +109,7 @@ def __init__(self):
108109 install_kclvm (env_install_path )
109110 self .lib = ctypes .CDLL (os .path .join (env_install_path , lib_full_name ()))
110111 else :
111- install_kclvm (self ._dir .name )
112- self .lib = ctypes .CDLL (self ._dir .name + "/bin/" + lib_full_name ())
112+ self .lib = ctypes .CDLL (os .path .join (lib_path (), lib_full_name ()))
113113 # Assuming the shared library exposes a function `kclvm_service_new`
114114 self .lib .kclvm_service_new .argtypes = [ctypes .c_uint64 ]
115115 self .lib .kclvm_service_new .restype = ctypes .c_void_p
Original file line number Diff line number Diff line change 33import platform
44from pathlib import Path
55
6- KCLVM_VERSION = "0.8.0-alpha.3 " # You should replace this with actual version
6+ KCLVM_VERSION = "0.8.0-alpha.4 " # You should replace this with actual version
77KCLVM_CLI_BIN_PATH_ENV_VAR = "KCLVM_CLI_BIN_PATH"
88KCLVM_CLI_INSTALL_PATH_ENV_VAR = "KCLVM_CLI_INSTALL_PATH"
99LIB_NAME = "kclvm_cli_cdylib"
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ def is_amd64_arch():
2929 def cli_lib ():
3030 return DARWIN_AMD64_CLI_LIB if is_amd64_arch () else DARWIN_ARM64_CLI_LIB
3131
32+ def lib_path () -> str :
33+ if is_amd64_arch ():
34+ return str (LIB_ROOT .joinpath ("lib" ).joinpath ("darwin-amd64" ))
35+ return str (LIB_ROOT .joinpath ("lib" ).joinpath ("darwin-arm64" ))
36+
3237elif sys .platform .startswith ("linux" ):
3338 if is_amd64_arch ():
3439 with open (f"{ LIB_ROOT } /lib/linux-amd64/libkclvm_cli_cdylib.so" , "rb" ) as f :
@@ -40,6 +45,11 @@ def cli_lib():
4045 def cli_lib ():
4146 return LINUX_AMD64_CLI_LIB if is_amd64_arch () else LINUX_ARM64_CLI_LIB
4247
48+ def lib_path () -> str :
49+ if is_amd64_arch ():
50+ return str (LIB_ROOT .joinpath ("lib" ).joinpath ("linux-amd64" ))
51+ return str (LIB_ROOT .joinpath ("lib" ).joinpath ("linux-arm64" ))
52+
4353elif sys .platform == "win32" :
4454 if is_amd64_arch ():
4555 with open (f"{ LIB_ROOT } /lib/windows-amd64/kclvm_cli_cdylib.dll" , "rb" ) as f :
@@ -58,5 +68,10 @@ def cli_lib():
5868 def export_lib ():
5969 return WINDOWS_AMD64_EXPORT_LIB if is_amd64_arch () else WINDOWS_ARM64_EXPORT_LIB
6070
71+ def lib_path () -> str :
72+ if is_amd64_arch ():
73+ return str (LIB_ROOT .joinpath ("lib" ).joinpath ("windows-amd64" ))
74+ return str (LIB_ROOT .joinpath ("lib" ).joinpath ("windows-arm64" ))
75+
6176else :
6277 raise f"Unsupported platform { sys .platform } , expected win32, linux or darwin platform"
Original file line number Diff line number Diff line change @@ -121,7 +121,7 @@ def copy_libs():
121121setup (
122122 name = "kcl_lib" ,
123123 author = "KCL Authors" ,
124- version = "0.8.0-alpha.3 " ,
124+ version = "0.8.0-alpha.4 " ,
125125 license = "Apache License 2.0" ,
126126 python_requires = ">=3.7" ,
127127 description = "KCL Artifact Library for Python" ,
You can’t perform that action at this time.
0 commit comments