GNU bug report logs - #78443
[PATCH] gnu: python-pulp: Update to 3.1.1.

Previous Next

Package: guix-patches;

Reported by: Wiktor Żelazny <wz <at> freeshell.de>

Date: Thu, 15 May 2025 13:48:02 UTC

Severity: normal

Tags: patch

To reply to this bug, email your comments to 78443 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#78443; Package guix-patches. (Thu, 15 May 2025 13:48:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Wiktor Żelazny <wz <at> freeshell.de>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Thu, 15 May 2025 13:48:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Wiktor Żelazny <wz <at> freeshell.de>
To: guix-patches <at> gnu.org
Subject: [PATCH] gnu: python-pulp: Update to 3.1.1.
Date: Thu, 15 May 2025 15:45:32 +0200
* 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

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

base-commit: ff50f88935f6d04664ad3c907a9bff62714668c6
-- 
2.49.0





Information forwarded to guix-patches <at> gnu.org:
bug#78443; Package guix-patches. (Mon, 26 May 2025 16:57:01 GMT) Full text and rfc822 format available.

Message #8 received at 78443 <at> debbugs.gnu.org (full text, mbox):

From: Sharlatan Hellseher <sharlatanus <at> gmail.com>
To: 78443 <at> debbugs.gnu.org
Cc: wzelazny <at> vurv.cz
Subject: [PATCH] gnu: python-pulp: Update to 3.1.1.
Date: Mon, 26 May 2025 17:56:36 +0100
[Message part 1 (text/plain, inline)]
Hi,

Thanks for the patch.

After appling it snakemake <at> 5.32.2 has failed.

Please check with 'guix build -P1 python-pulp'
You might also may open a PR on <https://codeberg.org/guix/guix>

--
Oleg
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#78443; Package guix-patches. (Fri, 30 May 2025 17:37:02 GMT) Full text and rfc822 format available.

Message #11 received at 78443 <at> debbugs.gnu.org (full text, mbox):

From: Wiktor Żelazny <wz <at> freeshell.de>
To: 78443 <at> debbugs.gnu.org
Subject: [PATCH v2] gnu: python-pulp: Update to 3.1.1.
Date: Fri, 30 May 2025 19:34:28 +0200
* 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

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")

base-commit: b750d54703d849fe58dcacf94f23d34ab85b23a2
-- 
2.49.0





This bug report was last modified 6 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.