public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH 1/5] distutils-r1.eclass: Remove support for EAPIs prior to 6
@ 2021-04-08  7:43 Michał Górny
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 2/5] python-r1.eclass: " Michał Górny
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Michał Górny @ 2021-04-08  7:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/distutils-r1.eclass | 84 ++++++--------------------------------
 1 file changed, 12 insertions(+), 72 deletions(-)

diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 24c5653aad06..2994993e63e8 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -7,7 +7,7 @@
 # @AUTHOR:
 # Author: Michał Górny <mgorny@gentoo.org>
 # Based on the work of: Krzysztof Pawlik <nelchael@gentoo.org>
-# @SUPPORTED_EAPIS: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: A simple eclass to build Python packages using distutils.
 # @DESCRIPTION:
 # A simple eclass providing functions to build Python packages using
@@ -44,10 +44,10 @@
 # https://dev.gentoo.org/~mgorny/python-guide/
 
 case "${EAPI:-0}" in
-	0|1|2|3|4)
+	[0-5])
 		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
 		;;
-	5|6|7)
+	[6-7])
 		;;
 	*)
 		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@@ -97,8 +97,7 @@ esac
 
 if [[ ! ${_DISTUTILS_R1} ]]; then
 
-[[ ${EAPI} == [456] ]] && inherit eutils
-[[ ${EAPI} == [56] ]] && inherit xdg-utils
+[[ ${EAPI} == 6 ]] && inherit eutils xdg-utils
 inherit multiprocessing toolchain-funcs
 
 if [[ ! ${DISTUTILS_SINGLE_IMPL} ]]; then
@@ -146,7 +145,7 @@ _distutils_set_globals() {
 	fi
 
 	RDEPEND="${PYTHON_DEPS} ${rdep}"
-	if [[ ${EAPI} != [56] ]]; then
+	if [[ ${EAPI} != 6 ]]; then
 		BDEPEND="${PYTHON_DEPS} ${bdep}"
 	else
 		DEPEND="${PYTHON_DEPS} ${bdep}"
@@ -202,26 +201,6 @@ unset -f _distutils_set_globals
 # HTML_DOCS=( doc/html/. )
 # @CODE
 
-# @ECLASS-VARIABLE: EXAMPLES
-# @DEFAULT_UNSET
-# @DESCRIPTION:
-# OBSOLETE: this variable is deprecated and banned in EAPI 6
-#
-# An array containing examples installed into 'examples' doc
-# subdirectory. The files and directories listed there must exist
-# in the directory from which distutils-r1_python_install_all() is run
-# (${S} by default).
-#
-# The 'examples' subdirectory will be marked not to be compressed
-# automatically.
-#
-# If unset, no examples will be installed.
-#
-# Example:
-# @CODE
-# EXAMPLES=( examples/. demos/. )
-# @CODE
-
 # @ECLASS-VARIABLE: DISTUTILS_IN_SOURCE_BUILD
 # @DEFAULT_UNSET
 # @DESCRIPTION:
@@ -369,7 +348,7 @@ distutils_enable_sphinx() {
 	python_compile_all() { sphinx_compile_all; }
 
 	IUSE+=" doc"
-	if [[ ${EAPI} == [56] ]]; then
+	if [[ ${EAPI} == 6 ]]; then
 		DEPEND+=" doc? ( ${deps} )"
 	else
 		BDEPEND+=" doc? ( ${deps} )"
@@ -448,7 +427,7 @@ distutils_enable_tests() {
 	if [[ -n ${test_deps} ]]; then
 		IUSE+=" test"
 		RESTRICT+=" !test? ( test )"
-		if [[ ${EAPI} == [56] ]]; then
+		if [[ ${EAPI} == 6 ]]; then
 			DEPEND+=" test? ( ${test_deps} )"
 		else
 			BDEPEND+=" test? ( ${test_deps} )"
@@ -480,9 +459,6 @@ esetup.py() {
 
 	[[ -n ${EPYTHON} ]] || die "EPYTHON unset, invalid call context"
 
-	local die_args=()
-	[[ ${EAPI} != [45] ]] && die_args+=( -n )
-
 	[[ ${BUILD_DIR} ]] && _distutils-r1_create_setup_cfg
 
 	local setup_py=( setup.py )
@@ -494,11 +470,11 @@ esetup.py() {
 	set -- "${EPYTHON}" "${setup_py[@]}" "${mydistutilsargs[@]}" "${@}"
 
 	echo "${@}" >&2
-	"${@}" || die "${die_args[@]}"
+	"${@}" || die -n
 	local ret=${?}
 
 	if [[ ${BUILD_DIR} ]]; then
-		rm "${HOME}"/.pydistutils.cfg || die "${die_args[@]}"
+		rm "${HOME}"/.pydistutils.cfg || die -n
 	fi
 
 	return ${ret}
@@ -621,12 +597,7 @@ distutils-r1_python_prepare_all() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	if [[ ! ${DISTUTILS_OPTIONAL} ]]; then
-		if [[ ${EAPI} != [45] ]]; then
-			default
-		else
-			[[ ${PATCHES} ]] && epatch "${PATCHES[@]}"
-			epatch_user
-		fi
+		default
 	fi
 
 	# by default, use in-source build if python_prepare() is used
@@ -648,24 +619,6 @@ distutils-r1_python_prepare_all() {
 	_DISTUTILS_DEFAULT_CALLED=1
 }
 
-# @FUNCTION: distutils-r1_python_prepare
-# @DESCRIPTION:
-# The default python_prepare(). A no-op.
-distutils-r1_python_prepare() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	[[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI 6 (it was a no-op)"
-}
-
-# @FUNCTION: distutils-r1_python_configure
-# @DESCRIPTION:
-# The default python_configure(). A no-op.
-distutils-r1_python_configure() {
-	debug-print-function ${FUNCNAME} "${@}"
-
-	[[ ${EAPI} == [45] ]] || die "${FUNCNAME} is banned in EAPI 6 (it was a no-op)"
-}
-
 # @FUNCTION: _distutils-r1_create_setup_cfg
 # @INTERNAL
 # @DESCRIPTION:
@@ -941,16 +894,6 @@ distutils-r1_python_install_all() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	einstalldocs
-
-	if declare -p EXAMPLES &>/dev/null; then
-		[[ ${EAPI} != [45] ]] && die "EXAMPLES are banned in EAPI ${EAPI}"
-
-		(
-			docinto examples
-			dodoc -r "${EXAMPLES[@]}"
-		)
-		docompress -x "/usr/share/doc/${PF}/examples"
-	fi
 }
 
 # @FUNCTION: distutils-r1_run_phase
@@ -1081,10 +1024,7 @@ distutils-r1_src_prepare() {
 	fi
 
 	if [[ ! ${_DISTUTILS_DEFAULT_CALLED} ]]; then
-		local cmd=die
-		[[ ${EAPI} == [45] ]] && cmd=eqawarn
-
-		"${cmd}" "QA: python_prepare_all() didn't call distutils-r1_python_prepare_all"
+		die "QA: python_prepare_all() didn't call distutils-r1_python_prepare_all"
 	fi
 
 	if declare -f python_prepare >/dev/null; then
@@ -1094,7 +1034,7 @@ distutils-r1_src_prepare() {
 
 distutils-r1_src_configure() {
 	python_export_utf8_locale
-	[[ ${EAPI} == [56] ]] && xdg_environment_reset # Bug 577704
+	[[ ${EAPI} == 6 ]] && xdg_environment_reset # Bug 577704
 
 	if declare -f python_configure >/dev/null; then
 		_distutils-r1_run_foreach_impl python_configure
-- 
2.31.1



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

* [gentoo-dev] [PATCH 2/5] python-r1.eclass: Remove support for EAPIs prior to 6
  2021-04-08  7:43 [gentoo-dev] [PATCH 1/5] distutils-r1.eclass: Remove support for EAPIs prior to 6 Michał Górny
@ 2021-04-08  7:43 ` Michał Górny
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 3/5] python-single-r1.eclass: " Michał Górny
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2021-04-08  7:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-r1.eclass | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/eclass/python-r1.eclass b/eclass/python-r1.eclass
index f7beb3006499..1eb68270a0b3 100644
--- a/eclass/python-r1.eclass
+++ b/eclass/python-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: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: A common, simple eclass for Python packages.
 # @DESCRIPTION:
 # A common eclass providing helper functions to build and install
@@ -30,11 +30,10 @@
 # https://dev.gentoo.org/~mgorny/python-guide/
 
 case "${EAPI:-0}" in
-	0|1|2|3|4)
+	[0-5])
 		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
 		;;
-	5|6|7)
-		# EAPI=5 is required for sane USE_EXPAND dependencies
+	[6-7])
 		;;
 	*)
 		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
@@ -49,7 +48,6 @@ elif [[ ${_PYTHON_ANY_R1} ]]; then
 	die 'python-r1.eclass can not be used with python-any-r1.eclass.'
 fi
 
-[[ ${EAPI} == [45] ]] && inherit eutils
 inherit multibuild python-utils-r1
 
 fi
-- 
2.31.1



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

* [gentoo-dev] [PATCH 3/5] python-single-r1.eclass: Remove support for EAPIs prior to 6
  2021-04-08  7:43 [gentoo-dev] [PATCH 1/5] distutils-r1.eclass: Remove support for EAPIs prior to 6 Michał Górny
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 2/5] python-r1.eclass: " Michał Górny
@ 2021-04-08  7:43 ` Michał Górny
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 4/5] python-any-r1.eclass: " Michał Górny
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 5/5] python-utils-r1.eclass: " Michał Górny
  3 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2021-04-08  7:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-single-r1.eclass | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/eclass/python-single-r1.eclass b/eclass/python-single-r1.eclass
index fafd11021dd0..07db2d762ded 100644
--- a/eclass/python-single-r1.eclass
+++ b/eclass/python-single-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: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: An eclass for Python packages not installed for multiple implementations.
 # @DESCRIPTION:
 # An extension of the python-r1 eclass suite for packages which
@@ -37,11 +37,10 @@
 # https://dev.gentoo.org/~mgorny/python-guide/
 
 case "${EAPI:-0}" in
-	0|1|2|3|4)
+	[0-5])
 		die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}"
 		;;
-	5|6|7)
-		# EAPI=5 is required for sane USE_EXPAND dependencies
+	[6-7])
 		;;
 	*)
 		die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}"
-- 
2.31.1



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

* [gentoo-dev] [PATCH 4/5] python-any-r1.eclass: Remove support for EAPIs prior to 6
  2021-04-08  7:43 [gentoo-dev] [PATCH 1/5] distutils-r1.eclass: Remove support for EAPIs prior to 6 Michał Górny
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 2/5] python-r1.eclass: " Michał Górny
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 3/5] python-single-r1.eclass: " Michał Górny
@ 2021-04-08  7:43 ` Michał Górny
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 5/5] python-utils-r1.eclass: " Michał Górny
  3 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2021-04-08  7:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-any-r1.eclass | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/eclass/python-any-r1.eclass b/eclass/python-any-r1.eclass
index 3a80fa35c577..49f639d5fac6 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: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: An eclass for packages having build-time dependency on Python.
 # @DESCRIPTION:
 # A minimal eclass for packages which need any Python interpreter
@@ -38,8 +38,8 @@
 # https://dev.gentoo.org/~mgorny/python-guide/
 
 case "${EAPI:-0}" in
-	[0-4]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
-	[5-7]) ;;
+	[0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
+	[6-7]) ;;
 	*)     die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
 esac
 
-- 
2.31.1



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

* [gentoo-dev] [PATCH 5/5] python-utils-r1.eclass: Remove support for EAPIs prior to 6
  2021-04-08  7:43 [gentoo-dev] [PATCH 1/5] distutils-r1.eclass: Remove support for EAPIs prior to 6 Michał Górny
                   ` (2 preceding siblings ...)
  2021-04-08  7:43 ` [gentoo-dev] [PATCH 4/5] python-any-r1.eclass: " Michał Górny
@ 2021-04-08  7:43 ` Michał Górny
  3 siblings, 0 replies; 5+ messages in thread
From: Michał Górny @ 2021-04-08  7:43 UTC (permalink / raw
  To: gentoo-dev; +Cc: Michał Górny

Signed-off-by: Michał Górny <mgorny@gentoo.org>
---
 eclass/python-utils-r1.eclass | 46 ++++++++++-------------------------
 1 file changed, 13 insertions(+), 33 deletions(-)

diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
index d0bfb7819059..55cf5f3404d7 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: 5 6 7
+# @SUPPORTED_EAPIS: 6 7
 # @BLURB: Utility functions for packages with Python parts.
 # @DESCRIPTION:
 # A utility eclass providing functions to query Python implementations,
@@ -20,8 +20,8 @@
 # https://dev.gentoo.org/~mgorny/python-guide/
 
 case "${EAPI:-0}" in
-	[0-4]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
-	[5-7]) ;;
+	[0-5]) die "Unsupported EAPI=${EAPI:-0} (too old) for ${ECLASS}" ;;
+	[6-7]) ;;
 	*)     die "Unsupported EAPI=${EAPI} (unknown) for ${ECLASS}" ;;
 esac
 
@@ -31,7 +31,6 @@ fi
 
 if [[ ! ${_PYTHON_UTILS_R1} ]]; then
 
-[[ ${EAPI} == 5 ]] && inherit eutils multilib
 inherit toolchain-funcs
 
 # @ECLASS-VARIABLE: _PYTHON_ALL_IMPLS
@@ -1013,16 +1012,8 @@ python_is_python3() {
 python_is_installed() {
 	local impl=${1:-${EPYTHON}}
 	[[ ${impl} ]] || die "${FUNCNAME}: no impl nor EPYTHON"
-	local hasv_args=()
-
-	case ${EAPI} in
-		5|6)
-			hasv_args+=( --host-root )
-			;;
-		*)
-			hasv_args+=( -b )
-			;;
-	esac
+	local hasv_args=( -b )
+	[[ ${EAPI} == 6 ]] && hasv_args=( --host-root )
 
 	local PYTHON_PKG_DEP
 	_python_export "${impl}" PYTHON_PKG_DEP
@@ -1169,17 +1160,14 @@ python_fix_shebang() {
 		done < <(find -H "${path}" -type f -print0 || die)
 
 		if [[ ! ${any_fixed} ]]; then
-			local cmd=eerror
-			[[ ${EAPI} == 5 ]] && cmd=eqawarn
-
-			"${cmd}" "QA warning: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files."
+			eerror "QA error: ${FUNCNAME}, ${path#${D%/}} did not match any fixable files."
 			if [[ ${any_correct} ]]; then
-				"${cmd}" "All files have ${EPYTHON} shebang already."
+				eerror "All files have ${EPYTHON} shebang already."
 			else
-				"${cmd}" "There are no Python files in specified directory."
+				eerror "There are no Python files in specified directory."
 			fi
 
-			[[ ${cmd} == eerror ]] && die "${FUNCNAME} did not match any fixable files (QA warning fatal in EAPI ${EAPI})"
+			die "${FUNCNAME} did not match any fixable files"
 		fi
 	done
 }
@@ -1282,20 +1270,16 @@ build_sphinx() {
 # Run pytest, passing the standard set of pytest options, followed
 # by user-specified options.
 #
-# This command dies on failure and respects nonfatal in EAPIs supporting
-# nonfatal die.
+# This command dies on failure and respects nonfatal.
 epytest() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ -n ${EPYTHON} ]] || die "EPYTHON unset, invalid call context"
 
-	local die_args=()
-	[[ ${EAPI} != [45] ]] && die_args+=( -n )
-
 	set -- "${EPYTHON}" -m pytest -vv -ra "${@}"
 
 	echo "${@}" >&2
-	"${@}" || die "${die_args[@]}" "pytest failed with ${EPYTHON}"
+	"${@}" || die -n "pytest failed with ${EPYTHON}"
 	return ${?}
 }
 
@@ -1305,20 +1289,16 @@ epytest() {
 # Run unit tests using dev-python/unittest-or-fail, passing the standard
 # set of options, followed by user-specified options.
 #
-# This command dies on failure and respects nonfatal in EAPIs supporting
-# nonfatal die.
+# This command dies on failure and respects nonfatal.
 eunittest() {
 	debug-print-function ${FUNCNAME} "${@}"
 
 	[[ -n ${EPYTHON} ]] || die "EPYTHON unset, invalid call context"
 
-	local die_args=()
-	[[ ${EAPI} != [45] ]] && die_args+=( -n )
-
 	set -- "${EPYTHON}" -m unittest_or_fail discover -v "${@}"
 
 	echo "${@}" >&2
-	"${@}" || die "${die_args[@]}" "Tests failed with ${EPYTHON}"
+	"${@}" || die -n "Tests failed with ${EPYTHON}"
 	return ${?}
 }
 
-- 
2.31.1



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

end of thread, other threads:[~2021-04-08  7:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-04-08  7:43 [gentoo-dev] [PATCH 1/5] distutils-r1.eclass: Remove support for EAPIs prior to 6 Michał Górny
2021-04-08  7:43 ` [gentoo-dev] [PATCH 2/5] python-r1.eclass: " Michał Górny
2021-04-08  7:43 ` [gentoo-dev] [PATCH 3/5] python-single-r1.eclass: " Michał Górny
2021-04-08  7:43 ` [gentoo-dev] [PATCH 4/5] python-any-r1.eclass: " Michał Górny
2021-04-08  7:43 ` [gentoo-dev] [PATCH 5/5] python-utils-r1.eclass: " Michał Górny

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