Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 662518 - dev-python/pygtk: make dep dev-python/numpy optional
Summary: dev-python/pygtk: make dep dev-python/numpy optional
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2018-07-31 10:42 UTC by Perfect Gentleman
Modified: 2020-04-05 11:03 UTC (History)
7 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
pygtk-2.24.0-r4.ebuild modified (pygtk-2.24.0-r4.ebuild,2.68 KB, text/plain)
2018-07-31 10:42 UTC, Perfect Gentleman
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Perfect Gentleman 2018-07-31 10:42:45 UTC
Created attachment 541850 [details]
pygtk-2.24.0-r4.ebuild modified

--disable-numpy         Disable numeric python features
Comment 1 Mart Raudsepp gentoo-dev 2018-08-02 06:34:25 UTC
We can't just go and disable or make this optional blindly.
--disable-numpy will make GdkPixbuf pixel_array stuff error out or not work.
I am not willing to go and research if any of our pygtk consumers need this to work or not, as the goal for pygtk is to last rite it, not spend time improving the package.
Comment 2 Bernd Feige 2019-11-28 16:54:02 UTC
The situation has changed a bit in the meantime - current numpy-0.17 is python3 only, therefore whoever has gimp installed gets downgraded to numpy-0.16 through this pygtk dependency. Is there a time frame when gimp is updated? For me the main other remaining package based upon pygtk is pybliographer - most other packages are simply unmaintained since 10 years and should probably be dropped. I have disabled numpy in pygtk and will report whether I experience problems.
Comment 3 Pacho Ramos gentoo-dev 2019-12-17 00:50:29 UTC
This is also an issue now as numpy-1.17.4 is the only version with python3.8 support, hence, we cannot have python3.8 and this at the same time.

I have seen that Fedora is having numpy-1.16.x for python2 while having 1.17 for python3... 

They also disabled numpy recently:
https://src.fedoraproject.org/rpms/pygtk2/c/020c301a2029d7842ad26d03d744f8f5671a2db7?branch=master

I would got for this last option if possible, at least we will have also Fedora users to help us to track if it breaks many things or not :/
Comment 4 Pacho Ramos gentoo-dev 2019-12-17 00:50:56 UTC
sci is also maintaining numpy
Comment 5 Pacho Ramos gentoo-dev 2019-12-17 00:53:38 UTC
Anyway, I see more packages needing numpy-python2 (lots of scientific programs that I use a lot too :S like VMD or pymol)... then, maybe the Fedora way of slotting numpy could work
Comment 6 Pacho Ramos gentoo-dev 2019-12-17 00:56:00 UTC
This is their python2-numpy:
https://src.fedoraproject.org/rpms/python2-numpy/blob/master/f/python2-numpy.spec
Comment 8 Pacho Ramos gentoo-dev 2019-12-17 01:02:04 UTC
If you want I volunteer on helping with that python2 numpy slot, as, sadly, I will need it due to my job too as it has important reverse deps for us
Comment 9 Pacho Ramos gentoo-dev 2019-12-17 08:31:24 UTC
Regarding pygtk, in Arch Linux numpy is optional since 2009 
https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/pygtk&id=1699b45be1c900200c9b472177b0d7e00d6b71ac
https://bugs.archlinux.org/task/14861
https://www.redhat.com/archives/fedora-devel-list/2009-August/msg00677.html
https://bugzilla.gnome.org/show_bug.cgi?id=591745 -> per this, they explain that one alternative would be to RDEPEND on numpy from the packages still requiring them instead of pulling it from pygtk

In any case, I can maybe open a separate report for the python2 numpy slot and keep this for pygtk as they could be handled independently :)
Comment 10 Mart Raudsepp gentoo-dev 2020-01-09 11:13:48 UTC
(In reply to Pacho Ramos from comment #9)
> https://bugzilla.gnome.org/show_bug.cgi?id=591745 -> per this, they explain
> that one alternative would be to RDEPEND on numpy from the packages still
> requiring them instead of pulling it from pygtk

No, it's not. pygtk numpy usage is compile-time optional, not runtime optional.
Binary distributions could have it at compile-time and build against it, but then not declare numpy as a dep and make sure the consumers that need it do it instead; very hacky and bad, but a sort of solution that binary distributions could do. Not workable for us - we need it at compile-time anyways (just like binary distros then).

The way forward here is checking if any pygtk consumers need these APIs (an important one like gimp doesn't seem to), and if yes - deal with it (last rite those, or change the code or whatever feels appropriate); ifor once that's a "no" - just unconditionally disabling numpy in pygtk.

The long-term way forward of course is last riting pygtk, but that unfortunately isn't realistic anytime soon still.
Comment 11 Mart Raudsepp gentoo-dev 2020-01-09 11:14:43 UTC
That checking can be done mostly with a grep of the consumers source tree after identifying the method names to grep for based on HAVE_NUMPY or whatnot usages in pygtk sources.
Comment 12 Larry the Git Cow gentoo-dev 2020-03-15 19:38:28 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3128d102dcf3cc155abe44311f54dc228691335d

commit 3128d102dcf3cc155abe44311f54dc228691335d
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2020-01-28 19:47:01 +0000
Commit:     Mart Raudsepp <leio@gentoo.org>
CommitDate: 2020-03-15 19:37:14 +0000

    dev-python/pygtk: Unconditionally --disable-numpy
    
    Reported-by: Perfect Gentleman <perfect007gentleman@gmail.com>
    Bug: https://bugs.gentoo.org/662518
    Package-Manager: Portage-2.3.86, Repoman-2.3.20
    Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
    Closes: https://github.com/gentoo/gentoo/pull/14540
    Signed-off-by: Mart Raudsepp <leio@gentoo.org>

 dev-python/pygtk/pygtk-2.24.0-r5.ebuild | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
Comment 13 Andreas Sturmlechner gentoo-dev 2020-03-16 10:57:04 UTC
Considering this as fixed then.