From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 47E31198005 for ; Sun, 17 Mar 2013 23:37:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CA41DE055C; Sun, 17 Mar 2013 23:37:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 476D1E055C for ; Sun, 17 Mar 2013 23:37:57 +0000 (UTC) Received: from mail-ia0-x232.google.com (mail-ia0-x232.google.com [IPv6:2607:f8b0:4001:c02::232]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: floppym) by smtp.gentoo.org (Postfix) with ESMTPSA id 6D3E033DB47 for ; Sun, 17 Mar 2013 23:37:56 +0000 (UTC) Received: by mail-ia0-f178.google.com with SMTP id y10so2564127iak.9 for ; Sun, 17 Mar 2013 16:37:54 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Discussions centering around the Python ecosystem in Gentoo Linux X-BeenThere: gentoo-python@gentoo.org X-BeenThere: gentoo-python@lists.gentoo.org MIME-Version: 1.0 X-Received: by 10.50.51.226 with SMTP id n2mr5202016igo.25.1363563474718; Sun, 17 Mar 2013 16:37:54 -0700 (PDT) Received: by 10.64.102.66 with HTTP; Sun, 17 Mar 2013 16:37:54 -0700 (PDT) In-Reply-To: <1363559630-17431-2-git-send-email-mgorny@gentoo.org> References: <1363559630-17431-2-git-send-email-mgorny@gentoo.org> Date: Sun, 17 Mar 2013 19:37:54 -0400 Message-ID: Subject: [gentoo-python] Re: [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier. From: Mike Gilbert To: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Cc: gentoo-python@lists.gentoo.org, python@gentoo.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Archives-Salt: f1e8d46e-9b66-4e0e-b926-6c187251c1fe X-Archives-Hash: 841c2e4ec0b7712cd4cb08167e0154e0 On Sun, Mar 17, 2013 at 6:33 PM, Micha=C5=82 G=C3=B3rny = wrote: > The PYTHON_COMPAT_OVERRIDE can be set in the environment to enforce > a different set of Python implementations than one being intersection > of PYTHON_COMPAT and PYTHON_TARGETS. > > Due to technical limitations, the variable influences only the list > of implementations actually used. USE flags, dependencies and other > metadata variables are not modified. > --- > gx86/eclass/python-r1.eclass | 34 ++++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/gx86/eclass/python-r1.eclass b/gx86/eclass/python-r1.eclass > index 99bd240..c060c24 100644 > --- a/gx86/eclass/python-r1.eclass > +++ b/gx86/eclass/python-r1.eclass > @@ -74,6 +74,25 @@ if ! declare -p PYTHON_COMPAT &>/dev/null; then > fi > fi > > +# @ECLASS-VARIABLE: PYTHON_COMPAT_OVERRIDE > +# @INTERNAL > +# @DESCRIPTION: > +# This variable can be used when working with ebuilds to override > +# the in-ebuild PYTHON_COMPAT. It is a string listing all > +# the implementations which package will be built for. It need be > +# specified in the calling environment, and not in ebuilds. > +# > +# It should be noted that in order to preserve metadata immutability, > +# PYTHON_COMPAT_OVERRIDE does not affect IUSE nor dependencies. > +# The state of PYTHON_TARGETS is ignored, and all the implementations > +# in PYTHON_COMPAT_OVERRIDE are built. Dependencies need to be satisfied > +# manually. > +# > +# Example: > +# @CODE > +# PYTHON_COMPAT_OVERRIDE=3D'pypy2_0 python3_3' emerge -1v dev-python/foo > +# @CODE > + > # @ECLASS-VARIABLE: PYTHON_REQ_USE > # @DEFAULT_UNSET > # @DESCRIPTION: > @@ -576,6 +595,21 @@ _python_check_USE_PYTHON() { > # @DESCRIPTION: > # Set up the enabled implementation list. > _python_obtain_impls() { > + if [[ ${PYTHON_COMPAT_OVERRIDE} ]]; then > + if [[ ! ${_PYTHON_COMPAT_OVERRIDE_WARNED} ]]; then > + ewarn "WARNING: PYTHON_COMPAT_OVERRIDE in effect.= The following Python" > + ewarn "implementations will be enabled:" > + ewarn > + ewarn " ${PYTHON_COMPAT_OVERRIDE}" > + ewarn > + ewarn "Dependencies won't be satisfied, and PYTHO= N_TARGETS will be ignored." > + _PYTHON_COMPAT_OVERRIDE_WARNED=3D1 > + fi > + > + MULTIBUILD_VARIANTS=3D( ${PYTHON_COMPAT_OVERRIDE} ) > + return > + fi > + > _python_validate_useflags > _python_check_USE_PYTHON > > -- > 1.8.1.5 > This could be quite handy.