launchpadlib not compatible with latest version of httplib2

Bug #1803558 reported by Ben on 2018-11-15
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
lazr.restfulclient
High
Colin Watson

Bug Description

launchpadlib 1.10.6 (latest) is not compatible with the latest version of httplib2 0.12.0.

httplib2 0.12.0 has removed httplib2.re_slash, thus preventing launchpadlib from being imported:

## ERROR ###############################################################################

Running Python 3.6.6 on Kubuntu 18.04.1

$ pip install launchpadlib

$ python -c "from launchpadlib.launchpad import Launchpad"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/ben/envs/tmp-259ccbfb9717a89/lib/python3.6/site-packages/launchpadlib/launchpad.py", line 38, in <module>
    from lazr.restfulclient.resource import (
  File "/home/ben/envs/tmp-259ccbfb9717a89/lib/python3.6/site-packages/lazr/restfulclient/resource.py", line 68, in <module>
    from lazr.restfulclient._browser import Browser, RestfulHttp
  File "/home/ben/envs/tmp-259ccbfb9717a89/lib/python3.6/site-packages/lazr/restfulclient/_browser.py", line 85, in <module>
    from httplib2 import _md5, re_url_scheme, re_slash
ImportError: cannot import name 're_slash'

# SUCCESS ###############################################################################

However if an older version of httplib2 is specified first

$ pip install httplib2==0.11.3 launchpadlib

$ python -c "from launchpadlib.launchpad import Launchpad"

Related branches

Colin Watson (cjwatson) on 2018-11-16
affects: launchpadlib → lazr.restfulclient
Changed in lazr.restfulclient:
assignee: nobody → Colin Watson (cjwatson)
importance: Undecided → High
status: New → In Progress
Colin Watson (cjwatson) wrote :

Fixed in lazr.restfulclient 0.14.1.

Changed in lazr.restfulclient:
status: In Progress → Fix Released
Sorin Sbarnea (ssbarnea) wrote :

Out of curiosity where can I see the CI results on master branch of lazr.restfulclient? Thanks.

Colin Watson (cjwatson) wrote :

I'm afraid we don't have proper CI set up yet - I just run tox by hand. (It's particularly awkward because the test suite uses stuff like lazr.restful that hasn't been ported to Python 3 yet.)

Sorin Sbarnea (ssbarnea) wrote :

Would it be too much to question why not moving this to gihub so we could use travis and pull requests? It would make testing and contributing much easier (and less human "demanding").

Sorin Sbarnea (ssbarnea) wrote :

I am asking this because I am trying to add support for py3 on elastic-recheck via https://review.openstack.org/#/c/616578/ which is currentl blocked by a long dependency chain:

elastic-recheck -> launchpadlib -> httplib2 -> lazr.restfulclient

None of mentioned dependencies have a github/travis presense which means that is very hard to make contributons to them.

PS. I am not a big fun of github/PRs as i preffer gerrit/CRs but I realise that is much easier to setup CI for github.

Colin Watson (cjwatson) wrote :

My personal view is that hosting a critical Launchpad-specific component not on Launchpad is just too silly.

What exactly is blocking you in terms of launchpadlib/lazr.restfulclient? The failure logs I could find from your link didn't seem to have much to do with launchpadlib, but I may be missing something.

Sorin Sbarnea (ssbarnea) wrote :

Is true, few minutes ago I managed to make it work under py36/py37 so I no longer need any other change.

I can see your concern about external to LP, while it can sort some problem it could create many more. Maybe switching from bzr to git in linger run would be a nice step, as i see it as supported https://help.launchpad.net/Code/Git#Converting_from_Bazaar_to_Git

And thanks for helping with that!

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers