From patchwork Thu May 15 13:45:32 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: 42628 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 64FD727BC4B; Thu, 15 May 2025 14:48:34 +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=ham 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 7472D27BC49 for ; Thu, 15 May 2025 14:48:33 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1uFYwP-0000LI-TL; Thu, 15 May 2025 09:48:06 -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 1uFYwN-0000K9-Qa for guix-patches@gnu.org; Thu, 15 May 2025 09:48:04 -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 1uFYwN-0006eR-Ao for guix-patches@gnu.org; Thu, 15 May 2025 09:48:03 -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:Subject; bh=yHTK8R+j2u0sOlQAjLYu0vyp8GpgSnxdomUG7ktlbkE=; b=EdLaJ1r6baGtyRTGGhHIwn/rvs24+w8dgKEXqgqadXkafjtAz6W58puHyDfrAiShB3jUd9GUgG57Dy2pWiccw+HjH9PmrL3TJsuWg0hcapZ7MXrE/XTYf7gB/Qgw9X1jeye44aJLdTXBeJGJcUGvL4WM9/f96d2Wpv1ScLY3cJdxxAsxZ5SxIYuVMpZ02n9Bk9fGqoaSdYprj27RC00gGsZvhduD4It+9oDOuHZRFOCNM1Z+70gHA/vvy61YzehKofWOgIUkTVTFvxMkU24MDk926EMIZYcPectVGYwG2B+veesKylNRwEhszSUvhGamy8xVjs/wcG6zn/66nrFYMQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1uFYwM-0001YQ-93 for guix-patches@gnu.org; Thu, 15 May 2025 09:48:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#78443] [PATCH] gnu: python-pulp: Update to 3.1.1. Resent-From: Wiktor =?utf-8?q?=C5=BBelazny?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 15 May 2025 13:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 78443 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 78443@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.17473168535908 (code B ref -1); Thu, 15 May 2025 13:48:02 +0000 Received: (at submit) by debbugs.gnu.org; 15 May 2025 13:47:33 +0000 Received: from localhost ([127.0.0.1]:52778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uFYvs-0001XD-PF for submit@debbugs.gnu.org; Thu, 15 May 2025 09:47:33 -0400 Received: from lists.gnu.org ([2001:470:142::17]:58692) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uFYvo-0001Wt-Ks for submit@debbugs.gnu.org; Thu, 15 May 2025 09:47:29 -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 1uFYvh-0008Mv-8f for guix-patches@gnu.org; Thu, 15 May 2025 09:47:22 -0400 Received: from freeshell.de ([2a01:4f8:231:482b::2]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uFYve-0006bT-7F for guix-patches@gnu.org; Thu, 15 May 2025 09:47:20 -0400 Received: from localhost.localdomain (cst-prg-25-66.cust.vodafone.cz [46.135.25.66]) (Authenticated sender: wz) by freeshell.de (Postfix) with ESMTPSA id B9B0EB4C1F0A for ; Thu, 15 May 2025 15:47:10 +0200 (CEST) From: Wiktor =?utf-8?q?=C5=BBelazny?= Date: Thu, 15 May 2025 15:45:32 +0200 Message-ID: <20250515134532.3543-1-wz@freeshell.de> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2a01:4f8:231:482b::2; envelope-from=wz@freeshell.de; helo=freeshell.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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/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: I1a0644da575da997f9d31cf9099d738e95d5f3a0 --- gnu/local.mk | 1 + .../python-pulp-exclude-solver-binaries.patch | 36 ++++++++++++++++ gnu/packages/python-xyz.scm | 42 ++++++++++++++----- 3 files changed, 68 insertions(+), 11 deletions(-) create mode 100644 gnu/packages/patches/python-pulp-exclude-solver-binaries.patch base-commit: ff50f88935f6d04664ad3c907a9bff62714668c6 diff --git a/gnu/local.mk b/gnu/local.mk index dfafe8b8953..0074805dd40 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2021,6 +2021,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-xyz.scm b/gnu/packages/python-xyz.scm index 5d0ac818398..923da91821d 100644 --- a/gnu/packages/python-xyz.scm +++ b/gnu/packages/python-xyz.scm @@ -15037,23 +15037,43 @@ (define-public python-amply (define-public python-pulp (package (name "python-pulp") - (version "2.4") + (version "3.1.1") (source (origin (method url-fetch) - (uri (pypi-uri "PuLP" version)) + (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 - "1dammrg0f1v0r028i3rpxbf2bsyxmjq0q6ihb4x2wsdki44z3bxj")))) - (build-system python-build-system) - (propagated-inputs - (list python-amply)) + (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 "Linear Programming modeler") + (synopsis "Python Linear Programming API") (description - "PuLP is a Linear Programming modeler written in Python. PuLP can -generate MPS or LP files and call GLPK, COIN CLP/CBC, CPLEX, and GUROBI to -solve linear problems.") + "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-py-partiql-parser