From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by yocto-www.yoctoproject.org (Postfix, from userid 118) id CABB2E00D38; Tue, 31 May 2016 07:09:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on yocto-www.yoctoproject.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HTML_MESSAGE,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.1 X-Spam-HAM-Report: * -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low * trust * [209.85.223.180 listed in list.dnswl.org] * -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% * [score: 0.0000] * 0.0 HTML_MESSAGE BODY: HTML included in message * 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily * valid * -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature Received: from mail-io0-f180.google.com (mail-io0-f180.google.com [209.85.223.180]) by yocto-www.yoctoproject.org (Postfix) with ESMTP id 95B6BE00CE8 for ; Tue, 31 May 2016 07:09:47 -0700 (PDT) Received: by mail-io0-f180.google.com with SMTP id p194so40831784iod.1 for ; Tue, 31 May 2016 07:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ALsKL8EJ/ZhedJKqG6JB2gma4dMqVtJhAHad+xgqFeE=; b=0lfkrhDgEn+YMuQPlvbxD+UDc6lMfV5mSJzbWdWU2PDCNRm/vOtUPnJdoCQ2Gd3xs8 jKDIm2pEd9N5r5wNf/NFanYVgLWhD+V8Gusc93N4HmR7BzcwnLtDfyZUireTfyiuHF9r XVEV4sYOiEYTMlhuU8AJtGe997NvUaRzBvkYGc6X1TCGXlUoW/q+433bF/TYV0C4BEC4 rijxuRJNp2CVNXNnu6RJxkOQZbzsmvaTxh10JraPhLLClFhMiz6tUphJDb8ryT/494Gw YMdd3IALXOgpoGP7xoFf71TeqUCvC7V4AgPe7Qz0vdjy9A0Ef/SenTf5rdD3KF8aknGQ Uuhw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kergoth-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=ALsKL8EJ/ZhedJKqG6JB2gma4dMqVtJhAHad+xgqFeE=; b=0T1oZ5iZx5LTsVS7x23n94qi7RAvnL/xB5XOANBpZ6Ta9thZxiN1aINpmHSbjLR3Hv ZNx9Lbo8UOsHAXTmfLMSmEyZ2OkAzdZAaytKYoFGSfCPSALGp8NpV6AbiRTZY4ux3KWf uz98cXqffZYFWjECabOP1JcuIwgx4UUmpeF+sZn9QcyWQRvLnnUihZr8BT/E5FUyTifc 8gXEJPYPImZNbo4wTYB9h0IStSHjyMwkJSsxMFSgFfwqW6Hra66qLA5dgfKar+cFPYY7 /pTPPb6ReoVbjl+dMWouoDk3vlIugaQdD6ci0EWZwt0lu6PynaaFQ6jYQIdsdoivqy84 0u1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=ALsKL8EJ/ZhedJKqG6JB2gma4dMqVtJhAHad+xgqFeE=; b=O47m6nqeS3raVnJpuF1mjwYSVplfYlQdY86xVsRSAUODfZIkN3s/rcT0PFYafZkuYF YpQQKJ43hmXn9vopM9z1WvK03Uh/DnTpn/pWB2dqZQLpbSaG2rhs7a1V06LZ2sxzujoU h3q6712s/7d07piKmbFFpTgnYruOunL6j5l6VorBERqmbPnvsRIcmTjIZ3A/TgbbSQp0 tUgiyCz4JSrGs/FekGGNlOpBT7W5Gq+yIHQPUJvep818zkJh9BHHjKcQwCen1zeFGkky vCBhKfppoBbKxRcrMaJ6f2aBvX8aSWEXVsgwB9V6WGVOrFk9bWaj6wAs7JeCO6N5mRE8 D4Xg== X-Gm-Message-State: ALyK8tJ3CD/blsp5+2WHrpwhPf9p0OfUwGBY9HcAQ+FfTVXUWf8g3BPr/1HFddjUmEb+BBGOJ1chUYDooN3PVg== X-Received: by 10.107.140.132 with SMTP id o126mr26842530iod.70.1464703786385; Tue, 31 May 2016 07:09:46 -0700 (PDT) MIME-Version: 1.0 Sender: kergoth@gmail.com Received: by 10.79.100.5 with HTTP; Tue, 31 May 2016 07:09:26 -0700 (PDT) In-Reply-To: <1464691547.19134.127.camel@linuxfoundation.org> References: <1464691547.19134.127.camel@linuxfoundation.org> From: Christopher Larson Date: Tue, 31 May 2016 07:09:26 -0700 X-Google-Sender-Auth: Gsc0DQ57_nFOuKAXD5dZ7WsHW6E Message-ID: To: Richard Purdie Cc: "Avery, Brian" , "toaster@yoctoproject.org" Subject: Re: virtualenv for toaster and python 3 X-BeenThere: toaster@yoctoproject.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Web based interface for BitBake List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 31 May 2016 14:09:50 -0000 Content-Type: multipart/alternative; boundary=94eb2c05aea2e387e4053423ec13 --94eb2c05aea2e387e4053423ec13 Content-Type: text/plain; charset=UTF-8 On Tue, May 31, 2016 at 3:45 AM, Richard Purdie < richard.purdie@linuxfoundation.org> wrote: > The move to python3 is unsurprisingly causing some issues in places. > One of them is unfortunately the use of vritualenv, which as I > understand it, toaster currently promotes as its preferred way of being > run. > > The issue is that we need "python" to be python v2 but "python3" to be > python v3. It seems with virtualenv you can either have python v2 or > python v3 but not both. > > The python developers official party line is that "python" is v2 and > "python3" is v3. There are some distros choosing not to do this (e.g. > Arch Linux) but most are following the official recommendation and I > think OE needs to follow the official recommendation too. Its likely OE > will need to error with sanity test failures if the environment doesn't > conform to this view of the world. > > Why do we need this? We have a mixture of code, some of it is ported to > v3, some isn't. Whilst we're aiming to convert all of "our" code to > python v3, even once we've done that, we can't easily change scripts > that ship with the source code we build for example, or expect everyone > to do that for all software they build. > > It may be virtualenv can be configured to not take over "python" but > only "python3" but Ed/I haven't found the option, I'm no expert. > > The other alternative is to promote the use of something like "pip3 > install 'Django>1.8,<1.9' --user" instead. Toaster doesn't need many > modules and those it does need should be installable into the user's > homedir using pip3. > > Whilst this means changing the documentation and taking a new approach, > I think its the "least bad" solution we have right now. > > Obviously I'm open to other ideas but we really do need a way which > allows mixed versions of python and virtualenv doesn't seem to work for > this. virtualenv is the wrong tool to use for python 3. python 3 includes its own tool for managing virtual environments, pyvenv. See https://docs.python.org/dev/library/venv.html. As an FYI, you can run either virtualenv or pyvenv for an arbitrary python version by running it with python -m virtualenv or python -m venv, and virtualenv takes a -p argument to specify the path to the python executable. But of course that doesn't matter, since we don't need to use virtualenv in python 3 environments. But still, useful to know that both python packages provide an __main__. -- Christopher Larson clarson at kergoth dot com Founder - BitBake, OpenEmbedded, OpenZaurus Maintainer - Tslib Senior Software Engineer, Mentor Graphics --94eb2c05aea2e387e4053423ec13 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Tue, May 31, 2016 at 3:45 AM, Richard Purdie <<= a href=3D"mailto:richard.purdie@linuxfoundation.org" target=3D"_blank">rich= ard.purdie@linuxfoundation.org> wrote:
= The move to python3 is unsurprisingly causing some issues in places.
One of them is unfortunately the use of vritualenv, which as I
understand it, toaster currently promotes as its preferred way of being
run.

The issue is that we need "python" to be python v2 but "pyth= on3" to be
python v3. It seems with virtualenv you can either have python v2 or
python v3 but not both.

The python developers official party line is that "python" is v2 = and
"python3" is v3. There are some distros choosing not to do this (= e.g.
Arch Linux) but most are following the official recommendation and I
think OE needs to follow the official recommendation too. Its likely OE
will need to error with sanity test failures if the environment doesn't=
conform to this view of the world.

Why do we need this? We have a mixture of code, some of it is ported to
v3, some isn't. Whilst we're aiming to convert all of "our&quo= t; code to
python v3, even once we've done that, we can't easily change script= s
that ship with the source code we build for example, or expect everyone
to do that for all software they build.

It may be virtualenv can be configured to not take over "python" = but
only "python3" but Ed/I haven't found the option, I'm no = expert.

The other alternative is to promote the use of something like "pip3 install 'Django>1.8,<1.9' --user" instead. Toaster doesn= 't need many
modules and those it does need should be installable into the user's homedir using pip3.

Whilst this means changing the documentation and taking a new approach,
I think its the "least bad" solution we have right now.

Obviously I'm open to other ideas but we really do need a way which
allows mixed versions of python and virtualenv doesn't seem to work for=
this.

virtualenv is the wrong tool to use f= or python 3. python 3 includes its own tool for managing virtual environmen= ts, pyvenv. See h= ttps://docs.python.org/dev/library/venv.html.

= As an FYI, you can run either virtualenv or pyvenv for an arbitrary python = version by running it with python -m virtualenv or python -m venv, and virt= ualenv takes a -p argument to specify the path to the python executable. Bu= t of course that doesn't matter, since we don't need to use virtual= env in python 3 environments. But still, useful to know that both python pa= ckages provide an __main__.
--
Christopher Larson
clarson at kergo= th dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - T= slib
Senior Software Engineer, Mentor Graphics
--94eb2c05aea2e387e4053423ec13--