unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* [bug#29795] [PATCH 1/2] gnu: python-numpy: reorganize patches
@ 2017-12-20 16:18 Konrad Hinsen
  2017-12-23 21:57 ` Danny Milosavljevic
  2017-12-23 22:01 ` bug#29795: " Danny Milosavljevic
  0 siblings, 2 replies; 3+ messages in thread
From: Konrad Hinsen @ 2017-12-20 16:18 UTC (permalink / raw)
  To: 29795

Divide the (misnamed) build step 'set-environment-variables,
which applies patches to various files, into two build steps:

 'configure-blas-lapack  to patch site.cfg
 'fix-executable-paths to use executables from the store

This makes it easier to define variants (such as python-numpy-1.8,
or variants using a different BLAS/LAPACK implementation)
because only 'configure-blas-lapack needs to be redefined.

There is no impact on the result of the build. Only packages that inherit
from python-numpy could be affected, i.e. python-numpy-next and the Python 2
variants.
---
 gnu/packages/python.scm | 63 ++++++++++++++++++++++++++-----------------------
 1 file changed, 33 insertions(+), 30 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 1a376e04d..e768b60ed 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -2619,12 +2619,12 @@ between language specification and implementation aspects.")
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-        (add-before 'build 'set-environment-variables
-         (lambda* (#:key inputs #:allow-other-keys)
-          (call-with-output-file "site.cfg"
-            (lambda (port)
-              (format port
-                      "[openblas]
+         (add-before 'build 'configure-blas-lapack
+           (lambda* (#:key inputs #:allow-other-keys)
+             (call-with-output-file "site.cfg"
+               (lambda (port)
+                 (format port
+                         "[openblas]
 libraries = openblas
 library_dirs = ~a/lib
 include_dirs = ~a/include
@@ -2635,30 +2635,33 @@ lapack_libs = lapack
 library_dirs = ~a/lib
 include_dirs = ~a/include
 "
-                      (assoc-ref inputs "openblas")
-                      (assoc-ref inputs "openblas")
-                      (assoc-ref inputs "lapack")
-                      (assoc-ref inputs "lapack"))))
-          ;; Make /gnu/store/...-bash-.../bin/sh the default shell, instead of
-          ;; /bin/sh.
-          (substitute* "numpy/distutils/exec_command.py"
-            (("(os.environ.get\\('SHELL', ')(/bin/sh'\\))" match match-start match-end)
-            (string-append match-start (assoc-ref inputs "bash") match-end)))
-          ;; Use "gcc" executable, not "cc".
-          (substitute* "numpy/distutils/system_info.py"
-            (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
-             "c = distutils.ccompiler.new_compiler(); c.set_executables(compiler='gcc',compiler_so='gcc',linker_exe='gcc',linker_so='gcc -shared')"))
-          #t))
-        ;; Tests can only be run after the library has been installed and not
-        ;; within the source directory.
-        (delete 'check)
-        (add-after 'install 'check
-         (lambda* (#:key outputs inputs #:allow-other-keys)
-           ;; Make installed package available for running the tests
-           (add-installed-pythonpath inputs outputs)
-           (with-directory-excursion "/tmp"
-             (zero? (system* "python" "-c"
-                             "import numpy; numpy.test(verbose=2)"))))))))
+                         (assoc-ref inputs "openblas")
+                         (assoc-ref inputs "openblas")
+                         (assoc-ref inputs "lapack")
+                         (assoc-ref inputs "lapack"))))
+             #t))
+         (add-before 'build 'fix-executable-paths
+           (lambda* (#:key inputs #:allow-other-keys)
+             ;; Make /gnu/store/...-bash-.../bin/sh the default shell,
+             ;; instead of /bin/sh.
+             (substitute* "numpy/distutils/exec_command.py"
+               (("(os.environ.get\\('SHELL', ')(/bin/sh'\\))" match match-start match-end)
+                (string-append match-start (assoc-ref inputs "bash") match-end)))
+             ;; Use "gcc" executable, not "cc".
+             (substitute* "numpy/distutils/system_info.py"
+               (("c = distutils\\.ccompiler\\.new_compiler\\(\\)")
+                "c = distutils.ccompiler.new_compiler(); c.set_executables(compiler='gcc',compiler_so='gcc',linker_exe='gcc',linker_so='gcc -shared')"))
+             #t))
+         ;; Tests can only be run after the library has been installed and not
+         ;; within the source directory.
+         (delete 'check)
+         (add-after 'install 'check
+           (lambda* (#:key outputs inputs #:allow-other-keys)
+             ;; Make installed package available for running the tests
+             (add-installed-pythonpath inputs outputs)
+             (with-directory-excursion "/tmp"
+               (zero? (system* "python" "-c"
+                               "import numpy; numpy.test(verbose=2)"))))))))
     (home-page "http://www.numpy.org/")
     (synopsis "Fundamental package for scientific computing with Python")
     (description "NumPy is the fundamental package for scientific computing
-- 
2.14.3 (Apple Git-98)

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#29795] [PATCH 1/2] gnu: python-numpy: reorganize patches
  2017-12-20 16:18 [bug#29795] [PATCH 1/2] gnu: python-numpy: reorganize patches Konrad Hinsen
@ 2017-12-23 21:57 ` Danny Milosavljevic
  2017-12-23 22:01 ` bug#29795: " Danny Milosavljevic
  1 sibling, 0 replies; 3+ messages in thread
From: Danny Milosavljevic @ 2017-12-23 21:57 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 29795

I get a test failure:

FAIL: test_scripts.test_f2py
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/gnu/store/341qa9zyviccnwvkw3yb67yligjvizb9-python-nose-1.3.7/lib/python3.5/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/gnu/store/hqgh0ph6994lwfsn6f1lg5r8rg7jpyg1-python-numpy-1.12.0/lib/python3.5/site-packages/numpy/testing/decorators.py", line 147, in skipper_func
    return f(*args, **kwargs)
  File "/gnu/store/hqgh0ph6994lwfsn6f1lg5r8rg7jpyg1-python-numpy-1.12.0/lib/python3.5/site-packages/numpy/tests/test_scripts.py", line 93, in test_f2py
    assert_(success, msg)
  File "/gnu/store/hqgh0ph6994lwfsn6f1lg5r8rg7jpyg1-python-numpy-1.12.0/lib/python3.5/site-packages/numpy/testing/utils.py", line 110, in assert_
    raise AssertionError(smsg)
AssertionError: Warning: neither f2py nor f2py3 nor f2py3.5 found in path

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#29795: [PATCH 1/2] gnu: python-numpy: reorganize patches
  2017-12-20 16:18 [bug#29795] [PATCH 1/2] gnu: python-numpy: reorganize patches Konrad Hinsen
  2017-12-23 21:57 ` Danny Milosavljevic
@ 2017-12-23 22:01 ` Danny Milosavljevic
  1 sibling, 0 replies; 3+ messages in thread
From: Danny Milosavljevic @ 2017-12-23 22:01 UTC (permalink / raw)
  To: Konrad Hinsen; +Cc: 29795-done

Nevermind, test failure was there before.

Applied to master as e144cbcf850adca4cac8a4548632add1dc738219 after some fixes to the commit message.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-12-23 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-20 16:18 [bug#29795] [PATCH 1/2] gnu: python-numpy: reorganize patches Konrad Hinsen
2017-12-23 21:57 ` Danny Milosavljevic
2017-12-23 22:01 ` bug#29795: " Danny Milosavljevic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).