GNU bug report logs - #48785
[PATCH 0/3] Update LightGBM and split frontends.

Previous Next

Package: guix-patches;

Reported by: Vinicius Monego <monego <at> posteo.net>

Date: Tue, 1 Jun 2021 22:06:01 UTC

Severity: normal

Tags: patch

Full log


Message #14 received at 48785 <at> debbugs.gnu.org (full text, mbox):

From: Vinicius Monego <monego <at> posteo.net>
To: 48785 <at> debbugs.gnu.org
Cc: Vinicius Monego <monego <at> posteo.net>
Subject: [PATCH 3/3] gnu: Add python-lightgbm.
Date: Tue,  1 Jun 2021 22:06:43 +0000
* gnu/packages/machine-learning.scm (python-lightgbm): New variable.
---
 gnu/packages/machine-learning.scm | 43 +++++++++++++++++++++++++++++++
 1 file changed, 43 insertions(+)

diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 1a3f647dde..900ca15b28 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -1110,6 +1110,49 @@ the following advantages:
 @end itemize\n")
     (license license:expat)))
 
+(define-public python-lightgbm
+  (package
+    (inherit lightgbm)
+    (name "python-lightgbm")
+    (build-system python-build-system)
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'unpack 'preparations
+           (lambda* (#:key inputs #:allow-other-keys)
+             (setenv "HOME" "/tmp") ;to write a log file
+             ;; Move Python files to source root to silence some warnings.
+             (rename-file "python-package/setup.py" "setup.py")
+             (rename-file "python-package/README.rst" "README.rst")
+             (rename-file "python-package/lightgbm" "lightgbm")
+             (substitute* "setup.py"
+               (("version = ''")
+                (string-append "version = " "'"
+                               ,(package-version lightgbm) "'")))
+             (substitute* "lightgbm/libpath.py"
+               (("lib_lightgbm_path = ''")
+                (string-append "lib_lightgbm_path = " "'"
+                               (assoc-ref inputs "lightgbm")
+                               "/lib" "'")))))
+         (replace 'check
+           (lambda* (#:key inputs outputs tests? #:allow-other-keys)
+             (when tests?
+               (add-installed-pythonpath inputs outputs)
+               (invoke "python" "-m" "pytest"
+                       "tests/python_package_test")))))))
+    (native-inputs
+     `(("python-psutil" ,python-psutil)
+       ("python-pytest" ,python-pytest)
+       ("python-wheel" ,python-wheel)))
+    (inputs
+     `(("lightgbm" ,lightgbm)))
+    (propagated-inputs
+     `(("python-numpy" ,python-numpy)
+       ("python-pandas" ,python-pandas)
+       ("python-scipy" ,python-scipy)
+       ("python-scikit-learn" ,python-scikit-learn)))
+    (synopsis "Python frontend for LightGBM")))
+
 (define-public vowpal-wabbit
   ;; Language bindings not included.
   (package
-- 
2.31.1





This bug report was last modified 1 year and 353 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.