From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id oJblHwLlmGRedgEASxT56A (envelope-from ) for ; Mon, 26 Jun 2023 03:08:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id qBLfHwLlmGTrXAEAauVa8A (envelope-from ) for ; Mon, 26 Jun 2023 03:08:18 +0200 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 4733915F70 for ; Mon, 26 Jun 2023 03:08:18 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qDai4-0007l8-TW; Sun, 25 Jun 2023 21:08:04 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qDai3-0007kr-43 for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qDai2-0004db-RR for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qDai2-0004fJ-Mz for guix-patches@gnu.org; Sun, 25 Jun 2023 21:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48785] [PATCH v6 3/3] gnu: Add python-lightgbm. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 26 Jun 2023 01:08: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.168774166417892 (code B ref 48785); Mon, 26 Jun 2023 01:08:02 +0000 Received: (at 48785) by debbugs.gnu.org; 26 Jun 2023 01:07:44 +0000 Received: from localhost ([127.0.0.1]:44027 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDahk-0004eV-4u for submit@debbugs.gnu.org; Sun, 25 Jun 2023 21:07:44 -0400 Received: from mout02.posteo.de ([185.67.36.66]:35933) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qDahh-0004e6-Pd for 48785@debbugs.gnu.org; Sun, 25 Jun 2023 21:07:42 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 0FD8D240101 for <48785@debbugs.gnu.org>; Mon, 26 Jun 2023 03:07:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1687741656; bh=S+xWvyBJjg2cVGsH9kacXcLqQ2lWfEsqC8TqrPl4Q9g=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version: Content-Transfer-Encoding:From; b=CA2e7bHqDUI1t8WJJ1cTdeWUnFgjIzlcDh/NjI5PsA4D4YydtT+txeK3udI8xCRtg ARuMEqQB0WQ5TEH0cdtWiyHUcREutbffoylW7UEhIJfHAnAe9umXr2F6/TKE00klAl RScSw/Df8D6yuZyoIgC18LUCgQA8xsoHJQhmmBBAzAmoMShPjz4ZgLTuesvcAWVkna sDBAPzfuaohDyB1VBnKf0oFV6uVpcDt4vHN+wZdDKTHZMXZfzC7q4DC9lZGkfhjj22 kCBPWl8RH2d/qo6lN0o4xT6Sl0eq022WP6u3CEJ/D/2ME8Ryn7MNObPQsSky9i2Ru4 3reFBFAbkM3Aw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Qq8pG337zz6txw; Mon, 26 Jun 2023 03:07:34 +0200 (CEST) From: Vinicius Monego Date: Mon, 26 Jun 2023 01:06:35 +0000 Message-Id: <20230626010635.129221-3-monego@posteo.net> In-Reply-To: <20230626010635.129221-1-monego@posteo.net> References: <20230626010635.129221-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-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1687741698; a=rsa-sha256; cv=none; b=CuZyC5yB3/lpLkJLj5DFfLut0FEtrcfHzNFDVMWiNLgi2rIoX0uECqvtEUwqaqwU97s5FO aJLRvDWnR9V1P2URB65tjBdAI3W440sSortRqpqriW5pXNIlNJIyp6G2lULWMicDfOKEX4 jGmlLtVlOT+6qhm4/RteSrzOIZj51ny3kTWpX9HBNKuZfilGnmJbbb75L9+alESs/enuNK rzMJsb/PEu82va3tftcgcgJEChwhhc7b8NKftxLlmjaRJTnDGarhfUw+j3SQ0WmsKny5ne umEHNhMMTQsjia1lbSX9lWg/4y7w6rg/lrxrf+Z/i663T5bioNMJ0Z4zf563rA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=CA2e7bHq; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1687741698; 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=zr50aF2LH0w4SVlmEWL81DmeUnl5gQcpZITXzs8nmRU=; b=cLirWurDo1FgAfel0pNjBUC+uXFiTiq1EwxzJDgf4CuyhtrDOJzovRpVnKbSIO1Kolm+ij NKdLEPS13bso4VAXN0GhE2ZzWAugOuey3Zwn/fY93fzOE8cTi4Afqz0BN+aTlkCI993Mu8 SQeko+NDoa+NO9o69fUw7LDNPma0bR9HLWgg4Smnqsag1TovE4Qi8mS7PH6qr4Oz8/b/rv rZhTpF42ZuHgTeRhz7Kh08CihhwbBBckpUr/Ns8X7Oe80sNugCtpX6RuLsMJ1N88IJ2D+A 6HVejxjMtarjrmx3cN0B/7dUHYLz5UyZvS8ukLKE7NW3iMPsWxj7qklcAvQ3pA== Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=CA2e7bHq; dmarc=fail reason="SPF not aligned (strict)" header.from=posteo.net (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: -1.65 X-Spam-Score: -1.65 X-Migadu-Queue-Id: 4733915F70 X-TUID: qdcGVef5U4kU * gnu/packages/machine-learning.scm (python-lightgbm): New variable. --- Removed symlinks in favor of substituting lib_path. gnu/packages/machine-learning.scm | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 17de467f46..bba89d789d 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1839,6 +1839,45 @@ (define-public lightgbm @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 + (list #:configure-flags #~(list "--precompile") ; use our library + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'preparations + (lambda _ + (setenv "HOME" "/tmp") ; to write a log file + (rename-file "python-package/setup.py" "setup.py") + (rename-file "python-package/README.rst" "README.rst") + (rename-file "python-package/lightgbm" "lightgbm") + ;; Write the version so the module identifies it. + (with-output-to-file "lightgbm/VERSION.txt" + (lambda () (display #$(package-version lightgbm)))) + ;; Manually install the lib. + (substitute* "setup.py" + (("'install_lib': CustomInstallLib,") "")) + ;; Change lib_path to look for our package's lib. + (substitute* "lightgbm/libpath.py" + (("lib_path = \\[str\\(p\\) for p in dll_path if p\\.is_file\\(\\)]") + ;; lib_path is a list of paths. + (format #f "lib_path = ['~a/lib/lib_lightgbm.so']" + #$(this-package-input "lightgbm")))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python" "-m" "pytest" + "tests/python_package_test"))))))) + (native-inputs (list python-psutil python-pytest python-wheel)) + (inputs (list lightgbm)) + (propagated-inputs (list python-numpy python-pandas python-scikit-learn + python-scipy)) + (synopsis "Python interface for LightGBM"))) + (define-public vowpal-wabbit ;; Language bindings not included. (package -- 2.34.1