]> granicus.if.org Git - liblinear/commitdiff
updated setup.py
authorSinacam <stinkingmadgod@gmail.com>
Mon, 7 Mar 2022 16:17:47 +0000 (00:17 +0800)
committerSinacam <stinkingmadgod@gmail.com>
Mon, 7 Mar 2022 16:17:47 +0000 (00:17 +0800)
python/setup.py

index b581e5e3b00f461d36aa3d1e8141745aebff14c9..7adde99ddaeeacc907aec71a2390ae5500d5f154 100644 (file)
@@ -16,7 +16,13 @@ build_ext.get_export_symbols = lambda x, y: []
 
 PACKAGE_DIR = "liblinear"
 PACKAGE_NAME = "liblinear-official"
-VERSION = "2.43.0"
+with open('../linear.h') as f:
+    for l in f:
+        if l.startswith('#define LIBLINEAR_VERSION '):
+            num = l[:-1].split(' ')[-1]
+            VERSION = f'{num[0]}.{num[1:3]}.0'
+            break
+
 cpp_dir = "cpp-source"
 # should be consistent with dynamic_lib_name in liblinear/liblinear.py
 dynamic_lib_name = "clib"