unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 992e6bb3fdf48ab5f0e964ec2e0158a49eeffa60 2521 bytes (raw)
name: gnu/packages/patches/xgboost-python-use-system-libxgboost.patch 	 # note: path name is non-authoritative(*)

 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


debug log:

solving 992e6bb3fd ...
found 992e6bb3fd in https://yhetil.org/guix-patches/20210512235844.516970-2-monego@posteo.net/ ||
	https://yhetil.org/guix-patches/20210513152914.573837-1-monego@posteo.net/

applying [1/1] https://yhetil.org/guix-patches/20210512235844.516970-2-monego@posteo.net/
diff --git a/gnu/packages/patches/xgboost-python-use-system-libxgboost.patch b/gnu/packages/patches/xgboost-python-use-system-libxgboost.patch
new file mode 100644
index 0000000000..992e6bb3fd

1:45: trailing whitespace.
 
1:51: trailing whitespace.
 
1:73: trailing whitespace.
-- 
Checking patch gnu/packages/patches/xgboost-python-use-system-libxgboost.patch...
1:75: new blank line at EOF.
+
Applied patch gnu/packages/patches/xgboost-python-use-system-libxgboost.patch cleanly.
warning: 4 lines add whitespace errors.

skipping https://yhetil.org/guix-patches/20210513152914.573837-1-monego@posteo.net/ for 992e6bb3fd
index at:
100644 992e6bb3fdf48ab5f0e964ec2e0158a49eeffa60	gnu/packages/patches/xgboost-python-use-system-libxgboost.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).