From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 6AAhBWf1fWHO4wAAgWs5BA (envelope-from ) for ; Sun, 31 Oct 2021 02:46:15 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id gFfhAGf1fWE8cAAAB5/wlQ (envelope-from ) for ; Sun, 31 Oct 2021 01:46:15 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 79D609C3A for ; Sun, 31 Oct 2021 02:46:14 +0100 (CET) Received: from localhost ([::1]:55612 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mgzvJ-0008VY-EO for larch@yhetil.org; Sat, 30 Oct 2021 21:46:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46266) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgzv9-0008Um-AV for guix-patches@gnu.org; Sat, 30 Oct 2021 21:46:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47153) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mgzv9-0006CU-2D for guix-patches@gnu.org; Sat, 30 Oct 2021 21:46:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mgzv9-0000tM-0Y for guix-patches@gnu.org; Sat, 30 Oct 2021 21:46:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48785] [PATCH v4 3/3] gnu: Add python-lightgbm. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 31 Oct 2021 01:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48785 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48785@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48785-submit@debbugs.gnu.org id=B48785.16356447333360 (code B ref 48785); Sun, 31 Oct 2021 01:46:02 +0000 Received: (at 48785) by debbugs.gnu.org; 31 Oct 2021 01:45:33 +0000 Received: from localhost ([127.0.0.1]:58697 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgzuf-0000s8-Ey for submit@debbugs.gnu.org; Sat, 30 Oct 2021 21:45:33 -0400 Received: from mout02.posteo.de ([185.67.36.66]:52561) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgzub-0000rV-JR for 48785@debbugs.gnu.org; Sat, 30 Oct 2021 21:45:30 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id E2447240101 for <48785@debbugs.gnu.org>; Sun, 31 Oct 2021 02:45:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1635644723; bh=t6w17uoPP4XRJNb7cZWrWmwDl7CgY+YCegf9CASefNo=; h=From:To:Cc:Subject:Date:From; b=Cb+6ea0Brb8qwJhXJoKii67m+8pKQDsKbPD5lRpDdK40pP4vTpq/UCfCQyZti8QLr /+/rmhWFKsb37MXyMiGoKrDJdFyLzkT6ZIfFVL+e3RwwcpjwUzkEdwyYu2WFaMEWEo vu3HrNKqVA5DBWoUrOhvNl8MzAULh6b/WqDbLYDlRhoO/ClV/wACtqtkhGRCjQuAZF 2uNcbPm8XVIsp/90zIOYoDVAQhRapuN6GyRbPNcMjTRT5aUiXI0VP2VGI+A0qYqoYE dTuQst494hq90S/uWT5eagKGY3RhoC8aAlPNq+Lzou27uG7UV2/qNkFdCi0WRASM+W +1wOZmioFZf1g== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4HhfBC069jz9rxQ; Sun, 31 Oct 2021 02:45:22 +0100 (CET) From: Vinicius Monego Date: Sun, 31 Oct 2021 01:40:28 +0000 Message-Id: <20211031014028.82583-3-monego@posteo.net> In-Reply-To: <20211031014028.82583-1-monego@posteo.net> References: <20211031014028.82583-1-monego@posteo.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1635644774; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=P/NCexfKp+73NPQQnrhLuslW/SXxwmxoqoHOGm4v6ak=; b=H2QK23lvZ4o1ONEnWFfy607RHbf9dWdJBVeeky+VRzEUV5EqIi0btUhxO2K1d7RjPqNu6R lO7+40cVKBGels+eSpXrOd57Ut1tejzwKgYSbAcnZyHCMf2KwLWUTj18GAt7hgXL2LhBw9 2ERTNDe6YGv0agX48z/ebYY/TXQcn+8SfKl/VQc/SAwxYLEKHw8YUPGTygCrwceV9XhpYZ wkABl3V+BfTEVhLnNll4MPmrSS1jbjeRSxdeT16TRKN1qdo7LJjttkawByi/7jcur8KCFc Fb8MFEIUzfLFrouOf5nLQXtF5AVDpPOhbZ8vuSnrFQ2rgF5FhLV/E2DvzndIBw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1635644774; a=rsa-sha256; cv=none; b=uad/BE2aO8g/v6PtDxik/VhVHZbtHre7Z/i2wxHj9zIn3UYY0A7Jzb0nccpCFOmm4u8pZq I/gtSeV/xwCu8+M8RCb34s3ORGZaro+Wnz660DTpF6AmXiC+m7S/ygFlASZ81AjIssrS78 bPtcRew2fD7Kn2j/10ndSchL4oDNHbIuXy1bD6QibX+1bxyb3PenTYSdYxKKxX7XxAcPuk lsznrP7XNOI4GcIwfXctfF1T0U2LNVbAmn/m+tCqZ/gEJoW+PO1dBVcILFrPovZTb4Rpwf DFuohSD1sY4AsfcpmWAQzuId4g8r8UFEesLXKJyXsynYF1wvEfZSnR/sfRXokg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=Cb+6ea0B; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 3.68 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=Cb+6ea0B; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: 79D609C3A X-Spam-Score: 3.68 X-Migadu-Scanner: scn0.migadu.com X-TUID: EWfNtG9vd1OF * gnu/packages/machine-learning.scm (python-lightgbm): New variable. --- gnu/packages/machine-learning.scm | 59 +++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index c7613ebe4e..59e9fdc75b 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1268,6 +1268,65 @@ the following advantages: @end itemize\n") (license license:expat))) +(define-public python-lightgbm + (package + (inherit lightgbm) + (name "python-lightgbm") + (source (package-source lightgbm)) + (build-system python-build-system) + (arguments + `(#:configure-flags (list "--precompile") ; use precompiled library + #:phases + (modify-phases %standard-phases + (add-after 'unpack 'preparations + (lambda _ + (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") + ;; Install version file to read the library's version. + (with-output-to-file "lightgbm/VERSION.txt" + (lambda () + (display ,(package-version lightgbm)))) + ;; Skip building the shared library. + (substitute* "setup.py" + (("'install_lib': CustomInstallLib,") "")))) + (add-after 'install 'install-liblightgbm + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (pylib (string-append out "/lib/python" + ,(version-major+minor + (package-version python)) + "/site-packages")) + (lgbdir (string-append pylib "/lightgbm")) + (lib-lightgbm (string-append (assoc-ref inputs "lightgbm") + "/lib/lib_lightgbm.so"))) + ;; This symlink is necessary for tests. + (symlink lib-lightgbm "lightgbm/lib_lightgbm.so") + ;; And this one for runtime. + (mkdir-p (string-append lgbdir "/lib")) + (symlink lib-lightgbm (string-append lgbdir + "/lib_lightgbm.so"))))) + (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-scikit-learn" ,python-scikit-learn) + ("python-scipy" ,python-scipy))) + (synopsis "Python frontend for LightGBM"))) + (define-public vowpal-wabbit ;; Language bindings not included. (package -- 2.30.2