1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
| | From 768192b9c6700f0ae6b750c56b114d7022692a0b Mon Sep 17 00:00:00 2001
From: Vinicius Monego <monego@posteo.net>
Date: Tue, 11 May 2021 19:30:55 -0300
Subject: [PATCH] Python wrapper: use system libxgboost.
---
This patch was extended from the following Debian patch: https://sources.debian.org/src/xgboost/1.2.1-1/debian/patches/setup.py.patch/
python-package/setup.py | 4 ++--
python-package/xgboost/__init__.py | 5 ++---
python-package/xgboost/libpath.py | 5 +++++
3 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/python-package/setup.py b/python-package/setup.py
index a2feb766..b8b78429 100644
--- a/python-package/setup.py
+++ b/python-package/setup.py
@@ -312,11 +312,11 @@ if __name__ == '__main__':
'numpy',
'scipy',
],
- ext_modules=[CMakeExtension('libxgboost')],
+ # ext_modules=[CMakeExtension('libxgboost')],
cmdclass={
'build_ext': BuildExt,
'sdist': Sdist,
- 'install_lib': InstallLib,
+ # 'install_lib': InstallLib,
'install': Install
},
extras_require={
diff --git a/python-package/xgboost/__init__.py b/python-package/xgboost/__init__.py
index e0ff434d..658e84e6 100644
--- a/python-package/xgboost/__init__.py
+++ b/python-package/xgboost/__init__.py
@@ -21,9 +21,8 @@ try:
except ImportError:
pass
-VERSION_FILE = os.path.join(os.path.dirname(__file__), 'VERSION')
-with open(VERSION_FILE) as f:
- __version__ = f.read().strip()
+# This variable will be set during substitution.
+__version__ = ''
__all__ = ['DMatrix', 'DeviceQuantileDMatrix', 'Booster',
'train', 'cv',
diff --git a/python-package/xgboost/libpath.py b/python-package/xgboost/libpath.py
index f7a7d9cd..88d9d986 100644
--- a/python-package/xgboost/libpath.py
+++ b/python-package/xgboost/libpath.py
@@ -19,9 +19,14 @@ def find_lib_path() -> List[str]:
lib_path
List of all found library path to xgboost
"""
+
+ # This variable will be set during substitution.
+ XGBOOST_PATH = ''
+
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
dll_path = [
# normal, after installation `lib` is copied into Python package tree.
+ os.path.join(XGBOOST_PATH, 'lib'),
os.path.join(curr_path, 'lib'),
# editable installation, no copying is performed.
os.path.join(curr_path, os.path.pardir, os.path.pardir, 'lib'),
--
2.31.1
|