From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id kD2lMmFGnWCsPwEAgWs5BA (envelope-from ) for ; Thu, 13 May 2021 17:31:45 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 4FlHLmFGnWCQTgAAbx9fmQ (envelope-from ) for ; Thu, 13 May 2021 15:31:45 +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 8910C1030E for ; Thu, 13 May 2021 17:31:45 +0200 (CEST) Received: from localhost ([::1]:41706 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lhDJQ-0006AM-Na for larch@yhetil.org; Thu, 13 May 2021 11:31:44 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52722) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lhDIl-000689-Ua for guix-patches@gnu.org; Thu, 13 May 2021 11:31:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:60825) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lhDIk-00020A-GZ for guix-patches@gnu.org; Thu, 13 May 2021 11:31:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lhDIk-0006Ud-DV for guix-patches@gnu.org; Thu, 13 May 2021 11:31:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48388] [PATCH v2 3/3] gnu: Add python-xgboost. Resent-From: Vinicius Monego Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 May 2021 15:31:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48388 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48388@debbugs.gnu.org Cc: Vinicius Monego Received: via spool by 48388-submit@debbugs.gnu.org id=B48388.162091980324794 (code B ref 48388); Thu, 13 May 2021 15:31:02 +0000 Received: (at 48388) by debbugs.gnu.org; 13 May 2021 15:30:03 +0000 Received: from localhost ([127.0.0.1]:44134 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhDHn-0006Rp-43 for submit@debbugs.gnu.org; Thu, 13 May 2021 11:30:03 -0400 Received: from mout01.posteo.de ([185.67.36.65]:53811) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lhDHk-0006Qf-75 for 48388@debbugs.gnu.org; Thu, 13 May 2021 11:30:01 -0400 Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id A8148240027 for <48388@debbugs.gnu.org>; Thu, 13 May 2021 17:29:54 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1620919794; bh=iiz3by/8gf5WVlxfI4zF9AzCCkl4pIAgHbiRUwVMG+k=; h=From:To:Cc:Subject:Date:From; b=H9S3E/r5Rh8XjtoZ6CHd0jf9pMFXT1tnVpg/K967VjqpaBIaEUUlego1SHc+Mdl0y AhjaT9zGaGtO6zqkHMDQ/4XnOlrTJvcMQ9mTfPY3PzoP4cXSu7/DnqEBwE2uvTgNC/ MD41l6Tocky8aUOWIX8emeKDmH2nIFpWTJ4q7gjcmz+YtjqBdji69wjDYPgLPx2fE4 NEB05ub2x3EBXv5saMXDJw0ZDF8CM10YQ80WXjqpY272idhC9D6GRUHwBjfkSMFmkH dptAAjPMhIznWaSl0V/akiG+E/p9CJJNBj/0UNtQz0J8SnnSoHMxtzBZykosqmDW5G d3C8V2KM/DgXw== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4FgwZT2s1Jz9rxP; Thu, 13 May 2021 17:29:53 +0200 (CEST) From: Vinicius Monego Date: Thu, 13 May 2021 15:29:14 +0000 Message-Id: <20210513152914.573837-2-monego@posteo.net> In-Reply-To: <20210513152914.573837-1-monego@posteo.net> References: <20210513152914.573837-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=1620919905; 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=ww+/bRyIEkSI798XsNMZ55r5AWpaNi7jT2rqTljStKM=; b=a2hJDhiXmTANFDCuKvqbk1Jhv3yH450O8gEWbtO1JOAdhgPCFoAy0g/Sm8EgT3iZpjMejj LB6D3QoGR3X2HaevPAF1fPVwKzvTF8xKuC1shxte4/tX1k3z1p8f2wPIjIopDXDZghL+i4 xOm/uFwUwsxMZIFyGlDaivUyVjPB2DYxCIx7yMDlyjWFFuTD5XLCTUIerpKCww9dWmr1PN dSVHydRMbCMNdo0w355xrwKIOiqCXcX2mMT9xoRLAeaE+sCugmJwtEDnNeDstOgYOBiTi9 ddu6Gfsc1Bh/vdZg/TFm49+E7pHTU4JMR8G3NxKI3fhJajRH4lEna4kZmwd6fQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620919905; a=rsa-sha256; cv=none; b=NiWHBvbfZCXLX8Dub7IgyHiHSJ4cmOLbRA8H0AV/LVNJhepLSoVbc/Im0AsS7tP9eScVxU MRYyCrNhhyRKQF/16iQxcSaLJae+WZKWUONfNo/1UmwtVaEZd/9y/Y8lYPfSIM23/xa6Zw VZr8vglsdUxQl5sm7ccPgQRvHP6wgDmfVL1cRC8uzBjE3F0FsyCtpFxPGkjX0a0E3yba6n Nc72GiT8hExokUOs49wf0cDgJ8qf4nlAH2Tv/1IAAhpR6ZutnIfd7ryQ/t6lmTh6V8HGuw En7hthVU9F6GGfmQ5VzTq5F1Xq9KhaxaH3Fy5LiuXEAg1HW4bmYvStzeORkWaw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b="H9S3E/r5"; 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.65 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b="H9S3E/r5"; 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: 8910C1030E X-Spam-Score: 3.65 X-Migadu-Scanner: scn0.migadu.com X-TUID: 884NzRuKT8n/ * gnu/packages/machine-learning.scm (python-xgboost): New variable. --- Added (when tests?) in check phase to allow --without-tests. gnu/packages/machine-learning.scm | 62 +++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index d81370797f..ead47a534a 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -1992,6 +1992,68 @@ tree boosting (also known as GBDT, GBM) that solve many data science problems in a fast and accurate way.") (license license:asl2.0))) +(define-public python-xgboost + (package + (inherit xgboost) + (name "python-xgboost") + (build-system python-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (add-after 'unpack 'preparations + (lambda* (#:key inputs #:allow-other-keys) + ;; Move python-package content to parent directory to silence + ;; some warnings about files not being found if we chdir. + (rename-file "python-package/xgboost" "xgboost") + (rename-file "python-package/README.rst" "README.rst") + (rename-file "python-package/setup.cfg" "setup.cfg") + (rename-file "python-package/setup.py" "setup.py") + + (with-directory-excursion "xgboost" + ;; Version is read from a VERSION file, but that file is not + ;; part of the installation. + (substitute* "__init__.py" + (("__version__ = ''") + (string-append "__version__ = " "'" + ,(package-version xgboost) "'"))) + ;; The Python wrapper expects libxgboost to be found in the + ;; same source from where the wrapper builds. This workaround + ;; allows libxgboost to be used from the xgboost package. + (substitute* "libpath.py" + (("XGBOOST_PATH = ''") + (string-append "XGBOOST_PATH = " + "'" (assoc-ref inputs "xgboost") "'")))) + #t)) + (replace 'check + ;; Python-specific tests are located in tests/python. + (lambda* (#:key inputs outputs tests? #:allow-other-keys) + (when tests? + (add-installed-pythonpath inputs outputs) + (invoke "pytest" "tests/python" + ;; FIXME: CLI tests fail with PermissionError. + "--ignore" "tests/python/test_cli.py" "-k" + (string-append + "not test_cli_regression_demo" + ;; The tests below open a network connection. + " and not test_model_compatibility" + " and not test_get_group" + " and not test_cv_no_shuffle" + " and not test_cv" + " and not test_training" + ;; "'['./runexp.sh']' returned non-zero exit status 1" + " and not test_cli_binary_classification"))) + #t))))) + (native-inputs + `(("python-pandas" ,python-pandas) + ("python-pytest" ,python-pytest) + ("python-scikit-learn" ,python-scikit-learn))) + (inputs + `(("xgboost" ,xgboost))) + (propagated-inputs + `(("python-numpy" ,python-numpy) + ("python-scipy" ,python-scipy))) + (synopsis "Python interface for the XGBoost library"))) + (define-public python-iml (package (name "python-iml") -- 2.31.1