~ruther/guix-local

ee5eb416dd374dee4c03599b6967b3129e269293 — Sharlatan Hellseher 8 months ago 349cda4
gnu: python-cython-0: Update to 0.29.37.

* gnu/packages/python-xyz.scm (python-cython-0): Update to 0.29.37.
  Use G-expressions.
  [build-system]: Inherit pyproject form python-cython.
  [arguments] <test-backend>: Use 'custom; <test-flags>: Utilize it
  instead of overwriting 'check phase.
  <phases>: Add 'pre-check; use default 'check.
  [inputs]: Inherit from python-cython.
  [native-inputs]: Likewise.
  [home-page]: Likewise.
  [synopsis]: Likewise.
  [description]: Likewise.

Change-Id: I97e8662f0a53aa9bc702b835a347900c7ebd5ea1
1 files changed, 32 insertions(+), 43 deletions(-)

M gnu/packages/python-xyz.scm
M gnu/packages/python-xyz.scm => gnu/packages/python-xyz.scm +32 -43
@@ 10158,55 10158,44 @@ writing C extensions for Python as easy as Python itself.")
(define-public python-cython-0
  (package
    (inherit python-cython)
    (version "0.29.32")
    ;; It's the latest version of 0.29. See
    ;; <https://github.com/cython/cython/blob/0.29.37/CHANGES.rst>.
    (version "0.29.37")
    (source
     (origin
       (method url-fetch)
       (uri (pypi-uri "Cython" version))
       (sha256
        (base32 "1xqsihpqnfal29nb5kmw8z71nd4jbsnbz7p3lkr094xpb13wycw7"))))
    (build-system python-build-system)
    ;; we need the full python package and not just the python-wrapper
    ;; because we need libpython3.3m.so
    (inputs
     (list python))
    (native-inputs
     ;; Needed for some tests that link against it.
     (list libxcrypt))
        (base32 "1ysca2r23h12ai9wrym4ci0nvgwm3lfijrpj9xfyxbclvnkd84zq"))))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-before 'check 'set-HOME
           ;; some tests require access to "$HOME/.cython"
           (lambda _ (setenv "HOME" "/tmp")))
         (replace 'check
           (lambda* (#:key tests? #:allow-other-keys)
             ;; Disable compiler optimizations to greatly reduce the running
             ;; time of the test suite.
             (setenv "CFLAGS" "-O0")

             (when tests?
               (invoke "python" "runtests.py" "-vv"
                       "-j" (number->string (parallel-job-count))
                       ;; XXX: On 32-bit architectures, running the parallel tests
                       ;; fails on many-core systems, see
                       ;; <https://github.com/cython/cython/issues/2807>.
                       ,@(if (not (target-64bit?))
                             '("-x" "run.parallel")
                             '())
                       ,@(if (system-hurd?)
                             '("-x" "test_class_ref"
                               "-x" "test_compiler_directives"
                               "-x" "test_lang_version")
                             '())
                       ;; This test fails when running on 24 cores.
                       "-x" "cpp_stl_conversion")))))))
    (home-page "https://cython.org/")
    (synopsis "C extensions for Python")
    (description "Cython is an optimising static compiler for both the Python
programming language and the extended Cython programming language.  It makes
writing C extensions for Python as easy as Python itself.")
    (license license:asl2.0)))
     (list
      #:test-backend #~'custom
      #:test-flags
      #~(list "runtests.py"
              "-vv"
              "-j" (number->string (parallel-job-count))
              ;; XXX: On 32-bit architectures, running the parallel tests
              ;; fails on many-core systems, see
              ;; <https://github.com/cython/cython/issues/2807>.
              #$@(if (not (target-64bit?))
                     #~("-x" "run.parallel")
                     #~())
              #$@(if (system-hurd?)
                     #~("-x" "test_class_ref"
                        "-x" "test_compiler_directives"
                        "-x" "test_lang_version")
                     #~())
              ;; This test fails when running on 24 cores.
              "-x" "cpp_stl_conversion")
      #:phases
      #~(modify-phases %standard-phases
          (add-before 'check 'pre-check
            ;; some tests require access to "$HOME/.cython"
            (lambda _
              (setenv "HOME" "/tmp")
              ;; Disable compiler optimizations to greatly reduce the running
              ;; time of the test suite.
              (setenv "CFLAGS" "-O0"))))))))

;; Needed for scipy and numpy
(define-public python-cython-0.29.35