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 A1591138334 for ; Wed, 11 Dec 2019 09:47:42 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id CEAC4E0866; Wed, 11 Dec 2019 09:47:41 +0000 (UTC) Received: from smtp.gentoo.org (mail.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 A7662E0866 for ; Wed, 11 Dec 2019 09:47:41 +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 BCD7B34D930 for ; Wed, 11 Dec 2019 09:47:37 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 401C98A7 for ; Wed, 11 Dec 2019 09:47:36 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1576057635.8ae66dc29cd269a487cd96e293a6ed1315fa6f7a.grobian@gentoo> Subject: [gentoo-commits] repo/proj/prefix:master commit in: eclass/ X-VCS-Repository: repo/proj/prefix X-VCS-Files: eclass/python-utils-r1.eclass X-VCS-Directories: eclass/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: 8ae66dc29cd269a487cd96e293a6ed1315fa6f7a X-VCS-Branch: master Date: Wed, 11 Dec 2019 09:47:36 +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: 0b81c23f-96b6-40d5-b4e4-32ff70c38184 X-Archives-Hash: c95c06d7d702c64f46747c8c6ae71801 commit: 8ae66dc29cd269a487cd96e293a6ed1315fa6f7a Author: Fabian Groffen gentoo org> AuthorDate: Wed Dec 11 09:47:15 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Wed Dec 11 09:47:15 2019 +0000 URL: https://gitweb.gentoo.org/repo/proj/prefix.git/commit/?id=8ae66dc2 eclass/python-utils-r1: sync with gx86 Signed-off-by: Fabian Groffen gentoo.org> eclass/python-utils-r1.eclass | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass index 2ea5bab356..7d1f577534 100644 --- a/eclass/python-utils-r1.eclass +++ b/eclass/python-utils-r1.eclass @@ -164,11 +164,12 @@ _python_set_impls() { } # @FUNCTION: _python_impl_matches -# @USAGE: ... +# @USAGE: [...] # @INTERNAL # @DESCRIPTION: # Check whether the specified matches at least one # of the patterns following it. Return 0 if it does, 1 otherwise. +# Matches if no patterns are provided. # # can be in PYTHON_COMPAT or EPYTHON form. The patterns can be # either: @@ -176,17 +177,17 @@ _python_set_impls() { # b) '-2' to indicate all Python 2 variants (= !python_is_python3) # c) '-3' to indicate all Python 3 variants (= python_is_python3) _python_impl_matches() { - [[ ${#} -ge 2 ]] || die "${FUNCNAME}: takes at least 2 parameters" + [[ ${#} -ge 1 ]] || die "${FUNCNAME}: takes at least 1 parameter" + [[ ${#} -eq 1 ]] && return 0 local impl=${1} pattern shift for pattern; do if [[ ${pattern} == -2 ]]; then - ! python_is_python3 "${impl}" - return + python_is_python3 "${impl}" || return 0 elif [[ ${pattern} == -3 ]]; then - python_is_python3 "${impl}" + python_is_python3 "${impl}" && return 0 return # unify value style to allow lax matching elif [[ ${impl/./_} == ${pattern/./_} ]]; then @@ -1372,6 +1373,31 @@ python_export_utf8_locale() { return 0 } +# @FUNCTION: build_sphinx +# @USAGE: +# @DESCRIPTION: +# Build HTML documentation using dev-python/sphinx in the specified +# . Takes care of disabling Intersphinx and appending +# to HTML_DOCS. +# +# If is relative to the current directory, care needs +# to be taken to run einstalldocs from the same directory +# (usually ${S}). +build_sphinx() { + debug-print-function ${FUNCNAME} "${@}" + [[ ${#} -eq 1 ]] || die "${FUNCNAME} takes 1 arg: " + + local dir=${1} + + sed -i -e 's:^intersphinx_mapping:disabled_&:' \ + "${dir}"/conf.py || die + # not all packages include the Makefile in pypi tarball + sphinx-build -b html -d "${dir}"/_build/doctrees "${dir}" \ + "${dir}"/_build/html || die + + HTML_DOCS+=( "${dir}/_build/html/." ) +} + # -- python.eclass functions -- _python_check_dead_variables() {