From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 505831382C5 for ; Fri, 9 Apr 2021 21:57:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 69904E08ED; Fri, 9 Apr 2021 21:57:27 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 40D64E08ED for ; Fri, 9 Apr 2021 21:57:27 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 38AD3335D30 for ; Fri, 9 Apr 2021 21:57:26 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 98F52647 for ; Fri, 9 Apr 2021 21:57:23 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1618005397.bdcfb21ca5a84567e9c9d6a456374a05e798f78e.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/ X-VCS-Repository: repo/gentoo X-VCS-Files: eclass/python-utils-r1.eclass X-VCS-Directories: eclass/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: bdcfb21ca5a84567e9c9d6a456374a05e798f78e X-VCS-Branch: master Date: Fri, 9 Apr 2021 21:57:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: e9a7f530-62b6-4b5d-908e-2917f9470aac X-Archives-Hash: 2afc677b89a04a3720c39502d2b1e3fa commit: bdcfb21ca5a84567e9c9d6a456374a05e798f78e Author: Michał Górny gentoo org> AuthorDate: Wed Apr 7 08:28:29 2021 +0000 Commit: Michał Górny gentoo org> CommitDate: Fri Apr 9 21:56:37 2021 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bdcfb21c python-utils-r1.eclass: Remove support for EAPIs prior to 6 Signed-off-by: Michał Górny 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 03251a77e40..2a6d74bf343 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -7,7 +7,7 @@ # @AUTHOR: # Author: Michał Górny # Based on work of: Krzysztof Pawlik -# @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,16 +1270,12 @@ 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 ) - local args=( # verbose progress reporting and tracebacks -vv @@ -1304,7 +1288,7 @@ epytest() { set -- "${EPYTHON}" -m pytest "${args[@]}" "${@}" echo "${@}" >&2 - "${@}" || die "${die_args[@]}" "pytest failed with ${EPYTHON}" + "${@}" || die -n "pytest failed with ${EPYTHON}" return ${?} } @@ -1314,20 +1298,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 ${?} }