Openembedded Core Discussions
 help / color / mirror / Atom feed
From: "Randle, William C" <william.c.randle@intel.com>
To: "richard.purdie@linuxfoundation.org"
	<richard.purdie@linuxfoundation.org>,
	 "openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 01/22] oe-buildenv-internal: Update to python3
Date: Wed, 1 Jun 2016 15:20:32 +0000	[thread overview]
Message-ID: <1464794431.2777.21.camel@intel.com> (raw)
In-Reply-To: <1464784540-2786-1-git-send-email-richard.purdie@linuxfoundation.org>

On Wed, 2016-06-01 at 13:35 +0100, Richard Purdie wrote:
> Check that 'python' is a python v2 since that is what we assume everywhere
> and upstream python devs recommend. We can need both python2 and python3
> available since we don't control the software we might download and run.
> 
> Also check that python 3 is >= 3.4.0, our minimum version for bitbake.
> 
> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
> ---
>  scripts/oe-buildenv-internal | 38 +++++++++++++++++++++-----------------
>  1 file changed, 21 insertions(+), 17 deletions(-)
> 
> diff --git a/scripts/oe-buildenv-internal b/scripts/oe-buildenv-internal
> index 81ee784..56d3419 100755
> --- a/scripts/oe-buildenv-internal
> +++ b/scripts/oe-buildenv-internal
> @@ -29,27 +29,31 @@ if [ -z "$OE_SKIP_SDK_CHECK" ] && [ -n
> "$OECORE_SDK_VERSION" ]; then
>      return 1
>  fi
>  
> -# Make sure we're not using python v3.x. This check can't go into
> -# sanity.bbclass because bitbake's source code doesn't even pass
> -# parsing stage when used with python v3, so we catch it here so we
> -# can offer a meaningful error message.
> -py_v3_check=$(/usr/bin/env python --version 2>&1 | grep "Python 3")
> -if [ -n "$py_v3_check" ]; then
> -    echo >&2 "Bitbake is not compatible with python v3"
> -    echo >&2 "Please set up python v2 as your default python interpreter"
> +# Make sure we're not using python v3.x as 'python', we don't support it.
> +py_v2_check=$(/usr/bin/env python --version 2>&1 | grep "Python 3")
> +if [ -n "$py_v2_check" ]; then
> +    echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not
> python v3."
> +    echo >&2 "Please set up python v2 as your default 'python' interpreter."
>      return 1
>  fi
> -unset py_v3_check
> -
> -# Similarly, we now have code that doesn't parse correctly with older
> -# versions of Python, and rather than fixing that and being eternally
> -# vigilant for any other new feature use, just check the version here.
> -py_v26_check=$(python -c 'import sys; print sys.version_info >= (2,7,3)')
> -if [ "$py_v26_check" != "True" ]; then
> -    echo >&2 "BitBake requires Python 2.7.3 or later"
> +unset py_v2_check
> +
> +py_v27_check=$(python -c 'import sys; print sys.version_info >= (2,7,3)')
> +if [ "$py_v27_check" != "True" ]; then
> +    echo >&2 "OpenEmbedded requires 'python' to be python v2 (>= 2.7.3), not
> python v3."
> +    echo >&2 "Please upgrade your python v2."
> +fi
> +unset py_v27_check
> +
> +# We potentially have code that doesn't parse correctly with older versions 
> +# of Python, and rather than fixing that and being eternally vigilant for 
> +# any other new feature use, just check the version here.
> +py_v34_check=$(python3 -c 'import sys; print(sys.version_info >= (3,4,0))')
> +if [ "$py_v34_check" != "True" ]; then
> +    echo >&2 "BitBake requires Python 3.4.0 or later as 'python3'"
>      return 1
>  fi
> -unset py_v26_check
> +unset py_v34_check
>  
>  if [ -z "$BDIR" ]; then
>      if [ -z "$1" ]; then
> -- 
> 2.5.0

It seems to me the comment about older Python versions should remain before the
2.7.3 check so that it applies to both the 2.7.3 and 3.4.0 checks.

    -Bill

  parent reply	other threads:[~2016-06-01 15:20 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 12:35 [PATCH 01/22] oe-buildenv-internal: Update to python3 Richard Purdie
2016-06-01 12:35 ` [PATCH 02/22] classes/lib: Convert to use python3 octal syntax Richard Purdie
2016-06-01 21:57   ` Christopher Larson
2016-06-02  7:11     ` Richard Purdie
2016-06-01 12:35 ` [PATCH 03/22] classes/lib: Update to use python3 command pipeline decoding Richard Purdie
2016-06-01 12:35 ` [PATCH 04/22] classes/lib: Update to match python3 iter requirements Richard Purdie
2016-06-01 12:35 ` [PATCH 05/22] classes/lib: Update to explictly create lists where needed Richard Purdie
2016-06-01 12:35 ` [PATCH 06/22] classes/lib: Update xrange -> range for python3 Richard Purdie
2016-06-01 12:35 ` [PATCH 07/22] sanity: Switch urlparse to urllib.parse Richard Purdie
2016-06-01 12:35 ` [PATCH 08/22] wic: use python3 in shebang Richard Purdie
2016-06-01 12:35 ` [PATCH 09/22] wic: encode help text Richard Purdie
2016-06-01 12:35 ` [PATCH 10/22] qemurunner: convert data when working with socket Richard Purdie
2016-06-01 12:35 ` [PATCH 11/22] scripts: Fix deprecated dict methods for python3 Richard Purdie
2016-06-01 12:35 ` [PATCH 12/22] scripts: Replace basestring -> str " Richard Purdie
2016-06-01 12:35 ` [PATCH 13/22] scripts: Fix encoding errors " Richard Purdie
2016-06-01 12:35 ` [PATCH 14/22] scripts: Rename ConfigParser -> configparser " Richard Purdie
2016-06-01 12:35 ` [PATCH 15/22] scripts: Fix urlparse imports " Richard Purdie
2016-06-01 12:35 ` [PATCH 16/22] scripts: use python3 in shebang Richard Purdie
2016-06-01 12:35 ` [PATCH 17/22] classes/lib: Complete transition to python3 Richard Purdie
2016-06-01 12:35 ` [PATCH 18/22] selftest/devtool: Compare sets instead of arrays on AssertEqual Richard Purdie
2016-06-01 12:35 ` [PATCH 19/22] buildhistory_analysis: Convert stream data (bytes) to strings Richard Purdie
2016-06-01 12:35 ` [PATCH 20/22] devtool.py: Fix parsing of bitbake-layers' output Richard Purdie
2016-06-01 15:38   ` Christopher Larson
2016-06-01 12:35 ` [PATCH 21/22] oeqa/selftest/recipetool.py: Use regex to match warning line Richard Purdie
2016-06-01 12:35 ` [PATCH 22/22] qemurunner: Use surrogateescape decoding Richard Purdie
2016-06-01 15:20 ` Randle, William C [this message]
2016-06-01 15:35 ` [PATCH 01/22] oe-buildenv-internal: Update to python3 Christopher Larson
2016-06-01 20:57   ` Richard Purdie
2016-06-01 20:59     ` Christopher Larson
2016-06-02  7:31 ` Python3 for bitbake/OE merged Richard Purdie
2016-06-02 15:23   ` Christopher Larson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1464794431.2777.21.camel@intel.com \
    --to=william.c.randle@intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=richard.purdie@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox