=== JanC is now known as Guest76305 === JanC_ is now known as JanC === chihchun_afk is now known as chihchun === chihchun is now known as chihchun_afk === chihchun_afk is now known as chihchun === BlackMage_ is now known as BlackMage [06:48] http://blog.launchpad.net/code/git-to-git-imports [08:20] \o/ [14:30] cjwatson: great work! [16:17] Hi! I am trying to get a list of all versions of a package from the name of a package, but I can't find anything in the API to do this [16:18] I can do it in the web UI, but I can't find the equivalent in the API [16:18] Basically this page, except in API accessible form: https://launchpad.net/ubuntu/precise/amd64/libreoffice-l10n-ja [16:19] that's not 'all' versions of a package, though [16:19] that's all versions published in a series [16:20] Not sure what you mean by series (new to this), but I am looking for all versions within an arch/ubuntu_release tuple [16:20] series ~ target in launchpad parlance, the various releases of ubuntu [16:20] Thats fine. I really only want all the versions in amd64/all trusty for now [16:21] I'm not sure if there is a more efficient way to do it, but you can do, something like: [16:22] launchpad.distributions['ubuntu'].main_archive.getPublishedSources [I think there is an equivalent for binary packages] [16:22] and that function takes arguments like 'source_name' (to filter it) [16:22] and then you'd iterate over the returned objects to extract the data you want [16:23] Hmm, I haven't been able to get the python library working yet. It seems to explode in python3 [16:23] tabletcorry: i'm using it pretty heavily with python3 [16:23] interesting... [16:23] tabletcorry: have a backtrace? [16:24] yup, just a sec. Need to scrub some details [16:24] tabletcorry: sure [16:24] tabletcorry: someone else may be able to help better than I, I'm not a LP expert, but have been using launchpadlib quite a bit lately [16:25] It dies when I try to pip install it https://www.irccloud.com/pastebin/wBPXzzm0/ [16:26] One of it's dependencies just plain has invalid syntax for python3 :| [16:26] tabletcorry: are you on ubuntu now? (just wondering) [16:27] Uh, yessss, I know where you are going. But I need this to work on osx too [16:27] tabletcorry: ok :) [16:27] But that would work for seeing the calls it makes I suppose [16:27] tabletcorry: let me look at that dep issue [16:27] tabletcorry: i did fix that in ubuntu, iirc [16:27] tabletcorry: or suggested the fix, at least [16:27] Your point is valid though. I can test it on ubuntu, and use tcpdump to borrow the API calls it makes [16:28] tabletcorry: ok, i htink it's a pip issue, but not sure [16:28] tabletcorry: per the changelog, upstream added python3 support in 0.13.4 [16:28] 0.13.4 isn't installable in pip for some reason. I noticed that last night [16:28] tabletcorry: very strange :/ [16:29] Its definitely not in pypi [16:29] though pypi claims to have 0.13.3, which pip also doesn't see [16:31] tabletcorry: out of my depth again :) -- but yeah if those versions aren't available, that seems like a pretty big issue; maybe you can contact the upstream lazr maintainer? [16:31] tabletcorry: You probably want Archive.getPublishedBinaries [16:31] cjwatson: thanks, was going to look that up next [16:31] https://launchpad.net/+apidoc/devel.html#archive-getPublishedBinaries [16:33] cjwatson: could you possibly give me a sample of what a working URL would look like for that endpoint? The lack of examples makes it tricky for a new user to figure out what the variables should be [16:33] And re the lazr.restfulclient python3 bug, that's indeed fixed in 0.13.4, I need to check why that didn't make it to PyPI - I think there was a further set of bug-fixes I was going to release as 0.13.5 [16:33] tabletcorry: Can you use launchpadlib with Python 2 instead? It's well-tested there [16:33] I tend to just get unhelpful errors: "Object: , name: u'+archive'" [16:33] And really much easier to use launchpadlib if you can [16:33] cjwatson: I am in a python3 app, so my hands are tied there [16:34] https://help.launchpad.net/API/Hacking has general advice [16:34] https://api.launchpad.net/devel/ubuntu/+archive/primary would be the base URL for the Ubuntu primary archive [16:36] curl 'https://api.launchpad.net/devel/ubuntu/+archive/primary?ws.op=getPublishedBinaries&binary_name=libreoffice-l10n-ja&order_by_date=true' | jq for example [16:36] but you then need to follow the next_collection_link links, since large responses are batched [16:36] Thanks for that sample. I haven't seen an API like this before (more used to REST stuff) [16:37] It is allegedly REST, just a fairly weird implementation of it ... [16:37] I was about to ask what the heck a custom get method was, so without that link I would never have guessed :) [16:38] ws.op specifies the method name [16:39] Yeah, I don't really want to make this work by hand. I will try checking out the lazr package directly and use it in python if I can [16:39] hopefully I can get it to be happy in python3 [16:39] BTW, reading back, you also don't need tcpdump - you can use the profiling approach in https://help.launchpad.net/API/launchpadlib#Three_things_to_make_your_client_faster which will dump requests [16:40] True, that would be easier. But I will leave that as a last ditch, if I can't get the library to work [16:40] I'll try to get to a lazr.restfulclient release soon. I think the reason I hadn't was that I needed to test my fix for https://bugs.launchpad.net/lazr.restfulclient/+bug/1473577 [16:40] Ubuntu bug 1473577 in lazr.restfulclient "Python 3.5 test failures" [High,In progress] [16:41] Its odd that I can't even see 0.13.3 in pip, even though its in pypi [16:42] I think that's because it doesn't declare Python 3 support? [16:42] I bet it would show up in pip2 [16:42] does 0.13.1 declare support? Or is it going back to a null case? [16:43] There was no Python 3 support at all until 0.13.4 [16:43] Sure, just curious why pip will pull 0.13.1, but nothing newer. Its not really important though [16:43] Weird [16:44] It was done by a contributor rather than one of the core Launchpad team, so we dropped the ball a bit on the PyPI upload, then discovered that the port had some problems and wanted to chase down why they weren't caught ... [16:44] Anyway, will try to get it fixed up [16:44] Thanks for the help! I think I am set now [16:44] Sorry for the awkwardness! [16:44] At least you have an API :) I was having horrible flashbacks to an HTTP crawl I had to do in the past [16:45] Yeah, we're not quite that bad [16:56] Hmm, there is another python3 break in 0.13.4's deps [16:58] lazr.restfulclient imports oauth with is not python3 compatible [17:00] It does, but I think you can get away with that except for the test suite [17:01] That's one of the problems, we have a partial port but it's not enough to run the full test suite, which makes it difficult to ensure that everything works [17:02] even the basic import "from launchpadlib.launchpad import Launchpad" explodes if you do or don't have oauth [17:02] so not sure how to get around that [17:02] may just start using the api directly [17:31] Hmm, how did this work for anyone in Ubuntu [17:31] Oh [17:31] http://launchpadlibrarian.net/179633001/python-oauth_1.0.1-3build2_1.0.1-4.diff.gz [17:32] Apparently oauth works if you shove use_2to3=True into setup.py [17:34] Yep. So I think you just need to tell pip to use a local fork of oauth with that change [17:35] tabletcorry: ^- [17:35] yeah, it seems ubuntu did a decent bit of massaging to make it work in ubuntu :) === JanC_ is now known as JanC