Bug 447779

Summary: "pydoc turbogears" doesn't work
Product: [Fedora] Fedora Reporter: Nils Philippsen <nphilipp>
Component: pythonAssignee: Dave Malcolm <dmalcolm>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 11CC: a.badger, dmalcolm, lmacken
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-12-02 20:53:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
"tg_doc" -- pydoc wrapper/replacement that works with turbogears none

Description Nils Philippsen 2008-05-21 18:48:40 UTC
Description of problem:
nils@gibraltar:~> pydoc turbogears
problem in turbogears - <class 'pkg_resources.VersionConflict'>: (CherryPy 3.0.3
(/usr/lib/python2.5/site-packages), Requirement.parse('CherryPy<3.0'))

Version-Release number of selected component (if applicable):
TurboGears-1.0.4.4-2.fc9.noarch

How reproducible:
Always

Steps to Reproduce:
1. "pydoc turbogears" or any component thereunder
  
Actual results:
See above

Expected results:
Docs are shown

Additional info:
This might need the pkg_resources/requires dance in all turbogears modules (just
a WAG).

Comment 1 Nils Philippsen 2008-05-21 19:06:19 UTC
Created attachment 306305 [details]
"tg_doc" -- pydoc wrapper/replacement that works with turbogears

A small wrapper/replacement which uses pkg_resources to setup TurboGears for
inclusion by pydoc.

Comment 2 Toshio Ernie Kuratomi 2008-05-21 19:24:20 UTC
Yep, that'll work.  So the question is, what's the bug?  If we ship a tg_doc
wrapper, that let's the user get to the turbogears documentation from the
command line but it doesn't help the user who already knows about pydoc
turbogears to discover the new command.  OTOH, this might be the best we can do
short of porting pydoc to know about eggs (which it has its own special problems
since the egg name and the module import name are seldom the same.)

If we ship this, tg-pydoc seems like a better name.

We could also look into integrating this with tg-admin.  tg-admin doc
turbogears; tg-admin doc fas; for instance.

Comment 3 Nils Philippsen 2008-05-21 21:27:01 UTC
That script was only meant as a proof-of-concept -- I wasn't suggesting to
replace pydoc, but to fix TG for it. The real fix has to be done in the TG
modules (i.e. copy the 2 requirement lines or something along that line).

Comment 4 Toshio Ernie Kuratomi 2008-05-21 22:17:16 UTC
That won't work.  By the time you've imported TurboGeats, it's already too late
to specify __requires__.

Comment 5 Toshio Ernie Kuratomi 2008-05-21 22:17:29 UTC
That won't work.  By the time you've imported TurboGears, it's already too late
to specify __requires__.

Comment 6 Nils Philippsen 2008-05-23 17:06:04 UTC
(In reply to comment #5)
> That won't work.  By the time you've imported TurboGears, it's already too late
> to specify __requires__.

I could be wrong, but wouldn't it be sufficient if TG used __requires__ etc. for
importing the correct cherrypy version to make pydoc work again?

Comment 7 Toshio Ernie Kuratomi 2008-05-23 21:18:39 UTC
In my testing yesterday it failed when I added the __requires__ line to
turbogears/__init__.py.

To be a bit more thorough I just did this:

yum install -y python-cherrypy python-cherrypy2 turbogears

sudo sed -i "s/import pkg_resources/__requires__='CherryPy < 3.0'\nimport
pkg_resources\nimport cherrypy\nprint cherrypy.__version__\n/"
/usr/lib/python2.5/site-packages/turbogears/__init__.py

pydoc turbogears

3.0.3
problem in turbogears - <class 'pkg_resources.VersionConflict'>: (CherryPy 3.0.3
(/usr/lib/python2.5/site-packages), Requirement.parse('CherryPy<3.0'))

So that seems to confirm that setting __requires__ after turbogears has been
imported will be too late.

Comment 8 Nils Philippsen 2008-05-26 09:57:57 UTC
Hmm, it seems to me that this has to be solved in pydoc, therefore I'll change
the component to python. I'm not privy to how pydoc works in detail, but it
seems to be unaware of the egg concept, importing the wrong (new) cherrypy
version which makes importing turbogears fail. Despite that, if one module
throws errors when imported, "pydoc -k" etc. don't work (see bug #246212).

Comment 9 Nils Philippsen 2008-05-26 09:58:34 UTC
Argh. Changing assignee as well.

Comment 10 Nils Philippsen 2008-05-26 09:59:28 UTC
I seem to have a knot in my fingers. One more attempt to change the component.

Comment 11 Nils Philippsen 2008-05-26 10:00:03 UTC
I seem to have a knot in my fingers. One more attempt to change the component.

Comment 12 Bug Zapper 2009-06-10 01:04:08 UTC
This message is a reminder that Fedora 9 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 9.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '9'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 9's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 9 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 13 Dave Malcolm 2009-12-02 20:53:18 UTC

*** This bug has been marked as a duplicate of bug 461419 ***