[06:48] <cjwatson> http://blog.launchpad.net/code/git-to-git-imports
[08:20] <axino> \o/
[14:30] <sigmavirus> cjwatson: great work!
[16:17] <tabletcorry> 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] <tabletcorry> I can do it in the web UI, but I can't find the equivalent in the API
[16:18] <tabletcorry> Basically this page, except in API accessible form: https://launchpad.net/ubuntu/precise/amd64/libreoffice-l10n-ja
[16:19] <nacc> that's not 'all' versions of a package, though
[16:19] <nacc> that's all versions published in a series
[16:20] <tabletcorry> 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] <nacc> series ~ target in launchpad parlance, the various releases of ubuntu
[16:20] <tabletcorry> Thats fine. I really only want all the versions in amd64/all trusty for now
[16:21] <nacc> I'm not sure if there is a more efficient way to do it, but you can do, something like:
[16:22] <nacc> launchpad.distributions['ubuntu'].main_archive.getPublishedSources [I think there is an equivalent for binary packages]
[16:22] <nacc> and that function takes arguments like 'source_name' (to filter it)
[16:22] <nacc> and then you'd iterate over the returned objects to extract the data you want
[16:23] <tabletcorry> Hmm, I haven't been able to get the python library working yet. It seems to explode in python3
[16:23] <nacc> tabletcorry: i'm using it pretty heavily with python3
[16:23] <tabletcorry> interesting...
[16:23] <nacc> tabletcorry: have a backtrace?
[16:24] <tabletcorry> yup, just a sec. Need to scrub some details
[16:24] <nacc> tabletcorry: sure
[16:24] <nacc> 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] <tabletcorry> It dies when I try to pip install it https://www.irccloud.com/pastebin/wBPXzzm0/
[16:26] <tabletcorry> One of it's dependencies just plain has invalid syntax for python3 :|
[16:26] <nacc> tabletcorry: are you on ubuntu now? (just wondering)
[16:27] <tabletcorry> Uh, yessss, I know where you are going. But I need this to work on osx too
[16:27] <nacc> tabletcorry: ok :)
[16:27] <tabletcorry> But that would work for seeing the calls it makes I suppose
[16:27] <nacc> tabletcorry: let me look at that dep issue
[16:27] <nacc> tabletcorry: i did fix that in ubuntu, iirc
[16:27] <nacc> tabletcorry: or suggested the fix, at least
[16:27] <tabletcorry> Your point is valid though. I can test it on ubuntu, and use tcpdump to borrow the API calls it makes
[16:28] <nacc> tabletcorry: ok, i htink it's a pip issue, but not sure
[16:28] <nacc> tabletcorry: per the changelog, upstream added python3 support in 0.13.4
[16:28] <tabletcorry> 0.13.4 isn't installable in pip for some reason. I noticed that last night
[16:28] <nacc> tabletcorry: very strange :/
[16:29] <tabletcorry> Its definitely not in pypi
[16:29] <tabletcorry> though pypi claims to have 0.13.3, which pip also doesn't see
[16:31] <nacc> 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] <cjwatson> tabletcorry: You probably want Archive.getPublishedBinaries
[16:31] <nacc> cjwatson: thanks, was going to look that up next
[16:31] <cjwatson> https://launchpad.net/+apidoc/devel.html#archive-getPublishedBinaries
[16:33] <tabletcorry> 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] <cjwatson> 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] <cjwatson> tabletcorry: Can you use launchpadlib with Python 2 instead?  It's well-tested there
[16:33] <tabletcorry> I tend to just get unhelpful errors: "Object: <DistroSeries u'precise'>, name: u'+archive'"
[16:33] <cjwatson> And really much easier to use launchpadlib if you can
[16:33] <tabletcorry> cjwatson: I am in a python3 app, so my hands are tied there
[16:34] <cjwatson> https://help.launchpad.net/API/Hacking has general advice
[16:34] <cjwatson> https://api.launchpad.net/devel/ubuntu/+archive/primary would be the base URL for the Ubuntu primary archive
[16:36] <cjwatson> 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] <cjwatson> but you then need to follow the next_collection_link links, since large responses are batched
[16:36] <tabletcorry> Thanks for that sample. I haven't seen an API like this before (more used to REST stuff)
[16:37] <cjwatson> It is allegedly REST, just a fairly weird implementation of it ...
[16:37] <tabletcorry> I was about to ask what the heck a custom get method was, so without that link I would never have guessed :)
[16:38] <cjwatson> ws.op specifies the method name
[16:39] <tabletcorry> 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] <tabletcorry> hopefully I can get it to be happy in python3
[16:39] <cjwatson> 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] <tabletcorry> 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] <cjwatson> 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] <ubot5`> Ubuntu bug 1473577 in lazr.restfulclient "Python 3.5 test failures" [High,In progress]
[16:41] <tabletcorry> Its odd that I can't even see 0.13.3 in pip, even though its in pypi
[16:42] <cjwatson> I think that's because it doesn't declare Python 3 support?
[16:42] <cjwatson> I bet it would show up in pip2
[16:42] <tabletcorry> does 0.13.1 declare support? Or is it going back to a null case?
[16:43] <cjwatson> There was no Python 3 support at all until 0.13.4
[16:43] <tabletcorry> Sure, just curious why pip will pull 0.13.1, but nothing newer. Its not really important though
[16:43] <cjwatson> Weird
[16:44] <cjwatson> 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] <cjwatson> Anyway, will try to get it fixed up
[16:44] <tabletcorry> Thanks for the help! I think I am set now
[16:44] <cjwatson> Sorry for the awkwardness!
[16:44] <tabletcorry> At least you have an API :) I was having horrible flashbacks to an HTTP crawl I had to do in the past
[16:45] <cjwatson> Yeah, we're not quite that bad
[16:56] <tabletcorry> Hmm, there is another python3 break in 0.13.4's deps
[16:58] <tabletcorry> lazr.restfulclient imports oauth with is not python3 compatible
[17:00] <cjwatson> It does, but I think you can get away with that except for the test suite
[17:01] <cjwatson> 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] <tabletcorry> even the basic import "from launchpadlib.launchpad import Launchpad" explodes if you do or don't have oauth
[17:02] <tabletcorry> so not sure how to get around that
[17:02] <tabletcorry> may just start using the api directly
[17:31] <cjwatson> Hmm, how did this work for anyone in Ubuntu
[17:31] <cjwatson> Oh
[17:31] <cjwatson> http://launchpadlibrarian.net/179633001/python-oauth_1.0.1-3build2_1.0.1-4.diff.gz
[17:32] <cjwatson> Apparently oauth works if you shove use_2to3=True into setup.py
[17:34] <cjwatson> Yep.  So I think you just need to tell pip to use a local fork of oauth with that change
[17:35] <cjwatson> tabletcorry: ^-
[17:35] <tabletcorry> yeah, it seems ubuntu did a decent bit of massaging to make it work in ubuntu :)