GNU bug report logs - #25705
[PATCH] gnu: python-matplotlib: Don't propagate python-numpy-bootstrap.

Previous Next

Package: guix-patches;

Reported by: Thomas Danckaert <post <at> thomasdanckaert.be>

Date: Mon, 13 Feb 2017 16:26:02 UTC

Severity: normal

Tags: patch

Merged with 25834

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 25705 in the body.
You can then email your comments to 25705 AT debbugs.gnu.org in the normal way.

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#25705; Package guix-patches. (Mon, 13 Feb 2017 16:26:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Thomas Danckaert <post <at> thomasdanckaert.be>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Mon, 13 Feb 2017 16:26:02 GMT) Full text and rfc822 format available.

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

From: Thomas Danckaert <post <at> thomasdanckaert.be>
To: guix-patches <at> gnu.org
Subject: Re: [PATCH] gnu: python-matplotlib: Don't propagate
 python-numpy-bootstrap.
Date: Mon, 13 Feb 2017 10:57:06 +0100 (CET)
[Message part 1 (text/plain, inline)]
(continuing the discussion from 
https://lists.gnu.org/archive/html/guix-devel/2017-01/msg02239.html)

From: Marius Bakke <mbakke <at> fastmail.com>
Subject: Re: [PATCH] gnu: python-matplotlib: Don't propagate 
python-numpy-bootstrap.
Date: Fri, 27 Jan 2017 20:57:12 +0100

>> This patch works around it by creating an intermediate
>> python-matplotlib-bootstrap package as well, which is then used as 
>> a
>> native input to generate the documentation of python-numpy.
>> python-numpy is then used as a propagated input of 
>> python-matplotlib,
>> so python-numpy-bootstrap doesn't appear in user's profiles 
>> anymore.
>>
>> What do you think?
>
> This sounds sensible. Does numpy not require any matplotlib 
> functions at
> runtime?

No. It's just used for the documentation.  With the attached patch, 
the dependency chain is this:

matplotlib -> numpy -> matplotlib-bootstrap -> numpy-bootstrap 
(=“numpy-without-docs”)

> If so, this patch LGTM. The new matplotlib-bootstrap variables
> should have an explaining comment though :)

I've added a comment and fixed some long lines.

Thomas
[0001-gnu-python-matplotlib-Don-t-propagate-python-numpy-b.patch (text/x-patch, inline)]
From 8a9584dd196dae3520fe2ac4b050a9e0c88503f8 Mon Sep 17 00:00:00 2001
From: Thomas Danckaert <thomas.danckaert <at> gmail.com>
Date: Fri, 27 Jan 2017 12:12:42 +0100
Subject: [PATCH] gnu: python-matplotlib: Don't propagate
 python-numpy-bootstrap.

* gnu/packages/python.scm (python-matplotlib-bootstrap,python2-matplotlib-bootstrap):
  New variables.
  (python-matplotlib, python2-matplotlib) [propagated-inputs]: Use
  python-numpy instead of python-numpy-bootstrap.
  (python-numpy, python2-numpy) [propagated-inputs,native-inputs]: Replace
  matplotlib by native inputs matplotlib-bootstrap.
---
 gnu/packages/python.scm | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 81f9200..14d2e23 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -33,7 +33,7 @@
 ;;; Copyright © 2016 Arun Isaac <arunisaac <at> systemreboot.net>
 ;;; Copyright © 2016 Julien Lepiller <julien <at> lepiller.eu>
 ;;; Copyright © 2016, 2017 Tobias Geerinckx-Rice <me <at> tobias.gr>
-;;; Copyright © 2016 Thomas Danckaert <post <at> thomasdanckaert.be>
+;;; Copyright © 2016, 2017 Thomas Danckaert <post <at> thomasdanckaert.be>
 ;;; Copyright © 2017 Carlo Zancanaro <carlo <at> zancanaro.id.au>
 ;;;
 ;;; This file is part of GNU Guix.
@@ -3404,11 +3404,11 @@ association studies (GWAS) on extremely large data sets.")
      `(("which" ,which)
        ,@(package-inputs python-numpy-bootstrap)))
     (propagated-inputs
-     `(("python-matplotlib" ,python-matplotlib)
-       ("python-pyparsing" ,python-pyparsing)
+     `(("python-pyparsing" ,python-pyparsing)
        ,@(package-propagated-inputs python-numpy-bootstrap)))
     (native-inputs
      `(("pkg-config" ,pkg-config)
+       ("python-matplotlib" ,python-matplotlib-bootstrap) ; to build documentation
        ("python-sphinx" ,python-sphinx)
        ("python-numpydoc" ,python-numpydoc)
        ("texlive" ,texlive)
@@ -3458,7 +3458,11 @@ association studies (GWAS) on extremely large data sets.")
               ,phases)))))))
 
 (define-public python2-numpy
-  (package-with-python2 python-numpy))
+  (let ((numpy (package-with-python2 python-numpy)))
+    (package (inherit numpy)
+             (native-inputs
+              `(("python-matplotlib" ,python2-matplotlib-bootstrap)
+                ,@(alist-delete "python-matplotlib" (package-native-inputs numpy)))))))
 
 (define-public python-pygit2
   (package
@@ -3623,7 +3627,7 @@ transcendental functions).")
        ("gobject-introspection" ,gobject-introspection)
        ("python-tkinter" ,python "tk")
        ("python-dateutil" ,python-dateutil-2)
-       ("python-numpy" ,python-numpy-bootstrap)
+       ("python-numpy" ,python-numpy)
        ("python-pillow" ,python-pillow)
        ("python-pytz" ,python-pytz)
        ("python-six" ,python-six)
@@ -3740,8 +3744,18 @@ toolkits.")
        `(("python2-pycairo" ,python2-pycairo)
          ("python2-pygobject-2" ,python2-pygobject-2)
          ("python2-tkinter" ,python-2 "tk")
+         ("python2-numpy" ,python2-numpy)
          ,@(fold alist-delete (package-propagated-inputs matplotlib)
-                 '("python-pycairo" "python-pygobject" "python-tkinter")))))))
+                 '("python-pycairo" "python-pygobject" "python-tkinter"
+                   "python-numpy")))))))
+
+;; Use `bootstrap` versions of matplotlib to build numpy documentation.
+(define python-matplotlib-bootstrap
+  ((package-input-rewriting `((,python-numpy . ,python-numpy-bootstrap)))
+   python-matplotlib))
+(define python2-matplotlib-bootstrap
+  ((package-input-rewriting `((,python2-numpy . ,python2-numpy-bootstrap)))
+   python2-matplotlib))
 
 (define-public python2-pysnptools
   (package
-- 
2.7.4


Information forwarded to guix-patches <at> gnu.org:
bug#25705; Package guix-patches. (Mon, 13 Feb 2017 20:49:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Thomas Danckaert <post <at> thomasdanckaert.be>, 25705 <at> debbugs.gnu.org
Subject: Re: bug#25705: [PATCH] gnu: python-matplotlib: Don't
 propagate	python-numpy-bootstrap.
Date: Mon, 13 Feb 2017 21:48:09 +0100
[Message part 1 (text/plain, inline)]
Thomas Danckaert <post <at> thomasdanckaert.be> writes:

> (continuing the discussion from 
> https://lists.gnu.org/archive/html/guix-devel/2017-01/msg02239.html)
>
> From: Marius Bakke <mbakke <at> fastmail.com>
> Subject: Re: [PATCH] gnu: python-matplotlib: Don't propagate 
> python-numpy-bootstrap.
> Date: Fri, 27 Jan 2017 20:57:12 +0100
>
>>> This patch works around it by creating an intermediate
>>> python-matplotlib-bootstrap package as well, which is then used as 
>>> a
>>> native input to generate the documentation of python-numpy.
>>> python-numpy is then used as a propagated input of 
>>> python-matplotlib,
>>> so python-numpy-bootstrap doesn't appear in user's profiles 
>>> anymore.
>>>
>>> What do you think?
>>
>> This sounds sensible. Does numpy not require any matplotlib 
>> functions at
>> runtime?
>
> No. It's just used for the documentation.  With the attached patch, 
> the dependency chain is this:
>
> matplotlib -> numpy -> matplotlib-bootstrap -> numpy-bootstrap 
> (=“numpy-without-docs”)
>
>> If so, this patch LGTM. The new matplotlib-bootstrap variables
>> should have an explaining comment though :)
>
> I've added a comment and fixed some long lines.

Hi Thomas,

Thanks for the reminder. I'm not comfortable pushing this while we don't
notice python test failures[0], but will add this as soon as the
'python-tests' branch is merged.

There are a few unresolved failures still in [1], I will work on the
list (from the bottom) over the next few days.

[0] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25177
[1] https://hydra.gnu.org/eval/109444?full=1&compare=master#tabs-now-fail
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#25705; Package guix-patches. (Tue, 14 Feb 2017 08:52:02 GMT) Full text and rfc822 format available.

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

From: Thomas Danckaert <post <at> thomasdanckaert.be>
To: mbakke <at> fastmail.com
Cc: 25705 <at> debbugs.gnu.org
Subject: Re: bug#25705: [PATCH] gnu: python-matplotlib: Don't propagate
 python-numpy-bootstrap.
Date: Tue, 14 Feb 2017 09:51:17 +0100 (CET)
From: Marius Bakke <mbakke <at> fastmail.com>
Subject: Re: bug#25705: [PATCH] gnu: python-matplotlib: Don't 
propagate python-numpy-bootstrap.
Date: Mon, 13 Feb 2017 21:48:09 +0100

> Hi Thomas,
>
> Thanks for the reminder. I'm not comfortable pushing this while we 
> don't
> notice python test failures[0], but will add this as soon as the
> 'python-tests' branch is merged.

Yes, I thought that had something to do with it.

By the way, as another solution, we could create a separate 
python-numpy-documentation package (not to be confused with 
python-numpydoc, which is something different...), instead of a 
python-numpy:doc output.  This way, we could end up with a much 
simpler dependency graph, which doesn't require any bootstrap 
packages:

python-numpy <- python-matplotlib <- python-numpy-documentation

But I suppose the preference in guix is to work with multiple outputs?

Thomas




Information forwarded to guix-patches <at> gnu.org:
bug#25705; Package guix-patches. (Tue, 14 Feb 2017 14:52:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Thomas Danckaert <post <at> thomasdanckaert.be>
Cc: 25705 <at> debbugs.gnu.org
Subject: Re: bug#25705: [PATCH] gnu: python-matplotlib: Don't propagate
 python-numpy-bootstrap.
Date: Tue, 14 Feb 2017 15:51:44 +0100
[Message part 1 (text/plain, inline)]
Thomas Danckaert <post <at> thomasdanckaert.be> writes:

> From: Marius Bakke <mbakke <at> fastmail.com>
> Subject: Re: bug#25705: [PATCH] gnu: python-matplotlib: Don't 
> propagate python-numpy-bootstrap.
> Date: Mon, 13 Feb 2017 21:48:09 +0100
>
>> Hi Thomas,
>>
>> Thanks for the reminder. I'm not comfortable pushing this while we 
>> don't
>> notice python test failures[0], but will add this as soon as the
>> 'python-tests' branch is merged.
>
> Yes, I thought that had something to do with it.
>
> By the way, as another solution, we could create a separate 
> python-numpy-documentation package (not to be confused with 
> python-numpydoc, which is something different...), instead of a 
> python-numpy:doc output.  This way, we could end up with a much 
> simpler dependency graph, which doesn't require any bootstrap 
> packages:
>
> python-numpy <- python-matplotlib <- python-numpy-documentation
>
> But I suppose the preference in guix is to work with multiple outputs?

That depends. I tried updating scipy, numpy and matplotlib recently, but
ran into a circular dependency (can't remember which). Something like
this might help.

I think we should do a 'python-updates' branch as soon as 'python-tests'
is ready, where we can address this problem. Would you like to try
updating the trio and resolving the dependency conflict? :-)
[signature.asc (application/pgp-signature, inline)]

Information forwarded to guix-patches <at> gnu.org:
bug#25705; Package guix-patches. (Tue, 14 Feb 2017 20:08:02 GMT) Full text and rfc822 format available.

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

From: Thomas Danckaert <post <at> thomasdanckaert.be>
To: mbakke <at> fastmail.com
Cc: 25705 <at> debbugs.gnu.org
Subject: Re: bug#25705: [PATCH] gnu: python-matplotlib: Don't propagate
 python-numpy-bootstrap.
Date: Tue, 14 Feb 2017 21:07:35 +0100 (CET)
From: Marius Bakke <mbakke <at> fastmail.com>
Subject: Re: bug#25705: [PATCH] gnu: python-matplotlib: Don't 
propagate python-numpy-bootstrap.
Date: Tue, 14 Feb 2017 15:51:44 +0100

> I think we should do a 'python-updates' branch as soon as 
> 'python-tests'
> is ready, where we can address this problem. Would you like to try
> updating the trio and resolving the dependency conflict? :-)

challenge accepted ;-)




Merged 25705 25834. Request was from Thomas Danckaert <post <at> thomasdanckaert.be> to control <at> debbugs.gnu.org. (Mon, 27 Feb 2017 11:25:03 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 04 Apr 2017 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 8 years and 79 days ago.

Previous Next


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