Experimental Python interpreter snap
Stuart Bishop
stuart.bishop at canonical.com
Tue Feb 21 08:57:05 UTC 2017
On 20 February 2017 at 11:41, James Henstridge
<james.henstridge at canonical.com> wrote:
> On 20 February 2017 at 10:45, XiaoGuo Liu <xiaoguo.liu at canonical.com> wrote:
>> Hi James,
>>
>> Nice. This is a nice example showing how to reduce a python snap package. A
>> few days ago, I also made a small example to make use of the python3 coming
>> with the core at:
>>
>> https://github.com/liu-xiao-guo/httpstat
>>
>> In the above example, I in fact do not package the python. It works.
>
> So I guess the main differences are that this makes it easy to use a
> newer version of Python than existed at the time Xenial was released.
> I suspect I could also build a Python 2.7 snap using the same
> techniques, if you want to go in the other direction.
Yes. I love the idea of being able to use 3.6 or 3.7, and not have to
rebuild and release my snaps every time there is a point release.
I also like the idea of having easy access to nightly builds of the
development branch, and antique versions. I think having old versions
packaged in snaps is nicer than the current approach of the
deadsnakes ppa.
> The Python in my snap is also set up to automatically use packages
> included in your own snap without fiddling with environment variables
> or sys.path.
You could probably also get the pip in your snap to install packages
to $SNAP_USER_DATA or $SNAP_DATA if run as root. Although most devs
would stick to using virtualenvs outside of the snap for this,
assuming a modern enough Python.
--
Stuart Bishop <stuart.bishop at canonical.com>
More information about the Snapcraft
mailing list