snapping a set of python2 scripts from launchpad

John Agosta john.agosta at canonical.com
Thu Jun 16 20:12:41 UTC 2016


Ok, we can go back to our regularly scheduled program...It now works 
using a different editor...I originally used "vim" to enter the yaml, 
and it must be placing in a special character that even ":set list" does 
not expose. Thanks!


On 06/16/2016 02:06 PM, Joe Talbott wrote:
> Your example (as well as the one from snapcraft.io/create) work for me as well.
>
> Joe
>
> On Thu, Jun 16, 2016 at 4:03 PM, Daniel Manrique
> <daniel.manrique at canonical.com> wrote:
>> I copied your snapcraft.yaml and ran it through snapcraft 2.11 and it worked \o/
>>
>> Literally the only change was fixing the weird "nam   e" thing at the beginning.
>>
>> After building and installing it, both hello-debug.bash and
>> hello-debug.hello are available!
>>
>> So "works for me" :)
>>
>> On Thu, Jun 16, 2016 at 3:54 PM, John Agosta <john.agosta at canonical.com> wrote:
>>> On 06/16/2016 01:41 PM, Joe Talbott wrote:
>>>> Do you, by chance, have tabs in your YAML?  Tabs aren't allowed in YAML.
>>>>
>>> Hi Joe:
>>> I triple checked, no.  In fact, I added a tab and found the parser does
>>> check and provides a nice error when it locates a tab:
>>>         >> found character '\t' that cannot start any token on line 10 of
>>> snapcraft.yaml
>>>
>>>> On Thu, Jun 16, 2016 at 3:37 PM, John Agosta <john.agosta at canonical.com>
>>>> wrote:
>>>>> On 06/16/2016 02:19 AM, Didier Roche wrote:
>>>>>
>>>>> Le 15/06/2016 20:09, John Agosta a écrit :
>>>>>
>>>>> Hi:
>>>>>
>>>>>
>>>>> Hey John!
>>>>>
>>>>> Happy to help you there ;)
>>>>>
>>>>>
>>>>> I suspect this should be strait forward, but have been fumbling with this
>>>>> ... I have a set of python2 scripts sitting in a launchpad.net bzr branch
>>>>> that I am trying to snap up using snapcraft. These are essentially just a
>>>>> set of files (scripts) that have never been placed into any formal
>>>>> packaging
>>>>> structure.
>>>>>
>>>>> I can correctly build the python part using the structure:
>>>>>
>>>>> parts:
>>>>>       lptools:
>>>>>           plugin: python2
>>>>>           source: lp:~jagosta/my-program/lp_tools
>>>>>
>>>>> Where I am stuck is with defining the apps:, thus creating the commands
>>>>> that
>>>>> I would like to be placed into the bin/ directory of the snap.
>>>>>
>>>>>
>>>>> Do you really need to have those scripts placed into the bin/ directory?
>>>>> apps: can define a command: directory, and you expose every entry point
>>>>> you
>>>>> want your user to get access to (see
>>>>> https://developer.ubuntu.com/en/snappy/build-apps/snapcraft-syntax/).
>>>>> Some examples of applications exposing multiple entry point is one of the
>>>>> application from the snapcraft.io tour (I encourage you to have a look
>>>>> here!): http://snapcraft.io/create/, in particular this section should
>>>>> give
>>>>> you your needed answers: "02-parts: Snapcraft makes snaps out of parts".
>>>>>
>>>>> apps:
>>>>>     hello:
>>>>>       command: hello
>>>>>     bash:
>>>>>       command: bash
>>>>>
>>>>>
>>>>> See that the 2 commands aren't in any particular directory, command just
>>>>> refers to a path to your executable, relative to the root of your snap.
>>>>>
>>>>> Hope this helps!
>>>>>
>>>>> Hi Didier,
>>>>> My blocker is a schema error. I now see I get a similar error using the
>>>>> example at http://snapcraft.io/create/,
>>>>>
>>>>> nam
>>>>>    e
>>>>> : hello-debug
>>>>> version: "2.10"
>>>>> summary: GNU Hello with Bash for debugging
>>>>> description: GNU hello prints a friendly greeting.
>>>>>     This is part of the snapcraft tour at https://snapcraft.io/create/
>>>>>
>>>>> apps:
>>>>>     hello:
>>>>>       command: hello
>>>>>     bash:
>>>>>       command: bash
>>>>>
>>>>> parts:
>>>>>     gnu-hello:
>>>>>       plugin: autotools
>>>>>       source: http://ftp.gnu.org/gnu/hello/hello-2.10.tar.gz
>>>>>     gnu-bash:
>>>>>       plugin: autotools
>>>>>       configflags: ["--infodir=/var/bash/info"]
>>>>>       source: http://ftp.gnu.org/gnu/bash/bash-4.3.tar.gz
>>>>>
>>>>> I am running v2.11.  The error is:
>>>>> Issues while validating snapcraft.yaml: The 'hello' property does not
>>>>> match
>>>>> the required schema: Additional properties are not allowed ('bash' was
>>>>> unexpected)
>>>>>
>>>>> thanks.
>>>>>
>>>>> --
>>>>> John Agosta
>>>>>
>>>>>
>>>>> --
>>>>> Snapcraft mailing list
>>>>> Snapcraft at lists.ubuntu.com
>>>>> Modify settings or unsubscribe at:
>>>>> https://lists.ubuntu.com/mailman/listinfo/snapcraft
>>>>>
>>>
>>> --
>>> John Agosta
>>>
>>> Program Manager, snappy Ubuntu Core and Internet of Things
>>> UES Commercial Device Operations
>>> Canonical USA, LTD
>>> John.Agosta at Canonical.com
>>> +1 (970) 217-5115
>>>
>>> Ubuntu: creating the world’s best open source software platform
>>>
>>>
>>>
>>> --
>>> Snapcraft mailing list
>>> Snapcraft at lists.ubuntu.com
>>> Modify settings or unsubscribe at:
>>> https://lists.ubuntu.com/mailman/listinfo/snapcraft


-- 
John Agosta

Program Manager, snappy Ubuntu Core and Internet of Things
UES Commercial Device Operations
Canonical USA, LTD
John.Agosta at Canonical.com
+1 (970) 217-5115

Ubuntu: creating the world’s best open source software platform





More information about the Snapcraft mailing list