On Tue, May 31, 2016 at 3:45 AM, Richard Purdie < [email protected]> 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
-- _______________________________________________ toaster mailing list [email protected] https://lists.yoctoproject.org/listinfo/toaster
