Bug 447779 - "pydoc turbogears" doesn't work
"pydoc turbogears" doesn't work
Status: CLOSED DUPLICATE of bug 461419
Product: Fedora
Classification: Fedora
Component: python (Show other bugs)
11
All Linux
low Severity low
: ---
: ---
Assigned To: Dave Malcolm
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-21 14:48 EDT by Nils Philippsen
Modified: 2009-12-02 15:53 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-12-02 15:53:18 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
"tg_doc" -- pydoc wrapper/replacement that works with turbogears (127 bytes, text/plain)
2008-05-21 15:06 EDT, Nils Philippsen
no flags Details

  None (edit)
Description Nils Philippsen 2008-05-21 14:48:40 EDT
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 15:06:19 EDT
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 15:24:20 EDT
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 17:27:01 EDT
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 18:17:16 EDT
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 18:17:29 EDT
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 13:06:04 EDT
(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 17:18:39 EDT
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 05:57:57 EDT
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 05:58:34 EDT
Argh. Changing assignee as well.
Comment 10 Nils Philippsen 2008-05-26 05:59:28 EDT
I seem to have a knot in my fingers. One more attempt to change the component.
Comment 11 Nils Philippsen 2008-05-26 06:00:03 EDT
I seem to have a knot in my fingers. One more attempt to change the component.
Comment 12 Bug Zapper 2009-06-09 21:04:08 EDT
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 15:53:18 EST

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

Note You need to log in before you can comment on or make changes to this bug.