public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5
@ 2019-12-14 10:50 David Seifert
  2019-12-14 10:50 ` [gentoo-dev] [PATCH 2/3] python-utils-r1.eclass: " David Seifert
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: David Seifert @ 2019-12-14 10:50 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, David Seifert

Signed-off-by: David Seifert <soap@gentoo.org>
---
 eclass/python-any-r1.eclass | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 3863ef6fa84..869ece64c65 100644
--- a/eclass/python-any-r1.eclass
+++ b/eclass/python-any-r1.eclass
@@ -7,7 +7,7 @@
 # @AUTHOR:
 # Author: Michał Górny <mgorny@gentoo.org>
 # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org>
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: An eclass for packages having build-time dependency on Python.
 # @DESCRIPTION:
 # A minimal eclass for packages which need any Python interpreter
@@ -37,7 +37,10 @@
 # https://wiki.gentoo.org/wiki/Project:Python/python-any-r1
 
 case "${EAPI:-0}" in
-	0|1|2|3|4|5|6|7)
+	[01234])
+		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
+		;;
+	[567])
 		;;
 	*)
 		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
-- 
2.24.1



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

* [gentoo-dev] [PATCH 2/3] python-utils-r1.eclass: Constrain to EAPI >= 5
  2019-12-14 10:50 [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 David Seifert
@ 2019-12-14 10:50 ` David Seifert
  2019-12-14 10:50 ` [gentoo-dev] [PATCH 3/3] python-utils-r1.eclass: Remove Python 3.5 David Seifert
  2019-12-14 11:29 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 Ulrich Mueller
  2 siblings, 0 replies; 8+ messages in thread
From: David Seifert @ 2019-12-14 10:50 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, David Seifert

Signed-off-by: David Seifert <soap@gentoo.org>
---
 eclass/python-utils-r1.eclass | 32 +++++++++-----------------------
 1 file changed, 9 insertions(+), 23 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 3eadc50f93e..779e228e4dc 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -7,7 +7,7 @@
 # @AUTHOR:
 # Author: Michał Górny <mgorny@gentoo.org>
 # Based on work of: Krzysztof Pawlik <nelchael@gentoo.org>
-# @SUPPORTED_EAPIS: 0 1 2 3 4 5 6 7
+# @SUPPORTED_EAPIS: 5 6 7
 # @BLURB: Utility functions for packages with Python parts.
 # @DESCRIPTION:
 # A utility eclass providing functions to query Python implementations,
@@ -20,7 +20,10 @@
 # https://wiki.gentoo.org/wiki/Project:Python/python-utils-r1
 
 case "${EAPI:-0}" in
-	0|1|2|3|4|5|6|7)
+	[01234])
+		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
+		;;
+	[567])
 		;;
 	*)
 		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@@ -33,7 +36,7 @@ fi
 
 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
 
-[[ ${EAPI:-0} == [012345] ]] && inherit eutils multilib
+[[ ${EAPI} == 5 ]] && inherit eutils multilib
 inherit toolchain-funcs
 
 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
@@ -80,17 +83,12 @@ _python_impl_supported() {
 	# keep in sync with _PYTHON_ALL_IMPLS!
 	# (not using that list because inline patterns shall be faster)
 	case "${impl}" in
-		python2_7|python3_[5678]|jython2_7)
+		python2_7|python3_[5678]|jython2_7|pypy|pypy3)
 			return 0
 			;;
 		pypy1_[89]|pypy2_0|python2_[56]|python3_[1234])
 			return 1
 			;;
-		pypy|pypy3)
-			if [[ ${EAPI:-0} == [01234] ]]; then
-				die "PyPy is supported in EAPI 5 and newer only."
-			fi
-			;;
 		*)
 			[[ ${PYTHON_COMPAT_NO_STRICT} ]] && return 1
 			die "Invalid implementation in PYTHON_COMPAT: ${impl}"
@@ -776,9 +774,6 @@ python_newexe() {
 
 	[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
 	[[ ${#} -eq 2 ]] || die "Usage: ${FUNCNAME} <path> <new-name>"
-	if [[ ${EAPI:-0} == [0123] ]]; then
-		die "python_do* and python_new* helpers are banned in EAPIs older than 4."
-	fi
 
 	local wrapd=${python_scriptroot:-/usr/bin}
 
@@ -906,9 +901,6 @@ python_domodule() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
-	if [[ ${EAPI:-0} == [0123] ]]; then
-		die "python_do* and python_new* helpers are banned in EAPIs older than 4."
-	fi
 
 	local d
 	if [[ ${python_moduleroot} == /* ]]; then
@@ -948,9 +940,6 @@ python_doheader() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ ${EPYTHON} ]] || die 'No Python implementation set (EPYTHON is null).'
-	if [[ ${EAPI:-0} == [0123] ]]; then
-		die "python_do* and python_new* helpers are banned in EAPIs older than 4."
-	fi
 
 	local d PYTHON_INCLUDEDIR=${PYTHON_INCLUDEDIR}
 	[[ ${PYTHON_INCLUDEDIR} ]] || python_export PYTHON_INCLUDEDIR
@@ -1093,10 +1082,7 @@ python_is_installed() {
 	[[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON"
 	local hasv_args=()
 
-	case ${EAPI:-0} in
-		0|1|2|3|4)
-			local -x ROOT=/
-			;;
+	case ${EAPI} in
 		5|6)
 			hasv_args+=( --host-root )
 			;;
@@ -1265,7 +1251,7 @@ python_fix_shebang() {
 
 		if [[ ! ${any_fixed} ]]; then
 			local cmd=eerror
-			[[ ${EAPI:-0} == [012345] ]] && cmd=eqawarn
+			[[ ${EAPI} == 5 ]] && cmd=eqawarn
 
 			"${cmd}" "QA warning: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files."
 			if [[ ${any_correct} ]]; then
-- 
2.24.1



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

* [gentoo-dev] [PATCH 3/3] python-utils-r1.eclass: Remove Python 3.5
  2019-12-14 10:50 [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 David Seifert
  2019-12-14 10:50 ` [gentoo-dev] [PATCH 2/3] python-utils-r1.eclass: " David Seifert
@ 2019-12-14 10:50 ` David Seifert
  2019-12-14 11:29 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 Ulrich Mueller
  2 siblings, 0 replies; 8+ messages in thread
From: David Seifert @ 2019-12-14 10:50 UTC (permalink / raw
  To: gentoo-dev; +Cc: python, David Seifert

* Python 3.5 will go EOL on 2020-09-13 and in order to reduce testing
  and maintenance burden, we want to keep the number of active Py3
  impls below four.

  https://devguide.python.org/#status-of-python-branches

Signed-off-by: David Seifert <soap@gentoo.org>
---
 eclass/python-utils-r1.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index 779e228e4dc..aae091fade7 100644
--- a/eclass/python-utils-r1.eclass
+++ b/eclass/python-utils-r1.eclass
@@ -47,7 +47,7 @@ _PYTHON_ALL_IMPLS=(
 	jython2_7
 	pypy pypy3
 	python2_7
-	python3_5 python3_6 python3_7 python3_8
+	python3_6 python3_7 python3_8
 )
 readonly _PYTHON_ALL_IMPLS
 
@@ -83,10 +83,10 @@ _python_impl_supported() {
 	# keep in sync with _PYTHON_ALL_IMPLS!
 	# (not using that list because inline patterns shall be faster)
 	case "${impl}" in
-		python2_7|python3_[5678]|jython2_7|pypy|pypy3)
+		python2_7|python3_[678]|jython2_7|pypy|pypy3)
 			return 0
 			;;
-		pypy1_[89]|pypy2_0|python2_[56]|python3_[1234])
+		pypy1_[89]|pypy2_0|python2_[56]|python3_[12345])
 			return 1
 			;;
 		*)
-- 
2.24.1



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

* Re: [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5
  2019-12-14 10:50 [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 David Seifert
  2019-12-14 10:50 ` [gentoo-dev] [PATCH 2/3] python-utils-r1.eclass: " David Seifert
  2019-12-14 10:50 ` [gentoo-dev] [PATCH 3/3] python-utils-r1.eclass: Remove Python 3.5 David Seifert
@ 2019-12-14 11:29 ` Ulrich Mueller
  2019-12-14 11:52   ` David Seifert
                     ` (2 more replies)
  2 siblings, 3 replies; 8+ messages in thread
From: Ulrich Mueller @ 2019-12-14 11:29 UTC (permalink / raw
  To: David Seifert; +Cc: gentoo-dev, python

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

>>>>> On Sat, 14 Dec 2019, David Seifert wrote:

>  case "${EAPI:-0}" in
> -	0|1|2|3|4|5|6|7)
> +	[01234])
> +		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
> +		;;
> +	[567])
>  		;;
>  	*)
>  		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"

I know that this exists in other eclasses as well, but do we really need
that distinction in the error message for "too old" and "unknown" EAPIs?
It should be pretty clear which case applies there, especially since the
message is addressed at developers, not users.

Ulrich

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

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

* Re: [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5
  2019-12-14 11:29 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 Ulrich Mueller
@ 2019-12-14 11:52   ` David Seifert
  2019-12-14 12:14   ` Michał Górny
  2019-12-14 12:20   ` David Seifert
  2 siblings, 0 replies; 8+ messages in thread
From: David Seifert @ 2019-12-14 11:52 UTC (permalink / raw
  To: Ulrich Mueller; +Cc: gentoo-dev, python

On Sat, 2019-12-14 at 12:29 +0100, Ulrich Mueller wrote:
> > > > > > On Sat, 14 Dec 2019, David Seifert wrote:
> >  case "${EAPI:-0}" in
> > -	0|1|2|3|4|5|6|7)
> > +	[01234])
> > +		die "Unsupported EAPI=${EAPI:-0} (too old) for
> > ${ECLASS}"
> > +		;;
> > +	[567])
> >  		;;
> >  	*)
> >  		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
> 
> I know that this exists in other eclasses as well, but do we really
> need
> that distinction in the error message for "too old" and "unknown"
> EAPIs?
> It should be pretty clear which case applies there, especially since
> the
> message is addressed at developers, not users.
> 
> Ulrich

This was just copypasta from the other python-r1.eclass. I personally
don't care either way, it should IMO just be consistent across the
tree.



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

* Re: [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5
  2019-12-14 11:29 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 Ulrich Mueller
  2019-12-14 11:52   ` David Seifert
@ 2019-12-14 12:14   ` Michał Górny
  2019-12-14 12:20   ` David Seifert
  2 siblings, 0 replies; 8+ messages in thread
From: Michał Górny @ 2019-12-14 12:14 UTC (permalink / raw
  To: gentoo-dev, David Seifert; +Cc: python

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

On Sat, 2019-12-14 at 12:29 +0100, Ulrich Mueller wrote:
> > > > > > On Sat, 14 Dec 2019, David Seifert wrote:
> >  case "${EAPI:-0}" in
> > -	0|1|2|3|4|5|6|7)
> > +	[01234])
> > +		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
> > +		;;
> > +	[567])
> >  		;;
> >  	*)
> >  		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
> 
> I know that this exists in other eclasses as well, but do we really need
> that distinction in the error message for "too old" and "unknown" EAPIs?
> It should be pretty clear which case applies there, especially since the
> message is addressed at developers, not users.
> 

Maybe not strictly necessary right now but it gives a clear distinction
whether the eclass hasn't been ported *yet* vs *won't* be ported at all.
This helps avoid people trying to add new EAPIs to eclasses that are
being deprecated.

-- 
Best regards,
Michał Górny


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 618 bytes --]

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

* Re: [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5
  2019-12-14 11:29 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 Ulrich Mueller
  2019-12-14 11:52   ` David Seifert
  2019-12-14 12:14   ` Michał Górny
@ 2019-12-14 12:20   ` David Seifert
  2019-12-14 12:30     ` Ulrich Mueller
  2 siblings, 1 reply; 8+ messages in thread
From: David Seifert @ 2019-12-14 12:20 UTC (permalink / raw
  To: gentoo-dev; +Cc: python

On Sat, 2019-12-14 at 12:29 +0100, Ulrich Mueller wrote:
> > > > > > On Sat, 14 Dec 2019, David Seifert wrote:
> >  case "${EAPI:-0}" in
> > -	0|1|2|3|4|5|6|7)
> > +	[01234])
> > +		die "Unsupported EAPI=${EAPI:-0} (too old) for
> > ${ECLASS}"
> > +		;;
> > +	[567])
> >  		;;
> >  	*)
> >  		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
> 
> I know that this exists in other eclasses as well, but do we really
> need
> that distinction in the error message for "too old" and "unknown"
> EAPIs?
> It should be pretty clear which case applies there, especially since
> the
> message is addressed at developers, not users.
> 
> Ulrich

Also, it makes egencache failures in overlays more descriptive, and
hence I'd keep it for the time being.



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

* Re: [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5
  2019-12-14 12:20   ` David Seifert
@ 2019-12-14 12:30     ` Ulrich Mueller
  0 siblings, 0 replies; 8+ messages in thread
From: Ulrich Mueller @ 2019-12-14 12:30 UTC (permalink / raw
  To: David Seifert; +Cc: gentoo-dev, python

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

>>>>> On Sat, 14 Dec 2019, David Seifert wrote:

> Also, it makes egencache failures in overlays more descriptive, and
> hence I'd keep it for the time being.

WFM

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

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

end of thread, other threads:[~2019-12-14 12:30 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-12-14 10:50 [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 David Seifert
2019-12-14 10:50 ` [gentoo-dev] [PATCH 2/3] python-utils-r1.eclass: " David Seifert
2019-12-14 10:50 ` [gentoo-dev] [PATCH 3/3] python-utils-r1.eclass: Remove Python 3.5 David Seifert
2019-12-14 11:29 ` [gentoo-dev] [PATCH 1/3] python-any-r1.eclass: Constrain to EAPI >= 5 Ulrich Mueller
2019-12-14 11:52   ` David Seifert
2019-12-14 12:14   ` Michał Górny
2019-12-14 12:20   ` David Seifert
2019-12-14 12:30     ` Ulrich Mueller

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