/srv/irclogs.ubuntu.com/2016/11/16/#launchpad.txt

=== 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
cjwatsonhttp://blog.launchpad.net/code/git-to-git-imports06:48
axino\o/08:20
sigmaviruscjwatson: great work!14:30
tabletcorryHi! 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 this16:17
tabletcorryI can do it in the web UI, but I can't find the equivalent in the API16:18
tabletcorryBasically this page, except in API accessible form: https://launchpad.net/ubuntu/precise/amd64/libreoffice-l10n-ja16:18
naccthat's not 'all' versions of a package, though16:19
naccthat's all versions published in a series16:19
tabletcorryNot sure what you mean by series (new to this), but I am looking for all versions within an arch/ubuntu_release tuple16:20
naccseries ~ target in launchpad parlance, the various releases of ubuntu16:20
tabletcorryThats fine. I really only want all the versions in amd64/all trusty for now16:20
naccI'm not sure if there is a more efficient way to do it, but you can do, something like:16:21
nacclaunchpad.distributions['ubuntu'].main_archive.getPublishedSources [I think there is an equivalent for binary packages]16:22
naccand that function takes arguments like 'source_name' (to filter it)16:22
naccand then you'd iterate over the returned objects to extract the data you want16:22
tabletcorryHmm, I haven't been able to get the python library working yet. It seems to explode in python316:23
nacctabletcorry: i'm using it pretty heavily with python316:23
tabletcorryinteresting...16:23
nacctabletcorry: have a backtrace?16:23
tabletcorryyup, just a sec. Need to scrub some details16:24
nacctabletcorry: sure16:24
nacctabletcorry: someone else may be able to help better than I, I'm not a LP expert, but have been using launchpadlib quite a bit lately16:24
tabletcorryIt dies when I try to pip install it https://www.irccloud.com/pastebin/wBPXzzm0/16:25
tabletcorryOne of it's dependencies just plain has invalid syntax for python3 :|16:26
nacctabletcorry: are you on ubuntu now? (just wondering)16:26
tabletcorryUh, yessss, I know where you are going. But I need this to work on osx too16:27
nacctabletcorry: ok :)16:27
tabletcorryBut that would work for seeing the calls it makes I suppose16:27
nacctabletcorry: let me look at that dep issue16:27
nacctabletcorry: i did fix that in ubuntu, iirc16:27
nacctabletcorry: or suggested the fix, at least16:27
tabletcorryYour point is valid though. I can test it on ubuntu, and use tcpdump to borrow the API calls it makes16:27
nacctabletcorry: ok, i htink it's a pip issue, but not sure16:28
nacctabletcorry: per the changelog, upstream added python3 support in 0.13.416:28
tabletcorry0.13.4 isn't installable in pip for some reason. I noticed that last night16:28
nacctabletcorry: very strange :/16:28
tabletcorryIts definitely not in pypi16:29
tabletcorrythough pypi claims to have 0.13.3, which pip also doesn't see16:29
nacctabletcorry: 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
cjwatsontabletcorry: You probably want Archive.getPublishedBinaries16:31
nacccjwatson: thanks, was going to look that up next16:31
cjwatsonhttps://launchpad.net/+apidoc/devel.html#archive-getPublishedBinaries16:31
tabletcorrycjwatson: 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 be16:33
cjwatsonAnd 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.516:33
cjwatsontabletcorry: Can you use launchpadlib with Python 2 instead?  It's well-tested there16:33
tabletcorryI tend to just get unhelpful errors: "Object: <DistroSeries u'precise'>, name: u'+archive'"16:33
cjwatsonAnd really much easier to use launchpadlib if you can16:33
tabletcorrycjwatson: I am in a python3 app, so my hands are tied there16:33
cjwatsonhttps://help.launchpad.net/API/Hacking has general advice16:34
cjwatsonhttps://api.launchpad.net/devel/ubuntu/+archive/primary would be the base URL for the Ubuntu primary archive16:34
cjwatsoncurl 'https://api.launchpad.net/devel/ubuntu/+archive/primary?ws.op=getPublishedBinaries&binary_name=libreoffice-l10n-ja&order_by_date=true' | jq     for example16:36
cjwatsonbut you then need to follow the next_collection_link links, since large responses are batched16:36
tabletcorryThanks for that sample. I haven't seen an API like this before (more used to REST stuff)16:36
cjwatsonIt is allegedly REST, just a fairly weird implementation of it ...16:37
tabletcorryI was about to ask what the heck a custom get method was, so without that link I would never have guessed :)16:37
cjwatsonws.op specifies the method name16:38
tabletcorryYeah, 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 can16:39
tabletcorryhopefully I can get it to be happy in python316:39
cjwatsonBTW, 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 requests16:39
tabletcorryTrue, that would be easier. But I will leave that as a last ditch, if I can't get the library to work16:40
cjwatsonI'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/147357716:40
ubot5`Ubuntu bug 1473577 in lazr.restfulclient "Python 3.5 test failures" [High,In progress]16:40
tabletcorryIts odd that I can't even see 0.13.3 in pip, even though its in pypi16:41
cjwatsonI think that's because it doesn't declare Python 3 support?16:42
cjwatsonI bet it would show up in pip216:42
tabletcorrydoes 0.13.1 declare support? Or is it going back to a null case?16:42
cjwatsonThere was no Python 3 support at all until 0.13.416:43
tabletcorrySure, just curious why pip will pull 0.13.1, but nothing newer. Its not really important though16:43
cjwatsonWeird16:43
cjwatsonIt 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
cjwatsonAnyway, will try to get it fixed up16:44
tabletcorryThanks for the help! I think I am set now16:44
cjwatsonSorry for the awkwardness!16:44
tabletcorryAt least you have an API :) I was having horrible flashbacks to an HTTP crawl I had to do in the past16:44
cjwatsonYeah, we're not quite that bad16:45
tabletcorryHmm, there is another python3 break in 0.13.4's deps16:56
tabletcorrylazr.restfulclient imports oauth with is not python3 compatible16:58
cjwatsonIt does, but I think you can get away with that except for the test suite17:00
cjwatsonThat'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 works17:01
tabletcorryeven the basic import "from launchpadlib.launchpad import Launchpad" explodes if you do or don't have oauth17:02
tabletcorryso not sure how to get around that17:02
tabletcorrymay just start using the api directly17:02
cjwatsonHmm, how did this work for anyone in Ubuntu17:31
cjwatsonOh17:31
cjwatsonhttp://launchpadlibrarian.net/179633001/python-oauth_1.0.1-3build2_1.0.1-4.diff.gz17:31
cjwatsonApparently oauth works if you shove use_2to3=True into setup.py17:32
cjwatsonYep.  So I think you just need to tell pip to use a local fork of oauth with that change17:34
cjwatsontabletcorry: ^-17:35
tabletcorryyeah, it seems ubuntu did a decent bit of massaging to make it work in ubuntu :)17:35
=== JanC_ is now known as JanC

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!