Bug 502502

Summary: mwlib should pull python-setuptools
Product: [Fedora] Fedora EPEL Reporter: Michal Nowak <mnowak>
Component: python-mwlibAssignee: Jasper Capel <fedora-jasper>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: el5CC: fedora-jasper, goetz.dirk, jason, jcapel, ohudlick
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: ActualBug
Fixed In Version: python-qserve-0.2.7-1.fc17 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-28 10:42:15 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
ODF-Patch from Bug 486678 without require-changes
none
Patch to remove requires
none
Changed Specfile none

Description Michal Nowak 2009-05-25 14:38:27 UTC
Description of problem:

Installed mwlib and ran it:

[root@hp-ml370g4-01 candcplusplus]# mw-render -c http://fedoraproject.org/w/ -w docbook Some_wiki_page -o Some_wiki_page.xml
Traceback (most recent call last):
  File "/usr/bin/mw-render", line 5, in ?
    from pkg_resources import load_entry_point
ImportError: No module named pkg_resources

installed python-setuptools:

[root@hp-ml370g4-01 candcplusplus]# mw-render -c http://fedoraproject.org/w/ -w docbook Some_wiki_page -o Some_wiki_page.xml
Traceback (most recent call last):
  File "/usr/bin/mw-render", line 5, in ?
    from pkg_resources import load_entry_point
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 2561, in ?
    working_set.require(__requires__)
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 626, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.4/site-packages/pkg_resources.py", line 524, in resolve
    raise DistributionNotFound(req)  # XXX put more info here
pkg_resources.DistributionNotFound: elementtree>=1.2.6

But:

[root@hp-ml370g4-01 candcplusplus]# rpmquery python-elementtree
python-elementtree-1.2.6-5

(elementtree bug?)

Version-Release number of selected component (if applicable):

python-mwlib-0.9.10-5.el5

Comment 1 Jasper Capel 2009-05-26 08:44:36 UTC
Strange... I'll look into it next week.

Comment 2 Dirk Götz 2010-02-25 07:58:06 UTC
Hi, Jasper, can I bring back your interest on the bug? I am running in the same problem.

Comment 3 Jasper Capel 2010-02-25 11:02:28 UTC
I'm actually swamped at the moment. If you could look into this and maybe propose a fix, I can certainly incorporate that into the package.

Comment 4 Dirk Götz 2010-02-26 07:43:16 UTC
My python knowhow is not that great but I have a idea, please correct me if I am wrong.

I have removed the requirement from /usr/lib64/python2.4/site-packages/mwlib-0.9.10-py2.4.egg-info/requires.txt, then the next requirement was triggered wsgiref>=0.1.2, so I installed python-wsgiref, which fixed the requirement. Then I started removing all requirements which were not fixed by installing the package. Looking in the packages I have seen one mayor differences, requirements which were found have an egg-info in it, the others does not come with one.

Another problem I see are the requirements odfpy==0.7.0, which is available as odfpy-0.9-1.el5, and python-dateutil>=1.4.1, which is only available as python-dateutil-1.2-1.el5.

Tell me what you think about it!

Comment 5 Dirk Götz 2010-03-03 13:40:05 UTC
Created attachment 397557 [details]
ODF-Patch from Bug 486678 without require-changes

ODF-Patch from Bug 486678 without require-changes

Comment 6 Dirk Götz 2010-03-03 13:41:44 UTC
Created attachment 397558 [details]
Patch to remove requires

Patch to remove requires within python will be replaced through requires in rpm

Comment 7 Dirk Götz 2010-03-03 13:45:07 UTC
Created attachment 397559 [details]
Changed Specfile

Specfile to apply patches to move requirements from python to rpm

Comment 8 Dirk Götz 2010-03-03 13:53:34 UTC
I made following changes, I applied the odf-Patch from Bug 486678, removed the requirements in python and added it to rpm. This results in:
# mw-render --list-writers
sh: texvc: command not found
xhtml   XHTML 1.0 Transitional
mwxml   XML representation of the parse tree
docbook DocBook XML
odf     OpenDocument Text

#mw-render --config=http://testwiki/wiki/ --login=USER:PASSWORD --writer=odf --output=/tmp/test.odt Wikipage 
gives me a readable odt-Document

#mw-serve --cache-dir=/var/cache/mwlib/ --logfile=/var/log/mwlib/mwserve.log --mwrender-logfile=/var/log/mwlib/mwrender.log --mwzip-logfile=/var/log/mwlib/mwzip.log --mwpost-logfile=/var/log/mwlib/mwpost.log
starts a working rendering server

But I dont know if the patch to remove the requirements in python is allowed by packaging policy.

Comment 9 Jasper Capel 2010-03-03 14:21:19 UTC
If we can't avoid it to get it working then I have no issues with removing requires from setup.py (staying as close as possible to upstream would be great, but we already have the spec-file for pulling in dependencies). One thing that should be avoided, is having the build pull in python eggs on build-time, but I don't think that is happening (it should only be happening if setup.py detects it needs something external) so that's good.

To summarize, do all patches you attached to this bug need to be applied?

I will check up on this and if it's OK I'll push a test package to epel-testing first.

Comment 10 Dirk Götz 2010-03-03 14:35:51 UTC
The odf-patch is needed because of the buildin test against the odfpy-version, details you can find in the mentioned bug. The require-patch is done because it can not verify the requirements fulfilled by some rpms. So to summarize the both patches are needed. 
The changed spec shows the changes I have done to use the patches and the last Requires is added to fulfill the requirements I have found.

I hope all questions are answered and it will work for all.

Comment 11 Jason Antman 2011-05-12 17:25:48 UTC
Has anyone done any work on this? It's over a year later, and I'm running into the problems mentioned above...

Comment 12 Fedora Update System 2012-02-14 23:24:37 UTC
python-mwlib-0.13.3-4.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-mwlib-0.13.3-4.fc17

Comment 13 Fedora Update System 2012-02-14 23:26:30 UTC
python-mwlib-0.13.3-4.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/python-mwlib-0.13.3-4.fc16

Comment 14 Fedora Update System 2012-02-15 11:35:52 UTC
Package python-mwlib-0.13.3-4.fc16:
* should fix your issue,
* was pushed to the Fedora 16 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing python-mwlib-0.13.3-4.fc16'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-1698/python-mwlib-0.13.3-4.fc16
then log in and leave karma (feedback).

Comment 15 Dirk Götz 2012-02-15 12:35:40 UTC
Thanks for providing a new version. I have tried it and it fixes the issues.

mw-render --list-writers shows the odf-writer.
mw-render --config=http://testwiki/wiki/ --login=USER:PASSWORD --writer=odf
--output=/tmp/test.odt Wikipage creates a readable odf-Document.
mw-serve does not exist anymore, but scripts are available to replace its functionality with supervisor. 

But bug was created against EPEL, so is it possible to provide a newer version for EPEL5 and/or EPEL6?

Comment 16 Fedora Update System 2012-02-15 23:08:19 UTC
python-qserve-0.2.7-1.fc17, python-mwlib-0.13.4-1.fc17 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/python-qserve-0.2.7-1.fc17,python-mwlib-0.13.4-1.fc17

Comment 17 Fedora Update System 2012-02-28 10:42:15 UTC
python-qserve-0.2.7-1.fc17, python-mwlib-0.13.4-1.fc17 has been pushed to the Fedora 17 stable repository.  If problems still persist, please make note of it in this bug report.