From patchwork Fri May 30 17:34:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Wiktor_=C5=BBelazny?= X-Patchwork-Id: 42953 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 40CDE27BC4A; Fri, 30 May 2025 18:37:28 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 49E6727BC49 for ; Fri, 30 May 2025 18:37:26 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uL3fE-00034N-Sn; Fri, 30 May 2025 13:37: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 1uL3fC-00033d-Rg for guix-patches@gnu.org; Fri, 30 May 2025 13:37:02 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1uL3fC-00044a-IO for guix-patches@gnu.org; Fri, 30 May 2025 13:37:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=dVkOklwmK/J6ccvSMuVjpJoRnc9sBm1OjmDj9e9fW0E=; b=Y/hKNWRkfb5t4tXrLpV1uD2jhIkFh802f6Y3CCcxLNDHYrVxFQKtx97+9nMRWikul6ia2pMYtXyGK+ypmadCvxGZTSygKJ7mAIPPHoXyrP9GpSh+AcWJ8xXOxjRSCaOoercBuB5ROB2z1mKbGruQMPWPzNtg0u9ZFWUFUR8xpzTNSgnddCwjtM3X5Uj8wWf252YmCBjuq8U9Q9L8ULL4+h1sbSamrgJXjuWoyuOoobGw2rdo35Nzodyqbclc2mUQVzff7Al6VvARKqOcX3WhqTZSjdTqMKCGy+wZbu13KHUYJihpAD+DJXuapyoTpyunZOjcJaHOCzD7RtKu/Bnv7g==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uL3fC-0006g1-E0 for guix-patches@gnu.org; Fri, 30 May 2025 13:37:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78443] [PATCH v2] gnu: python-pulp: Update to 3.1.1. References: <20250515134532.3543-1-wz@freeshell.de> In-Reply-To: <20250515134532.3543-1-wz@freeshell.de> Resent-From: Wiktor =?utf-8?q?=C5=BBelazny?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 30 May 2025 17:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 78443 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78443@debbugs.gnu.org Received: via spool by 78443-submit@debbugs.gnu.org id=B78443.174862658725567 (code B ref 78443); Fri, 30 May 2025 17:37:02 +0000 Received: (at 78443) by debbugs.gnu.org; 30 May 2025 17:36:27 +0000 Received: from localhost ([127.0.0.1]:50305 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uL3ec-0006eG-Gk for submit@debbugs.gnu.org; Fri, 30 May 2025 13:36:27 -0400 Received: from freeshell.de ([116.202.128.144]:51002) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uL3eZ-0006dr-P6 for 78443@debbugs.gnu.org; Fri, 30 May 2025 13:36:24 -0400 Received: from localhost.localdomain (cst-prg-10-132.cust.vodafone.cz [46.135.10.132]) (Authenticated sender: wz) by freeshell.de (Postfix) with ESMTPSA id 5973CB4C3D6B for <78443@debbugs.gnu.org>; Fri, 30 May 2025 19:36:16 +0200 (CEST) From: Wiktor =?utf-8?q?=C5=BBelazny?= Date: Fri, 30 May 2025 19:34:28 +0200 Message-ID: <20250530173428.3882-1-wz@freeshell.de> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/python-xyz.scm (python-pulp-2.4): Copy from python-pulp. * gnu/packages/python-science.scm (snakemake): Use python-pulp-2.4. * gnu/packages/python-science.scm (snakemake-{5,6,7}): Use python-pulp-2.4. * gnu/packages/patches/python-pulp-exclude-solver-binaries.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. * gnu/packages/python-xyz.scm (python-pulp): Update to 3.1.1. [source]: Update the uri capitalization. [source]: Add a snippet for skipping a failing test. [source]: Apply the new patch. [build-system]: Change to pyproject-build-system. [native-inputs]: Add cbc, glpk, highs, python-setuptools, and python-wheel. [propagated-inputs]: Remove python-amply. [agruments]<#:phases>: Add a phase to remove solver binaries. [agruments]<#:phases>: Test using pulptest. [synopsis]: Change according to About in the code repository. [description]: Extend according to README.rst in the code repository. Change-Id: I41a7ea4066302d1195913815eb030c45dec9014d --- gnu/local.mk | 1 + .../python-pulp-exclude-solver-binaries.patch | 36 ++++++++++++++++ gnu/packages/python-science.scm | 8 ++-- gnu/packages/python-xyz.scm | 42 +++++++++++++++++++ 4 files changed, 83 insertions(+), 4 deletions(-) create mode 100644 gnu/packages/patches/python-pulp-exclude-solver-binaries.patch base-commit: b750d54703d849fe58dcacf94f23d34ab85b23a2 diff --git a/gnu/local.mk b/gnu/local.mk index f534768c2de..424a8d92f1d 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2028,6 +2028,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-matplotlib-fix-legend-loc-best-test.patch \ %D%/packages/patches/python-random2-getrandbits-test.patch \ %D%/packages/patches/python-pillow-use-zlib-1.3.patch \ + %D%/packages/patches/python-pulp-exclude-solver-binaries.patch \ %D%/packages/patches/python-pydocstyle-add-support-for-pep701.patch \ %D%/packages/patches/python-pyreadstat-link-libiconv.patch \ %D%/packages/patches/python-sip-include-dirs.patch \ diff --git a/gnu/packages/patches/python-pulp-exclude-solver-binaries.patch b/gnu/packages/patches/python-pulp-exclude-solver-binaries.patch new file mode 100644 index 00000000000..57e9a1421b0 --- /dev/null +++ b/gnu/packages/patches/python-pulp-exclude-solver-binaries.patch @@ -0,0 +1,36 @@ +This patch excludes solver binary executables that the project uses for +testing. In the package definition, solvers are provided as native inputs, +instead. + +This is an original patch. It was not submitted upstream. + +diff --git a/pyproject.toml b/pyproject.toml +index 82f9d48..0925858 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -61,26 +61,11 @@ dev = [ + [tool.setuptools] + packages = [ + "pulp", +- "pulp.solverdir", +- "pulp.solverdir.cbc.linux.i32", +- "pulp.solverdir.cbc.linux.i64", +- "pulp.solverdir.cbc.linux.arm64", +- "pulp.solverdir.cbc.win.i32", +- "pulp.solverdir.cbc.win.i64", +- "pulp.solverdir.cbc.osx.i64", + "pulp.apis", + "pulp.tests"] + # This is a workaround for https://github.com/astral-sh/uv/issues/9513 + license-files = [] + +-[tool.setuptools.package-data] +-"pulp.solverdir.cbc.linux.i32"= ["*", "*.*"] +-"pulp.solverdir.cbc.linux.i64"= ["*", "*.*"] +-"pulp.solverdir.cbc.linux.arm64"= ["*", "*.*"] +-"pulp.solverdir.cbc.win.i32"= ["*", "*.*"] +-"pulp.solverdir.cbc.win.i64"= ["*", "*.*"] +-"pulp.solverdir.cbc.osx.i64"= ["*", "*.*"] +- + [project.scripts] + pulptest = "pulp.tests.run_tests:pulpTestAll" diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 376ae67570c..fdfa88c56c7 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -4976,7 +4976,7 @@ (define-public snakemake python-nbformat python-packaging python-psutil - python-pulp + python-pulp-2.4 ;https://github.com/snakemake/snakemake/issues/2607 python-pyyaml python-requests python-reretry @@ -5068,7 +5068,7 @@ (define-public snakemake-5 python-nbformat python-networkx python-psutil - python-pulp + python-pulp-2.4 ;https://github.com/snakemake/snakemake/issues/2607 python-pyyaml python-ratelimiter python-requests @@ -5155,7 +5155,7 @@ (define-public snakemake-6 python-nbformat python-networkx python-psutil - python-pulp + python-pulp-2.4 ;https://github.com/snakemake/snakemake/issues/2607 python-pyyaml python-py-tes python-ratelimiter @@ -5253,7 +5253,7 @@ (define-public snakemake-7 python-nbformat python-networkx python-psutil - python-pulp + python-pulp-2.4 ;https://github.com/snakemake/snakemake/issues/2607 python-pyyaml python-py-tes python-requests diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm index 0058c665e3d..090b534b368 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -15041,6 +15041,48 @@ (define-public python-amply (license license:epl1.0))) (define-public python-pulp + (package + (name "python-pulp") + (version "3.1.1") + (source + (origin + (method url-fetch) + (uri (pypi-uri "pulp" version)) + ;; https://github.com/coin-or/pulp/issues/832 + (modules '((guix build utils))) + (snippet '(substitute* "pulp/tests/test_pulp.py" + ((" def test_time_limit_no_solution") + " @unittest.skip + def test_time_limit_no_solution"))) + (sha256 + (base32 "15bdjv0hpzg3lfbz25w16sf4h3gkpd4mhvysgynak73wj47362ih")) + (patches (search-patches "python-pulp-exclude-solver-binaries.patch")))) + (build-system pyproject-build-system) + (native-inputs (list cbc ;a solver for testing + glpk ;a solver for testing + highs ;a solver for testing + python-setuptools + python-wheel)) + (arguments + `(#:phases (modify-phases %standard-phases + (add-before 'build 'remove-solver-binaries + (lambda _ + (delete-file-recursively "pulp/solverdir/"))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (if tests? + (invoke "pulptest"))))))) + (home-page "https://github.com/coin-or/pulp") + (synopsis "Python Linear Programming API") + (description + "PuLP is an linear and mixed integer programming modeler written in +Python. With PuLP, it is simple to create MILP optimisation problems and solve +them with the latest open-source (or proprietary) solvers. PuLP can generate +MPS or LP files and call solvers such as GLPK, COIN-OR CLP/CBC, CPLEX, GUROBI, +MOSEK, XPRESS, CHOCO, MIPCL, HiGHS, SCIP/FSCIP.") + (license license:expat))) + +(define-public python-pulp-2.4 (package (name "python-pulp") (version "2.4")