Edgewall Software
Modify

Opened 18 years ago

Closed 14 years ago

#4994 closed defect (worksforme)

Restructured Text fails to load - pkg_resources can not "require" legacy modules

Reported by: tjb@… Owned by: Jonas Borgström
Priority: normal Milestone:
Component: rendering Version: devel
Severity: normal Keywords: docutils setuptools
Cc: a.badger@…, hyugaricdeau@…, v.oostveen@…, Thijs Triemstra Branch:
Release Notes:
API Changes:
Internal Changes:

Description

My previously working restructured text is no longer working - I cannot say exactly when it stopped, but sometime in the last few months I think.

The system is that Restructured Text is not rendered.

We are running trac r5110, and I have tried this with docutils 0.4, and docutils 0.3.9
We were previously running docutils 0.3.3, and upgraded to try to solve the problem.

The log file shows this:

    ERROR: Skipping "trac.mimeview.rst = trac.mimeview.rst [rest]": ("docutils >= 0.3" not found)

I have found similar defects (closed) in the past, but the loader code has changed again (regression?)

Attachments (0)

Change History (10)

comment:1 by Alec Thomas, 18 years ago

This could be because setuptools is not aware of docutils. For example, on my system, with the stock Ubuntu docutils .deb I get this:

>>> import pkg_resources
>>> pkg_resources.require('docutils')
---------------------------------------------------------------------------
pkg_resources.DistributionNotFound                      Traceback (most recent call last)
...
DistributionNotFound: docutils
>>> import docutils
>>>

Try installing docutils with easy_install and see if that works:

$ sudo easy_install docutils
... <snipped> ...
Installed /usr/lib/python2.4/site-packages/docutils-0.4-py2.4.egg
Processing dependencies for docutils
$ ipython
>>> import pkg_resources
>>> pkg_resources.require('docutils>=0.3')
[docutils 0.4 (/usr/lib/python2.4/site-packages/docutils-0.4-py2.4.egg)]
>>> pkg_resources.require('docutils')
[docutils 0.4 (/usr/lib/python2.4/site-packages/docutils-0.4-py2.4.egg)]
>>> 

comment:2 by tjb@…, 18 years ago

Resolution: invalid
Status: newclosed

Thanks, that fixed it.

Since this was more or less a deficiency in my python setup, I have closed this as invalid.

comment:3 by Alec Thomas, 18 years ago

Milestone: 0.11
Resolution: invalid
Status: closedreopened
Summary: Restructured Text fails to loadRestructured Text fails to load - pkg_resources can not "require" legacy modules

I'm going to reopen the ticket because this will be a problem users come across often I suspect.

Basically anybody using their system package management for installing dependencies will encounter this problem.

I guess we can just say "use easy_install trac" and be done with it.

comment:4 by a.badger@…, 17 years ago

Cc: a.badger@… added

As the docutils packager for Fedora, our position so far has been that upstream (in this case, docutils) is making a choice of whether they want to provide a setuptools "API" or not. Relying on docutils having egg information when upstream does not just seems wrong to us. We're currently rewriting our egg packaging guidelines so there is room to change this but it would need some strong arguments from people as to why this should be changed. Preferably, those arguments would be persuasive, not just to Fedora, but also to the greater *nix community. That way the use of egginfo would become standardized across all Linux distros and *nix variants and you wouldn't have to worry about why the software works on some installations and not others.

comment:5 by a.badger@…, 17 years ago

Forgot to add the most important bit:

So if you have arguments for why installing egginfo for upstreams that don't support them is the right thing to do, please let me know :-)

comment:6 by hyuga <hyugaricdeau@…>, 17 years ago

Cc: hyugaricdeau@… added

comment:7 by a.badger@…, 17 years ago

Okay. After much discussion in Fedora, we've decided that adding egg-info is the right thing to do. So you can change our position from "Not unless upstream provides the egg-info" to "Yes, as long as it is installed via setuptools or distutils" and someone requests it.

For me, one of the major reasons was that vanilla python-2.5 will provide egg-info for any distutils using project. In our python2.5 version on F-7 and F-8, this is disabled but we're going to try adding this back in for Fedora 9 (development is starting next month… Should be out in ~7 months). when that happens, things like distutils will have egginfo out of the box. Until then, opening a bug in Fedora that requests egginfo should be enough for us to put together a package that supports it.

Note, that this will help Fedora but other distributions (For instance RHEL 4) which have to change as little as possible due to stability guarantees or distributions which don't adopt a policy similar to ours will still be affected by this.

Link to the Fedora packaging guideline that addresses this:

http://fedoraproject.org/wiki/Packaging/Python/Eggs

comment:8 by anonymous, 17 years ago

Cc: v.oostveen@… added

comment:9 by Thijs Triemstra, 14 years ago

Cc: Thijs Triemstra added

comment:10 by Christian Boos, 14 years ago

Component: generalrendering
Keywords: docutils setuptools added
Milestone: next-minor-0.12.x
Resolution: worksforme
Status: reopenedclosed

Well, those days easy_install docutils is the standard way to install docutils, so this should no longer be an issue.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.