https://bugzilla.wikimedia.org/show_bug.cgi?id=56386
Web browser: --- Bug ID: 56386 Summary: setup.py should require httplib2 Product: Pywikibot Version: core (2.0) Hardware: All OS: All Status: UNCONFIRMED Severity: normal Priority: Unprioritized Component: General Assignee: Pywikipedia-bugs@lists.wikimedia.org Reporter: kikkocristian@gmail.com Classification: Unclassified Mobile Platform: ---
Created attachment 13632 --> https://bugzilla.wikimedia.org/attachment.cgi?id=13632&action=edit Test script
Running <code>python setup.py install</code> while in virtualenv does not install automatically the httplib2 dependency.
<code> (pywikibot)cristian@cristian-F5N:~$ python test.py "Alessandro_Manzoni" Traceback (most recent call last): File "test.py", line 4, in <module> import pywikibot File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/__init__.py", line 313, in <module> from page import Page, ImagePage, Category, Link, User, ItemPage, PropertyPage, Claim File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 16, in <module> import pywikibot.site File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/site.py", line 33, in <module> from pywikibot.data import api File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/data/api.py", line 13, in <module> from pywikibot.comms import http File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/comms/http.py", line 30, in <module> from httplib2 import SSLHandshakeError ImportError: No module named httplib2 </code>
<code>test.py</code> is attached.
I am using Python 2.7.3 under <code>virtualenv</code> version 1.9.1 on Ubuntu 12.10.
Furthermore installing the dependency with <code>pip install httplib2</code> cause the following bug.
<code> (pywikibot)cristian@cristian-F5N:~$ python test.py "Alessandro_Manzoni" ERROR: Traceback (most recent call last): File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/data/api.py", line 284, in submit body=paramstring) File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/comms/http.py", line 123, in request raise FatalServerError(str(request.data)) FatalServerError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed
Traceback (most recent call last): File "test.py", line 12, in <module> item = pywikibot.ItemPage.fromPage(wikipage) File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 2527, in fromPage repo = page.site.data_repository() File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 98, in site return self._link.site File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 3224, in site self.parse() File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/page.py", line 3207, in parse if self._site.case() == 'first-letter': File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/site.py", line 1173, in case return self.siteinfo['case'] File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/site.py", line 1167, in siteinfo self._getsiteinfo() File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/site.py", line 1100, in _getsiteinfo sidata = sirequest.submit() File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/data/api.py", line 462, in submit self._data = super(CachedRequest, self).submit() File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/data/api.py", line 284, in submit body=paramstring) File "/home/cristian/.virtualenvs/pywikibot/local/lib/python2.7/site-packages/pywikibot/comms/http.py", line 123, in request raise FatalServerError(str(request.data)) pywikibot.exceptions.FatalServerError: [Errno 1] _ssl.c:504: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed </code>
Steps to reproduce: * download core.tar.gz and unzip * create virtualenv * run <code>python setup.py install</code> from <code>core</code> * run <code>python test.py "Alessandro_Manzoni"</code>
https://bugzilla.wikimedia.org/show_bug.cgi?id=56386
--- Comment #1 from Cristian Consonni kikkocristian@gmail.com --- Of course installing the right dependency:
pip install https://git.wikimedia.org/zip/?r=pywikibot/externals/httplib2.git&format...
Solves the issue. This should be automatic.
https://bugzilla.wikimedia.org/show_bug.cgi?id=56386
--- Comment #2 from Merlijn van Deen valhallasw@arctus.nl --- I'm confused by this, as setup.py /does/ require httplib2:
install_requires=[ 'httplib2>=0.6.0' ], dependency_links=[
'https://git.wikimedia.org/zip/?r=pywikibot/externals/httplib2.git&format...' ],
Which core.tar.gz did you download? http://tools.wmflabs.org/pywikibot/core.tar.gz , or some other version?
https://bugzilla.wikimedia.org/show_bug.cgi?id=56386
--- Comment #3 from Merlijn van Deen valhallasw@arctus.nl --- Created attachment 13633 --> https://bugzilla.wikimedia.org/attachment.cgi?id=13633&action=edit install log
OK, I can reproduce it:
wget http://tools.wmflabs.org/pywikibot/core.tar.gz tar -xvzf core.tar.gz cd core virtualenv . source bin/activate python setup.py install | tee installog
results in the attached installog, and not in a working httplib2...
https://bugzilla.wikimedia.org/show_bug.cgi?id=56386
--- Comment #4 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 92765 had a related patch set uploaded by Merlijn van Deen: Fix dependency installation during setup.py install
https://gerrit.wikimedia.org/r/92765
https://bugzilla.wikimedia.org/show_bug.cgi?id=56386
Gerrit Notification Bot gerritadmin@wikimedia.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |PATCH_TO_REVIEW Ever confirmed|0 |1
https://bugzilla.wikimedia.org/show_bug.cgi?id=56386
--- Comment #5 from Gerrit Notification Bot gerritadmin@wikimedia.org --- Change 92765 merged by jenkins-bot: Fix dependency installation during setup.py install
https://gerrit.wikimedia.org/r/92765
https://bugzilla.wikimedia.org/show_bug.cgi?id=56386
Merlijn van Deen valhallasw@arctus.nl changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|PATCH_TO_REVIEW |RESOLVED Resolution|--- |FIXED
pywikipedia-bugs@lists.wikimedia.org