Python2 plugin deprecated, but new plugin not documented?
Sergio Schvezov
sergio.schvezov at canonical.com
Tue Oct 4 11:32:18 UTC 2016
El 03/10/16 a las 23:59, Marco Ceppi escribió:
>
>
> On Mon, Oct 3, 2016 at 9:41 PM Sergio Schvezov
> <sergio.schvezov at canonical.com <mailto:sergio.schvezov at canonical.com>>
> wrote:
>
> El 03/10/16 a las 21:17, Marco Ceppi escribió:
>
>> On Mon, Oct 3, 2016 at 6:51 PM Sergio Schvezov
>> <sergio.schvezov at canonical.com
>> <mailto:sergio.schvezov at canonical.com>> wrote:
>>
>>
>>
>> El 03/10/16 a las 16:47, Marco Ceppi escribió:
>> > Hi Sergio,
>> >
>> > Sorry, replication instructions are as follows:
>> >
>> > export JUJU_REPOSITORY=$(mktemp -dp $HOME)
>> > cd $JUJU_REPOSITORY
>> > charm pull-source ~marcoceppi/charm-svg .
>> >
>> > This will trigger the error. Anytime the code path needs to
>> interact
>> > with launchpadlib it fails. If you pull the stable channel
>> from the
>> > store you'll see it succeeds.
>>
>> Did this ever work?
>> dpkg -S /usr/lib/python2.7/dist-packages/lazr/__init__.py
>>
>>
>> It did (and does work) before I updated snapcraft.
>>
>> Tells me it is not owned by any package so very unlikely that a
>> `stage-packages entry would of brought it in. I am interested!
>>
>> For what it's worth, Kyle had the same issue and we just went
>> to pypi
>> for this, if you prefer going down this path just add this to
>> the python
>> part in there:
>>
>> python-packages: [launchpadlib, simplejson]
>>
>>
>> Launchpadlib is already a dependency in the software project, I
>> shouldn't need to declare it again in the snapcraft?
>
> No you don't ;-) You want to set `requirements: requirements.txt`
> If you want it automatically installed use install_requires
> (https://packaging.python.org/requirements/)
>
> In my projects setup.py I declare the install_requires, why aren't
> these being included during snap generation?
>
> https://github.com/juju/charm-tools/blob/master/setup.py
Ok this at least provides an explanation for me, long story short, you
can remove python-launchpadlib from `stage-packages`, but
lazr.restfulclient is missing a dependency on simplejson in
install_requires so you can add that to yours temporarily until the dep
is added there.
http://bazaar.launchpad.net/~lazr-developers/lazr.restfulclient/trunk/view/head:/setup.py#L55
By using launchpadlib as a stage package here is why you got it:
Depends: python-httplib2 (>= 0.4.0), python-keyring (>= 0.5),
python-lazr.restfulclient (>= 0.11.2),
python-lazr.uri (>= 1.0.2-4~), python-oauth, python-simplejson,
python-wadllib, python:any (<< 2.8),
python:any (>= 2.7.5-5~)
You can still use the launchpadlib as a stage-packages entry if you want
but you will need to `touch __init__.py` where it is missing (I will
discuss further with Barry to see if there is a clean way we can do this
automatically with no side effects).
And last but not least, here is the reason it worked; the previous
version of the python plugins put dist-packages and site-packages all in
the same bag, installed the stage-package and then ignored what was
already there and installed what was in your install_requires; so on the
first run you'd get an incomplete lazr package but you would get
simplejson and on the second run you'd install over. The new plugin is
much more respectful about this.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/snapcraft/attachments/20161004/83238b4b/attachment.html>
More information about the Snapcraft
mailing list