all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#48703] [PATCH 0/4] Update python-numpy
@ 2021-05-27 15:10 Greg Hogan
  2021-06-02 19:14 ` Xinglu Chen
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Greg Hogan @ 2021-05-27 15:10 UTC (permalink / raw)
  To: 48703


[-- Attachment #1.1: Type: text/plain, Size: 493 bytes --]

In March there were two attempts to update python-numpy (#45698 and #47183
/ #47184) which failed to build python-pandas and python-scipy.

The attached patches update and successfully build python-numpy,
python-pandas, python-matplotlib, and python-scipy.

In addition to modified dependencies, python-matplotlib expanded the regex
to silence image font differences and I was only able to successfully build
and test python-pandas when replacing python-openpyxl
with python-xlsxwriter.

Greg

[-- Attachment #1.2: Type: text/html, Size: 686 bytes --]

[-- Attachment #2: 0003-gnu-python-matplotlib-Update-to-3.4.2.patch --]
[-- Type: application/octet-stream, Size: 8717 bytes --]

From 6e8b2442f7d9884d66a8425bdf95fe81ae85e5df Mon Sep 17 00:00:00 2001
From: Greg Hogan <code@greghogan.com>
Date: Wed, 31 Mar 2021 17:06:20 +0000
Subject: [PATCH 3/4] gnu: python-matplotlib: Update to 3.4.2.

* gnu/packages/python-xyz.scm (python-matplotlib): Update to 3.4.2.
[source]: Update patches.
[propagated-inputs]: Add python-certifi, qhull.
[arguments]: Fix tests and config file newline formatting.
* gnu/packages/patches/python-matplotlib-fix-tests.patch: New file.
* gnu/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch:
Remove file.
* gnu/local.mk: Update list of patches.
---
 gnu/local.mk                                  |  2 +-
 .../patches/python-matplotlib-fix-tests.patch | 40 +++++++++++++++++++
 ...on-matplotlib-run-under-wayland-gtk3.patch | 31 --------------
 gnu/packages/python-xyz.scm                   | 21 ++++++----
 4 files changed, 54 insertions(+), 40 deletions(-)
 create mode 100644 gnu/packages/patches/python-matplotlib-fix-tests.patch
 delete mode 100644 gnu/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 8355a208ea..f7d2b1146b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1598,7 +1598,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/python-pyfakefs-remove-bad-test.patch	\
   %D%/packages/patches/python-flint-includes.patch		\
   %D%/packages/patches/python-libxml2-utf8.patch		\
-  %D%/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch	\
+  %D%/packages/patches/python-matplotlib-fix-tests.patch	\
   %D%/packages/patches/python-mediafile-wavpack.patch		\
   %D%/packages/patches/python-memcached-syntax-warnings.patch	\
   %D%/packages/patches/python-mox3-python3.6-compat.patch	\
diff --git a/gnu/packages/patches/python-matplotlib-fix-tests.patch b/gnu/packages/patches/python-matplotlib-fix-tests.patch
new file mode 100644
index 0000000000..d9622bab71
--- /dev/null
+++ b/gnu/packages/patches/python-matplotlib-fix-tests.patch
@@ -0,0 +1,40 @@
+Patch the tests to prevent the error "pytest ids must be list of strings, found: 0".
+
+The PyTest documentation states that "Numbers, strings, booleans and None will
+have their usual string representation used in the test ID. For other objects,
+pytest will make a string based on the argument name".
+
+https://docs.pytest.org/en/6.2.x/example/parametrize.html#different-options-for-test-ids
+
+--- a/lib/matplotlib/tests/test_mathtext.py
++++ b/lib/matplotlib/tests/test_mathtext.py
+@@ -184,8 +184,7 @@ def baseline_images(request, fontset, index, text):
+     return ['%s_%s_%02d' % (request.param, fontset, index)]
+ 
+ 
+-@pytest.mark.parametrize(
+-    'index, text', enumerate(math_tests), ids=range(len(math_tests)))
++@pytest.mark.parametrize('index, text', enumerate(math_tests))
+ @pytest.mark.parametrize(
+     'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif'])
+ @pytest.mark.parametrize('baseline_images', ['mathtext'], indirect=True)
+@@ -197,8 +196,7 @@ def test_mathtext_rendering(baseline_images, fontset, index, text):
+              horizontalalignment='center', verticalalignment='center')
+ 
+ 
+-@pytest.mark.parametrize('index, text', enumerate(lightweight_math_tests),
+-                         ids=range(len(lightweight_math_tests)))
++@pytest.mark.parametrize('index, text', enumerate(lightweight_math_tests))
+ @pytest.mark.parametrize('fontset', ['dejavusans'])
+ @pytest.mark.parametrize('baseline_images', ['mathtext1'], indirect=True)
+ @image_comparison(baseline_images=None, extensions=['png'])
+@@ -208,8 +206,7 @@ def test_mathtext_rendering_lightweight(baseline_images, fontset, index, text):
+              horizontalalignment='center', verticalalignment='center')
+ 
+ 
+-@pytest.mark.parametrize(
+-    'index, text', enumerate(font_tests), ids=range(len(font_tests)))
++@pytest.mark.parametrize('index, text', enumerate(font_tests))
+ @pytest.mark.parametrize(
+     'fontset', ['cm', 'stix', 'stixsans', 'dejavusans', 'dejavuserif'])
+ @pytest.mark.parametrize('baseline_images', ['mathfont'], indirect=True)
diff --git a/gnu/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch b/gnu/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch
deleted file mode 100644
index 6f067763b5..0000000000
--- a/gnu/packages/patches/python-matplotlib-run-under-wayland-gtk3.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From: Tobias Geerinckx-Rice <me@tobias.gr>
-Date: Tue, 02 Mar 2021 18:04:33 +0100
-Subject: [PATCH] gnu: python-matplotlib: Run under Wayland with GTK3.
-
-Adopted from upstream's fix[0] for
-<https://github.com/matplotlib/matplotlib/issues/19405>.
-
-[0]: https://github.com/liuyun88/matplotlib/commit/3d5000463bd23cb046681220f5511f07743f7d82
-
----
-diff -Naur a/lib/matplotlib/backends/backend_gtk3.py b/lib/matplotlib/backends/backend_gtk3.py
---- a/lib/matplotlib/backends/backend_gtk3.py	2019-11-21 23:47:05.000000000 +0100
-+++ b/lib/matplotlib/backends/backend_gtk3.py	2021-03-02 18:00:57.479929766 +0100
-@@ -42,11 +42,12 @@
- 
- try:
-+    _display = Gdk.Display.get_default()
-     cursord = {
--        cursors.MOVE          : Gdk.Cursor.new(Gdk.CursorType.FLEUR),
--        cursors.HAND          : Gdk.Cursor.new(Gdk.CursorType.HAND2),
--        cursors.POINTER       : Gdk.Cursor.new(Gdk.CursorType.LEFT_PTR),
--        cursors.SELECT_REGION : Gdk.Cursor.new(Gdk.CursorType.TCROSS),
--        cursors.WAIT          : Gdk.Cursor.new(Gdk.CursorType.WATCH),
-+        cursors.MOVE          : Gdk.Cursor.new_from_name(_display, "move"),
-+        cursors.HAND          : Gdk.Cursor.new_from_name(_display, "pointer"),
-+        cursors.POINTER       : Gdk.Cursor.new_from_name(_display, "default"),
-+        cursors.SELECT_REGION : Gdk.Cursor.new_from_name(_display, "crosshair"),
-+        cursors.WAIT          : Gdk.Cursor.new_from_name(_display, "wait"),
-     }
- except TypeError as exc:
-     # Happens when running headless.  Convert to ImportError to cooperate with
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 2d3be5e4fb..224a4bc8a1 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -5477,18 +5477,19 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
 (define-public python-matplotlib
   (package
     (name "python-matplotlib")
-    (version "3.1.2")
+    (version "3.4.2")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "matplotlib" version))
        (sha256
-        (base32 "1nmshfqh7wyg15i16hx1yiylcvzkws29ivn66n3i0wyqwcpjr3lf"))
+        (base32 "0682x8k8zs9pf7wwp1dcri5dn6i1ypj3vsv6a6jap6pzzp799nfq"))
        (patches
-        (search-patches "python-matplotlib-run-under-wayland-gtk3.patch"))))
+        (search-patches "python-matplotlib-fix-tests.patch"))))
     (build-system python-build-system)
     (propagated-inputs ; the following packages are all needed at run time
-     `(("python-cycler" ,python-cycler)
+     `(("python-certifi" ,python-certifi)
+       ("python-cycler" ,python-cycler)
        ("python-kiwisolver" ,python-kiwisolver)
        ("python-pyparsing" ,python-pyparsing)
        ("python-pygobject" ,python-pygobject)
@@ -5510,6 +5511,7 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
        ("freetype" ,freetype)
        ("cairo" ,cairo)
        ("glib" ,glib)
+       ("qhull", qhull)
        ;; FIXME: Add backends when available.
        ;("python-wxpython" ,python-wxpython)
        ("tcl" ,tcl)
@@ -5540,7 +5542,7 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
                                               "test_.*\\.py$"))
                (("^from matplotlib" match)
                 (string-append "import pytest\n" match))
-               (("( *)@image_comparison" match indent)
+               (("( *)(@(mpl3d_)?image_comparison|def test_get_tightbbox_polar)" match indent)
                 (string-append indent
                                "@pytest.mark.skip(reason=\"unknown minor image differences\")\n"
                                match)))
@@ -5589,10 +5591,13 @@ convert between colorspaces like sRGB, XYZ, CIEL*a*b*, CIECAM02, CAM02-UCS, etc.
                  (setenv "CFLAGS" "-ffloat-store"))
                (call-with-output-file "setup.cfg"
                  (lambda (port)
-                   (format port "[directories]~%
+                   (format port "[directories]
 basedirlist = ~a,~a~%
-[packages]~%
-tests = True~%"
+[packages]
+tests = True~%
+[libs]
+system_freetype = true
+system_qhull = true~%"
                         (assoc-ref inputs "tcl")
                         (assoc-ref inputs "tk")))))
              #t)))))
-- 
2.31.1


[-- Attachment #3: 0001-gnu-python-numpy-Update-to-1.20.3.patch --]
[-- Type: application/octet-stream, Size: 1761 bytes --]

From 399fbe444364f0b2fc7aa3335d5c69ead2918ba7 Mon Sep 17 00:00:00 2001
From: Greg Hogan <code@greghogan.com>
Date: Sun, 14 Mar 2021 15:40:41 +0000
Subject: [PATCH 1/4] gnu: python-numpy: Update to 1.20.3.

* gnu/packages/python-xyz.scm (python-numpy): Update to 1.20.3.
[native-inputs]: Add python-hypothesis.
---
 gnu/packages/python-xyz.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index 770beb0336..2d3be5e4fb 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -100,6 +100,7 @@
 ;;; Copyright © 2021 Ellis Kenyő <me@elken.dev>
 ;;; Copyright © 2021 LibreMiami <packaging-guix@libremiami.org>
 ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz>
+;;; Copyright © 2021 Greg Hogan <code@greghogan.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4886,7 +4887,7 @@ between language specification and implementation aspects.")
 (define-public python-numpy
   (package
     (name "python-numpy")
-    (version "1.17.3")
+    (version "1.20.3")
     (source
      (origin
        (method url-fetch)
@@ -4895,13 +4896,14 @@ between language specification and implementation aspects.")
              version "/numpy-" version ".tar.gz"))
        (sha256
         (base32
-         "1ak9dmjja0q90a7fsxli51ypcwssh8c4pb6f8wkrsnf2xgdk6dy9"))))
+         "140zq9snx0di4id4g97vaw9zz8x2rfla5lp3a70j666f5030yd5p"))))
     (build-system python-build-system)
     (inputs
      `(("openblas" ,openblas)
        ("lapack" ,lapack)))
     (native-inputs
      `(("python-cython" ,python-cython)
+       ("python-hypothesis" ,python-hypothesis)
        ("python-pytest" ,python-pytest)
        ("gfortran" ,gfortran)))
     (arguments
-- 
2.31.1


[-- Attachment #4: 0002-gnu-python-pandas-Update-to-1.2.4.patch --]
[-- Type: application/octet-stream, Size: 1977 bytes --]

From 570be8ce7c9172fb884df4330fe0f0d1a4551c98 Mon Sep 17 00:00:00 2001
From: Greg Hogan <code@greghogan.com>
Date: Wed, 31 Mar 2021 17:01:23 +0000
Subject: [PATCH 2/4] gnu: python-pandas: Update to 1.2.4.

* gnu/packages/python-science.scm (python-pandas): Update to 1.2.4.
[propagated-inputs]: Add python-pytest-xdist,
replace python-openpyxl with python-xlsxwriter
---
 gnu/packages/python-science.scm | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 79ee7c8bb2..af12e0967b 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -318,13 +318,13 @@ of the SGP4 satellite tracking algorithm.")
 (define-public python-pandas
   (package
     (name "python-pandas")
-    (version "1.0.5")
+    (version "1.2.4")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "pandas" version))
        (sha256
-        (base32 "1a2gv3g6jr6vb5ca43fkwjl5xf86wpfz8y3zcy787adjl0hdkib9"))))
+        (base32 "0y92rfjxsayqmkx5v980myhgn33b94vgjzwnryzkrppsjavcm7k4"))))
     (build-system python-build-system)
     (arguments
      `(#:modules ((guix build utils)
@@ -364,7 +364,7 @@ of the SGP4 satellite tracking algorithm.")
     (propagated-inputs
      `(("python-jinja2" ,python-jinja2)
        ("python-numpy" ,python-numpy)
-       ("python-openpyxl" ,python-openpyxl)
+       ("python-xlsxwriter" ,python-xlsxwriter)
        ("python-pytz" ,python-pytz)
        ("python-dateutil" ,python-dateutil)
        ("python-xlrd" ,python-xlrd)))
@@ -380,6 +380,7 @@ of the SGP4 satellite tracking algorithm.")
        ("python-nose" ,python-nose)
        ("python-pytest" ,python-pytest)
        ("python-pytest-mock" ,python-pytest-mock)
+       ("python-pytest-xdist" ,python-pytest-xdist)
        ;; Needed to test clipboard support.
        ("xorg-server" ,xorg-server-for-tests)))
     (home-page "https://pandas.pydata.org")
-- 
2.31.1


[-- Attachment #5: 0004-gnu-python-scipy-Update-to-1.6.3.patch --]
[-- Type: application/octet-stream, Size: 1071 bytes --]

From db61cb016cda4962ea7ffebaa26129ff46c18b2f Mon Sep 17 00:00:00 2001
From: Greg Hogan <code@greghogan.com>
Date: Wed, 26 May 2021 16:44:09 +0000
Subject: [PATCH 4/4] gnu: python-scipy: Update to 1.6.3.

* gnu/packages/python-science.scm (python-scipy): Update to 1.6.3.
---
 gnu/packages/python-science.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index af12e0967b..72836ee7f9 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -53,13 +53,13 @@
 (define-public python-scipy
   (package
     (name "python-scipy")
-    (version "1.6.0")
+    (version "1.6.3")
     (source
      (origin
        (method url-fetch)
        (uri (pypi-uri "scipy" version))
        (sha256
-        (base32 "0rh5b1rwdcvvagld8vpxnpaibszy1skpx39a0fwzd5gx5pwcjvfb"))))
+        (base32 "01q74r395185zk6lmcxy6rkxhwangfi4xl59a9lf5z4l696h2nx7"))))
     (build-system python-build-system)
     (propagated-inputs
      `(("python-numpy" ,python-numpy)
-- 
2.31.1


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

* [bug#48703] [PATCH 0/4] Update python-numpy
  2021-05-27 15:10 [bug#48703] [PATCH 0/4] Update python-numpy Greg Hogan
@ 2021-06-02 19:14 ` Xinglu Chen
  2021-06-16  9:10 ` Vinicius Monego
       [not found] ` <handler.48703.B.16221282921408.ack@debbugs.gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Xinglu Chen @ 2021-06-02 19:14 UTC (permalink / raw)
  To: Greg Hogan, 48703

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

On Thu, May 27 2021, Greg Hogan wrote:

> In March there were two attempts to update python-numpy (#45698 and #47183
> / #47184) which failed to build python-pandas and python-scipy.
>
> The attached patches update and successfully build python-numpy,
> python-pandas, python-matplotlib, and python-scipy.
>
> In addition to modified dependencies, python-matplotlib expanded the regex
> to silence image font differences and I was only able to successfully build
> and test python-pandas when replacing python-openpyxl
> with python-xlsxwriter.

Thank you for working on this!

All the four packages you mentioned, ‘python-numpy’, ‘python-pandas’,
‘python-matplotlib’, and ‘python-scipy’ build for me.


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]

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

* [bug#48703] [PATCH 0/4] Update python-numpy
  2021-05-27 15:10 [bug#48703] [PATCH 0/4] Update python-numpy Greg Hogan
  2021-06-02 19:14 ` Xinglu Chen
@ 2021-06-16  9:10 ` Vinicius Monego
       [not found] ` <handler.48703.B.16221282921408.ack@debbugs.gnu.org>
  2 siblings, 0 replies; 4+ messages in thread
From: Vinicius Monego @ 2021-06-16  9:10 UTC (permalink / raw)
  To: 48703

Hello,

Since this is a mid to long term update (the packages have quite a few
[heavy] dependents), I'd like to suggest some refactoring. I will talk
about each package separately.

- python-numpy:

1. Why is it sourced from a tar.gz in the github releases page and not
from PyPI or a checkout? I had a look at the PyPI source file and the
tests are provided. If that source is required, a comment would help.

2.

> ;; Tests can only be run after the library has been installed and not
> ;; within the source directory.

I'm not sure if pytest was invoked manually or if the runtests.py
script was executed to reach that conclusion.

Numpy uses the tests under subdirectories structure. In that case,
tests should run with "python -m pytest --pyargs numpy" or "pytest --
pyargs numpy". I have this generic template that worked for all of my
packages so far:

> (replace 'check
>   (lambda* (#:key inputs outputs tests? #:allow-other-keys)
>     (when tests?
>       (add-installed-pythonpath inputs outputs)
>       (invoke "python" "-m" "pytest" "--pyargs" "numpy"))))

NumPy could be a special case, but a more detailed comment would help.

3. #:tests? is not respected.

4. Don't return #t in the phases.

- python-scipy

1. Same comment about tests from NumPy. Overriding the check would also
allow removing the 'disable-broken-tests phase.

2. #:tests? is not respected here either.

3. Don't return #t in the phases.

4. Since documentation is being built, it would be good to have the
sphinx theme for scipy ready. The current documentation doesn't have
any CSS. Not a big problem though.

- python-matplotlib

1. Respect #:tests?.

2. Don't return #t in the phases.

LGTM otherwise.

- python-pandas

1. I think the check phase could be simplified by using the same pytest
structure suggested in numpy and scipy.
2. Respect #:tests?
3. Don't return #t in the phases.





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

* bug#48703: Acknowledgement ([PATCH 0/4] Update python-numpy)
       [not found] ` <handler.48703.B.16221282921408.ack@debbugs.gnu.org>
@ 2022-01-28 11:48   ` Greg Hogan
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Hogan @ 2022-01-28 11:48 UTC (permalink / raw)
  To: 48703-done

[-- Attachment #1: Type: text/plain, Size: 912 bytes --]

The same or newer package versions are in the main branch. Closing.

On Thu, May 27, 2021 at 11:12 AM GNU bug Tracking System <
help-debbugs@gnu.org> wrote:

> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
>  guix-patches@gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 48703@debbugs.gnu.org.
>
> Please do not send mail to help-debbugs@gnu.org unless you wish
> to report a problem with the Bug-tracking system.
>
> --
> 48703: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=48703
> GNU Bug Tracking System
> Contact help-debbugs@gnu.org with problems
>

[-- Attachment #2: Type: text/html, Size: 1703 bytes --]

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

end of thread, other threads:[~2022-01-28 11:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-27 15:10 [bug#48703] [PATCH 0/4] Update python-numpy Greg Hogan
2021-06-02 19:14 ` Xinglu Chen
2021-06-16  9:10 ` Vinicius Monego
     [not found] ` <handler.48703.B.16221282921408.ack@debbugs.gnu.org>
2022-01-28 11:48   ` bug#48703: Acknowledgement ([PATCH 0/4] Update python-numpy) Greg Hogan

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.