Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 313125 - pydoc keyword searching is broken with <sci-biology/biopython-1.56[-mysql] and dev-python/pyopengl
Summary: pydoc keyword searching is broken with <sci-biology/biopython-1.56[-mysql] an...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: New packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-04 19:41 UTC by David Suarez
Modified: 2014-01-30 10:46 UTC (History)
4 users (show)

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


Attachments
Error messages when pydoc tries to search keywords through biopython module (biopython.txt,1.93 KB, text/plain)
2010-04-04 19:43 UTC, David Suarez
Details
Error messages obtained when pydoc tries to search keywords through pyopengl module (pyopengl.txt,925 bytes, text/plain)
2010-04-04 19:44 UTC, David Suarez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Suarez 2010-04-04 19:41:19 UTC
Pydoc dies when trying to search keywords through packages with dependency problems. It seems the *real* problem is portage installing broken packages when USE flags are used to not install all dependencies of the python package. For example, biopython includes a module called Bio.GFF which requires mysql, but portage considers optional to include dependency on mysql-python. I suppose the question has been previously considered about whether this should be corrected on the python or on the portage side. But it certainly creates an usability problem with python on Gentoo.
I think the obvious hack is just to make pydoc skip to the next package when it receives an exception on importing some module.

Reproducible: Always

Steps to Reproduce:
1.emerge biopython with USE flag "-mysql" (the bug requires mysql-python not to be emerged independently of biopython)
2.pydoc -k AnyThing

Actual Results:  
Bio.MissingExternalDependencyError: Install MySQLdb if you want to use Bio.GFF.
Comment 1 David Suarez 2010-04-04 19:43:54 UTC
Created attachment 226587 [details]
Error messages when pydoc tries to search keywords through biopython module
Comment 2 David Suarez 2010-04-04 19:44:48 UTC
Created attachment 226589 [details]
Error messages obtained when pydoc tries to search keywords through pyopengl module
Comment 3 Sebastian Pipping gentoo-dev 2010-04-04 22:05:06 UTC
Bug report QA messages:

 * Please use full package qualifiers
   (e.g. "sys-apps/portage", not just "portage")
   in bug report titles, at the beginning ideally,
   in the future.  Thank you!
Comment 4 David Suarez 2010-04-09 00:55:42 UTC
(In reply to comment #3)
> Bug report QA messages:
> 
>  * Please use full package qualifiers
>    (e.g. "sys-apps/portage", not just "portage")
>    in bug report titles, at the beginning ideally,
>    in the future.  Thank you!
> 
Yep, sorry. I'll remember that.

Thank you!
Comment 5 Peter 2010-07-14 22:18:41 UTC
I wonder if Biopython were to use a subclass of ImportError, rather than
its own Bio.MissingExternalDependencyError this would help? e.g.

http://github.com/peterjc/biopython/tree/import-exception
Comment 6 Thomas Kahle (RETIRED) gentoo-dev 2010-10-18 13:03:29 UTC
Still present in current versions.
@python-team. Can you comment on that?

e.g. for biopython forcing USE="mysql" should not be an option. On the other hand, breaking pydoc by installing biopython is not an option either.
Comment 7 Peter 2010-10-18 13:51:45 UTC
(In reply to comment #5)
> I wonder if Biopython were to use a subclass of ImportError, rather than
> its own Bio.MissingExternalDependencyError this would help? e.g.
> 
> http://github.com/peterjc/biopython/tree/import-exception
> 

Looking at the code for pkgutil.py and function walk_packages in particular,
it will cope with exceptions which are of class ImportError (or a subclass).

In this case, both Biopython and pyopengl are (currently) not raising an
ImportError, and this could be changed if appropriate. I've fixed this
particular case (Bio.GFF) on the Biopython trunk and the change will be
included as part of Biopython 1.56 due later this year:

http://github.com/biopython/biopython/commit/cb1f54499c0273e1bd45a163781f8a0680e3fc6e

However, I think this is a really bug in pydoc for not copying with an
import failure where a non-ImportError is raised.
Comment 8 Andrey Kislyuk (RETIRED) gentoo-dev 2010-10-18 14:59:30 UTC
I agree with Peter, this seems to be a Pydoc upstream problem - even though all such errors should be ImportErrors, you can't rely on all packages conforming to this rule.

(In reply to comment #7)
> (In reply to comment #5)
> > I wonder if Biopython were to use a subclass of ImportError, rather than
> > its own Bio.MissingExternalDependencyError this would help? e.g.
> > 
> > http://github.com/peterjc/biopython/tree/import-exception
> > 
> 
> Looking at the code for pkgutil.py and function walk_packages in particular,
> it will cope with exceptions which are of class ImportError (or a subclass).
> 
> In this case, both Biopython and pyopengl are (currently) not raising an
> ImportError, and this could be changed if appropriate. I've fixed this
> particular case (Bio.GFF) on the Biopython trunk and the change will be
> included as part of Biopython 1.56 due later this year:
> 
> http://github.com/biopython/biopython/commit/cb1f54499c0273e1bd45a163781f8a0680e3fc6e
> 
> However, I think this is a really bug in pydoc for not copying with an
> import failure where a non-ImportError is raised.
> 
Comment 9 Justin Lecher (RETIRED) gentoo-dev 2014-01-30 10:46:32 UTC
Fixed by this commit

  23 Jun 2011; Markos Chandras <hwoarang@gentoo.org> -biopython-1.56.ebuild:
  Remove old ebuilds. Requested by Arfrever