public inbox for gentoo-python@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
@ 2013-03-17 22:33 Michał Górny
  2013-03-17 23:37 ` [gentoo-python] " Mike Gilbert
  2013-03-20 11:10 ` [gentoo-python] " Nikolaj Sjujskij
  0 siblings, 2 replies; 9+ messages in thread
From: Michał Górny @ 2013-03-17 22:33 UTC (permalink / raw
  To: gentoo-python; +Cc: python, Michał Górny

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='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 PYTHON_TARGETS will be ignored."
+			_PYTHON_COMPAT_OVERRIDE_WARNED=1
+		fi
+
+		MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
+		return
+	fi
+
 	_python_validate_useflags
 	_python_check_USE_PYTHON
 
-- 
1.8.1.5



^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [gentoo-python] Re: [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
  2013-03-17 22:33 [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier Michał Górny
@ 2013-03-17 23:37 ` Mike Gilbert
  2013-03-20 11:10 ` [gentoo-python] " Nikolaj Sjujskij
  1 sibling, 0 replies; 9+ messages in thread
From: Mike Gilbert @ 2013-03-17 23:37 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-python, python

On Sun, Mar 17, 2013 at 6:33 PM, Michał Górny <mgorny@gentoo.org> 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='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 PYTHON_TARGETS will be ignored."
> +                       _PYTHON_COMPAT_OVERRIDE_WARNED=1
> +               fi
> +
> +               MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
> +               return
> +       fi
> +
>         _python_validate_useflags
>         _python_check_USE_PYTHON
>
> --
> 1.8.1.5
>

This could be quite handy.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
  2013-03-17 22:33 [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier Michał Górny
  2013-03-17 23:37 ` [gentoo-python] " Mike Gilbert
@ 2013-03-20 11:10 ` Nikolaj Sjujskij
  2013-03-20 19:03   ` Michał Górny
  1 sibling, 1 reply; 9+ messages in thread
From: Nikolaj Sjujskij @ 2013-03-20 11:10 UTC (permalink / raw
  To: gentoo-python, Michał Górny; +Cc: python

Den 2013-03-18 02:33:50 skrev Michał Górny <mgorny@gentoo.org>:

> 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.
Push it to tree, please, I'd like to test it :)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
  2013-03-20 11:10 ` [gentoo-python] " Nikolaj Sjujskij
@ 2013-03-20 19:03   ` Michał Górny
  2013-03-21  6:59     ` Nikolaj Sjujskij
  0 siblings, 1 reply; 9+ messages in thread
From: Michał Górny @ 2013-03-20 19:03 UTC (permalink / raw
  To: Nikolaj Sjujskij; +Cc: gentoo-python, python

[-- Attachment #1: Type: text/plain, Size: 647 bytes --]

On Wed, 20 Mar 2013 15:10:18 +0400
"Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:

> Den 2013-03-18 02:33:50 skrev Michał Górny <mgorny@gentoo.org>:
> 
> > 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.
> Push it to tree, please, I'd like to test it :)

Pushed :).

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
  2013-03-20 19:03   ` Michał Górny
@ 2013-03-21  6:59     ` Nikolaj Sjujskij
  2013-03-21 10:27       ` Michał Górny
  0 siblings, 1 reply; 9+ messages in thread
From: Nikolaj Sjujskij @ 2013-03-21  6:59 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-python, python

Den 2013-03-20 23:03:43 skrev Michał Górny <mgorny@gentoo.org>:

> On Wed, 20 Mar 2013 15:10:18 +0400
> "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
>
>> Den 2013-03-18 02:33:50 skrev Michał Górny <mgorny@gentoo.org>:
>>
>> > 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.
>> Push it to tree, please, I'd like to test it :)
>
> Pushed :).
  Yup, works fine: https://bugs.gentoo.org/show_bug.cgi?id=462566
One minor thing. I have PYTHON_TARGETS="python2_7 python3_3" in make.conf,  
pylint ebuild has PYTHON_COMPAT=( python2_{5,6,7} python{3_1,3_2} ). I  
expected `PYTHON_COMPAT_OVERRIDE="python3_3" emerge -1 pylint` to install  
pylint for both 2.7 and 3.3. Of course, it's "OVERRIDE", not "UPDATE", but  
still.
  A minor thing, really, and I won't insist on changing this behaviour.
Thanks in any case :)


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
  2013-03-21  6:59     ` Nikolaj Sjujskij
@ 2013-03-21 10:27       ` Michał Górny
  2013-03-21 11:30         ` Nikolaj Sjujskij
  0 siblings, 1 reply; 9+ messages in thread
From: Michał Górny @ 2013-03-21 10:27 UTC (permalink / raw
  To: Nikolaj Sjujskij; +Cc: gentoo-python, python

[-- Attachment #1: Type: text/plain, Size: 1632 bytes --]

On Thu, 21 Mar 2013 10:59:49 +0400
"Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:

> Den 2013-03-20 23:03:43 skrev Michał Górny <mgorny@gentoo.org>:
> 
> > On Wed, 20 Mar 2013 15:10:18 +0400
> > "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
> >
> >> Den 2013-03-18 02:33:50 skrev Michał Górny <mgorny@gentoo.org>:
> >>
> >> > 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.
> >> Push it to tree, please, I'd like to test it :)
> >
> > Pushed :).
>   Yup, works fine: https://bugs.gentoo.org/show_bug.cgi?id=462566
> One minor thing. I have PYTHON_TARGETS="python2_7 python3_3" in make.conf,  
> pylint ebuild has PYTHON_COMPAT=( python2_{5,6,7} python{3_1,3_2} ). I  
> expected `PYTHON_COMPAT_OVERRIDE="python3_3" emerge -1 pylint` to install  
> pylint for both 2.7 and 3.3. Of course, it's "OVERRIDE", not "UPDATE", but  
> still.
>   A minor thing, really, and I won't insist on changing this behaviour.
> Thanks in any case :)

I've decided to go this way since you can't change the IUSE. Therefore,
you can't really control the enabled implementations via USE flags. If
it worked like you suggested, some of the implementations would respect
USE flags and some other wouldn't -- that would be confusing.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
  2013-03-21 10:27       ` Michał Górny
@ 2013-03-21 11:30         ` Nikolaj Sjujskij
  2013-03-21 11:55           ` Michał Górny
  0 siblings, 1 reply; 9+ messages in thread
From: Nikolaj Sjujskij @ 2013-03-21 11:30 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-python, python

Den 2013-03-21 14:27:42 skrev Michał Górny <mgorny@gentoo.org>:

> On Thu, 21 Mar 2013 10:59:49 +0400
> "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
>
>> Den 2013-03-20 23:03:43 skrev Michał Górny <mgorny@gentoo.org>:
>>
>> > On Wed, 20 Mar 2013 15:10:18 +0400
>> > "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
>> >
>> >> Den 2013-03-18 02:33:50 skrev Michał Górny <mgorny@gentoo.org>:
>> >>
>> >> > 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.
>> >> Push it to tree, please, I'd like to test it :)
>> >
>> > Pushed :).
>>   Yup, works fine: https://bugs.gentoo.org/show_bug.cgi?id=462566
>> One minor thing. I have PYTHON_TARGETS="python2_7 python3_3" in  
>> make.conf,
>> pylint ebuild has PYTHON_COMPAT=( python2_{5,6,7} python{3_1,3_2} ). I
>> expected `PYTHON_COMPAT_OVERRIDE="python3_3" emerge -1 pylint` to  
>> install
>> pylint for both 2.7 and 3.3. Of course, it's "OVERRIDE", not "UPDATE",  
>> but
>> still.
>>   A minor thing, really, and I won't insist on changing this behaviour.
>> Thanks in any case :)
>
> I've decided to go this way since you can't change the IUSE. Therefore,
> you can't really control the enabled implementations via USE flags. If
> it worked like you suggested, some of the implementations would respect
> USE flags and some other wouldn't -- that would be confusing.
Agreed. But what about something like this:


--- /usr/portage/eclass/python-r1.eclass	2013-03-20 23:31:15.000000000  
+0400
+++ python-r1.eclass	2013-03-21 15:17:58.000000000 +0400
@@ -604,11 +604,11 @@
  			ewarn
  			ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be  
ignored."
  			_PYTHON_COMPAT_OVERRIDE_WARNED=1
  		fi

-		MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
+		MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} ${PYTHON_TARGETS} )
  		return
  	fi

  	_python_validate_useflags
  	_python_check_USE_PYTHON


This way eclass would use PYTHON_TARGETS, but equally "disrespect" all the  
implementations regarding USE-flags etc, wouldn't it? :)
(Probably we'd have to deal with duplicates in that array, but that's only  
an idea).


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
  2013-03-21 11:30         ` Nikolaj Sjujskij
@ 2013-03-21 11:55           ` Michał Górny
  2013-03-21 12:12             ` Nikolaj Sjujskij
  0 siblings, 1 reply; 9+ messages in thread
From: Michał Górny @ 2013-03-21 11:55 UTC (permalink / raw
  To: Nikolaj Sjujskij; +Cc: gentoo-python, python

[-- Attachment #1: Type: text/plain, Size: 2918 bytes --]

On Thu, 21 Mar 2013 15:30:35 +0400
"Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:

> Den 2013-03-21 14:27:42 skrev Michał Górny <mgorny@gentoo.org>:
> 
> > On Thu, 21 Mar 2013 10:59:49 +0400
> > "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
> >
> >> Den 2013-03-20 23:03:43 skrev Michał Górny <mgorny@gentoo.org>:
> >>
> >> > On Wed, 20 Mar 2013 15:10:18 +0400
> >> > "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
> >> >
> >> >> Den 2013-03-18 02:33:50 skrev Michał Górny <mgorny@gentoo.org>:
> >> >>
> >> >> > 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.
> >> >> Push it to tree, please, I'd like to test it :)
> >> >
> >> > Pushed :).
> >>   Yup, works fine: https://bugs.gentoo.org/show_bug.cgi?id=462566
> >> One minor thing. I have PYTHON_TARGETS="python2_7 python3_3" in  
> >> make.conf,
> >> pylint ebuild has PYTHON_COMPAT=( python2_{5,6,7} python{3_1,3_2} ). I
> >> expected `PYTHON_COMPAT_OVERRIDE="python3_3" emerge -1 pylint` to  
> >> install
> >> pylint for both 2.7 and 3.3. Of course, it's "OVERRIDE", not "UPDATE",  
> >> but
> >> still.
> >>   A minor thing, really, and I won't insist on changing this behaviour.
> >> Thanks in any case :)
> >
> > I've decided to go this way since you can't change the IUSE. Therefore,
> > you can't really control the enabled implementations via USE flags. If
> > it worked like you suggested, some of the implementations would respect
> > USE flags and some other wouldn't -- that would be confusing.
> Agreed. But what about something like this:
> 
> 
> --- /usr/portage/eclass/python-r1.eclass	2013-03-20 23:31:15.000000000  
> +0400
> +++ python-r1.eclass	2013-03-21 15:17:58.000000000 +0400
> @@ -604,11 +604,11 @@
>   			ewarn
>   			ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be  
> ignored."
>   			_PYTHON_COMPAT_OVERRIDE_WARNED=1
>   		fi
> 
> -		MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
> +		MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} ${PYTHON_TARGETS} )
>   		return
>   	fi
> 
>   	_python_validate_useflags
>   	_python_check_USE_PYTHON
> 
> 
> This way eclass would use PYTHON_TARGETS, but equally "disrespect" all the  
> implementations regarding USE-flags etc, wouldn't it? :)
> (Probably we'd have to deal with duplicates in that array, but that's only  
> an idea).

Think of PYTHON_COMPAT_OVERRIDE='python2_7 python3_3'. Should 2_7 be
enabled if it's both in override and real _COMPAT, and disabled via USE
flag?

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 966 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier.
  2013-03-21 11:55           ` Michał Górny
@ 2013-03-21 12:12             ` Nikolaj Sjujskij
  0 siblings, 0 replies; 9+ messages in thread
From: Nikolaj Sjujskij @ 2013-03-21 12:12 UTC (permalink / raw
  To: Michał Górny; +Cc: gentoo-python, python

Den 2013-03-21 15:55:23 skrev Michał Górny <mgorny@gentoo.org>:

> On Thu, 21 Mar 2013 15:30:35 +0400
> "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
>
>> Den 2013-03-21 14:27:42 skrev Michał Górny <mgorny@gentoo.org>:
>>
>> > On Thu, 21 Mar 2013 10:59:49 +0400
>> > "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
>> >
>> >> Den 2013-03-20 23:03:43 skrev Michał Górny <mgorny@gentoo.org>:
>> >>
>> >> > On Wed, 20 Mar 2013 15:10:18 +0400
>> >> > "Nikolaj Sjujskij" <sterkrig@myopera.com> wrote:
>> >> >
>> >> >> Den 2013-03-18 02:33:50 skrev Michał Górny <mgorny@gentoo.org>:
>> >> >>
>> >> >> > 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.
>> >> >> Push it to tree, please, I'd like to test it :)
>> >> >
>> >> > Pushed :).
>> >>   Yup, works fine: https://bugs.gentoo.org/show_bug.cgi?id=462566
>> >> One minor thing. I have PYTHON_TARGETS="python2_7 python3_3" in
>> >> make.conf,
>> >> pylint ebuild has PYTHON_COMPAT=( python2_{5,6,7} python{3_1,3_2} ).  
>> I
>> >> expected `PYTHON_COMPAT_OVERRIDE="python3_3" emerge -1 pylint` to
>> >> install
>> >> pylint for both 2.7 and 3.3. Of course, it's "OVERRIDE", not  
>> "UPDATE",
>> >> but
>> >> still.
>> >>   A minor thing, really, and I won't insist on changing this  
>> behaviour.
>> >> Thanks in any case :)
>> >
>> > I've decided to go this way since you can't change the IUSE.  
>> Therefore,
>> > you can't really control the enabled implementations via USE flags. If
>> > it worked like you suggested, some of the implementations would  
>> respect
>> > USE flags and some other wouldn't -- that would be confusing.
>> Agreed. But what about something like this:
>>
>>
>> --- /usr/portage/eclass/python-r1.eclass	2013-03-20 23:31:15.000000000
>> +0400
>> +++ python-r1.eclass	2013-03-21 15:17:58.000000000 +0400
>> @@ -604,11 +604,11 @@
>>   			ewarn
>>   			ewarn "Dependencies won't be satisfied, and PYTHON_TARGETS will be
>> ignored."
>>   			_PYTHON_COMPAT_OVERRIDE_WARNED=1
>>   		fi
>>
>> -		MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} )
>> +		MULTIBUILD_VARIANTS=( ${PYTHON_COMPAT_OVERRIDE} ${PYTHON_TARGETS} )
>>   		return
>>   	fi
>>
>>   	_python_validate_useflags
>>   	_python_check_USE_PYTHON
>>
>>
>> This way eclass would use PYTHON_TARGETS, but equally "disrespect" all  
>> the
>> implementations regarding USE-flags etc, wouldn't it? :)
>> (Probably we'd have to deal with duplicates in that array, but that's  
>> only
>> an idea).
>
> Think of PYTHON_COMPAT_OVERRIDE='python2_7 python3_3'. Should 2_7 be
> enabled if it's both in override and real _COMPAT, and disabled via USE
> flag?
It should be enabled. To be honest, I fail to see your point: in case of  
PYTHON_COMPAT_OVERRIDE='python2_7 python3_3' I see no difference in  
current code and my proposal: either way python2_7 would be enabled  
regardless of USE-flag settings, wouldn't it?

On the other hand, let's consider testing something like PyQt4 with, say,  
Python 3.4, on the system with PYTHON_TARGETS="python2_7 python3_3". In  
"my case" with PYTHON_COMPAT_OVERRIDE="python3_4" module would be built  
three times, which isn't that good. Dealing in eclass with  
PYTHON_COMPAT_OVERRIDE="-python2_7 -python3_3 python3_4" could be tricky,  
so maybe the current situation is the most convenient.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-03-21 12:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-17 22:33 [gentoo-python] [PATCH python-r1 2/2] Introduce PYTHON_COMPAT_OVERRIDE to make testing easier Michał Górny
2013-03-17 23:37 ` [gentoo-python] " Mike Gilbert
2013-03-20 11:10 ` [gentoo-python] " Nikolaj Sjujskij
2013-03-20 19:03   ` Michał Górny
2013-03-21  6:59     ` Nikolaj Sjujskij
2013-03-21 10:27       ` Michał Górny
2013-03-21 11:30         ` Nikolaj Sjujskij
2013-03-21 11:55           ` Michał Górny
2013-03-21 12:12             ` Nikolaj Sjujskij

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox