guix_mirror_bot pushed a commit to branch python-team
in repository guix.

commit 3cf41478f42ed730945308abe4edaa1b8d15ce81
Author: Sharlatan Hellseher <[email protected]>
AuthorDate: Fri Jan 9 21:34:39 2026 +0000

    gnu: python-cylp: Update to 0.94.0.
    
    * gnu/packages/maths.scm (python-cylp): Update to 0.94.0.
    [arguments] <test-flags>: Rework skipped/ignored tests.
    <phases>: Add 'numpy-compatibility.'
    [propagated-inputs]: Remove python-pytest.
    [native-inputs]: Remove python-hypothesis, python-numpy, and
    python-wheel.
    
    Fixes: guix/guix#2912
    Change-Id: Ifa466f6f0d0a1cdc3723d60a57ddeafca61dff99
---
 gnu/packages/maths.scm | 69 ++++++++++++++++++++++++++++++++------------------
 1 file changed, 45 insertions(+), 24 deletions(-)

diff --git a/gnu/packages/maths.scm b/gnu/packages/maths.scm
index b249590b70..c87127c2d9 100644
--- a/gnu/packages/maths.scm
+++ b/gnu/packages/maths.scm
@@ -3070,41 +3070,62 @@ and quadratic objectives using the Simplex algorithm.")
 (define-public python-cylp
   (package
     (name "python-cylp")
-    (version "0.92.3")
+    (version "0.94.0")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "cylp" version))
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/coin-or/cylp";)
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "1mhvjrhvpgnpw4zwri92dj168qvyclcpsqvzbj5maxx5cilnhkww"))))
+        (base32 "0rgqmwvmpdzl6ygwy3nm33vpphl2ldzpqj0xakh9hg1ccaa3fs6l"))))
     (build-system pyproject-build-system)
     (arguments
      (list
-      #:test-flags #~(list "-k" (string-append
-                                 "not " (string-join
-                                         (list
-                                          "test_removeVar2" ; AssertionError
-                                          ;; Tests below segfault
-                                          "test_dantzig"
-                                          "test_lifo"
-                                          "test_mf"
-                                          "test_pe")
-                                         " and not ")))
+      ;; tests: 52 passed, 55 warnings
+      #:test-flags
+      ;; XXX: All tests in this file are SEGFAULT, see:
+      ;; <https://codeberg.org/guix/guix/issues/2912>.
+      #~(list "--ignore=cylp/py/test_PySolve.py"
+              "--ignore=cylp/tests/test_CyClpSimplex.py"
+              "--ignore=cylp/tests/test_QP.py"
+              ;; All tests are failed.
+              "--ignore=cylp/tests/test_MIP.py")
       #:phases
       #~(modify-phases %standard-phases
+          (add-after 'unpack 'numpy-compatibility
+            ;; XXX: See: <https://github.com/coin-or/CyLP/issues/227>.
+            ;;
+            ;; AttributeError: module 'numpy' has no attribute
+            ;; 'float'. `np.float` was a deprecated alias for the builtin
+            ;; `float`. To avoid this error in existing code, use `float` by
+            ;; itself. Doing this will not modify any behavior and is safe. If
+            ;; you specifically wanted the numpy scalar type, use `np.float64`
+            ;; here. The aliases was originally deprecated in NumPy 1.20; for
+            ;; more details and guidance see the original release note at:
+            ;; https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
+            (lambda _
+              (substitute* '("cylp/py/utils/sparseUtil.py"
+                             "cylp/tests/test_sparseUtil.py")
+                (("np.float") "float"))))
+          ;; XXX: Adding "--pyargs" option, changing test directory, and
+          ;; removing local source did not work; rebuilding extensions takes
+          ;; some time but it's only thing which worked to enable tests.
           (add-before 'check 'pre-check
             (lambda* (#:key tests? #:allow-other-keys)
-              (if tests? ; rebuild extensions
+              (if tests?
                   (invoke "python" "setup.py" "build_ext" "--inplace")))))))
-    (propagated-inputs (list python-numpy python-pytest python-scipy))
-    (inputs (list cbc))
-    (native-inputs (list pkg-config
-                         python-cython
-                         python-hypothesis
-                         python-numpy
-                         python-pytest
-                         python-setuptools
-                         python-wheel))
+    (native-inputs
+     (list pkg-config
+           python-cython
+           python-pytest
+           python-setuptools))
+    (inputs
+     (list cbc))
+    (propagated-inputs
+     (list python-numpy
+           python-scipy))
     (home-page "https://github.com/coin-or/cylp";)
     (synopsis "Python interface for CLP, CBC, and CGL")
     (description

Reply via email to