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 68AC9138350 for ; Tue, 7 Apr 2020 07:42:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 85B9EE0C3A; Tue, 7 Apr 2020 07:42:23 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 5943BE0C3A for ; Tue, 7 Apr 2020 07:42:23 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 099D634F08E for ; Tue, 7 Apr 2020 07:42:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 244C61C5 for ; Tue, 7 Apr 2020 07:42:20 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1586201747.764e4b954b8df8d9f1393fe514425c736f03aaf6.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/docs.eclass X-VCS-Directories: eclass/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: 764e4b954b8df8d9f1393fe514425c736f03aaf6 X-VCS-Branch: master Date: Tue, 7 Apr 2020 07:42:20 +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: 95b94135-2356-47dc-aca9-0631e017bff2 X-Archives-Hash: 46b3323adb4b41a14e9900bbe7897ad6 commit: 764e4b954b8df8d9f1393fe514425c736f03aaf6 Author: Andrew Ammerlaan riseup net> AuthorDate: Mon Apr 6 19:35:11 2020 +0000 Commit: Andrew Ammerlaan riseup net> CommitDate: Mon Apr 6 19:35:47 2020 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=764e4b95 eclass/docs: USE these handy _ECLASS variables to check if python-(any)-r1 has been inherited Package-Manager: Portage-2.3.96, Repoman-2.3.22 Signed-off-by: Andrew Ammerlaan riseup.net> eclass/docs.eclass | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/eclass/docs.eclass b/eclass/docs.eclass index e3eaaa3..2f243bd 100644 --- a/eclass/docs.eclass +++ b/eclass/docs.eclass @@ -86,18 +86,23 @@ esac # # Defaults to ${DOCDIR}/_build/html -# If PYHTON_COMPAT is not defined this is not a python -# package, if it is defined, odds are that either -# distutils-r1 or python-r1 is inherited as well -# in this case we cannot inherit python-any-r1 -# because these eclasses are incompatible. -# We also need to set 'something' to be able -# to inherit python-any-r1 at all -if [[ -z "${PYTHON_COMPAT}" ]]; then - PYTHON_COMPAT=( python3_{6,7,8} ) - inherit python-any-r1 -else - inherit python-r1 +if [[ ! ${_DOCS} ]]; then + +# For the python based DOCBUILDERS we need to inherit python-any-r1 +if [[ "${DOCBUILDER}"=="sphinx" || "${DOCBUILDER}"=="mkdocs" ]]; then + # If this is not a python package then + # this is not already set, so we need + # to set this to inherit python-any-r1 + if [[ -z "${PYTHON_COMPAT}" ]]; then + PYTHON_COMPAT=( python3_{6,7,8} ) + fi + + # Inherit python-any-r1 if neither python-any-r1 nor + # python-r1 have been inherited, because we need the + # python_gen_any_dep function + if [[ ! ${_PYTHON_R1} && ! ${_PYTHON_ANY_R1} ]]; then + inherit python-any-r1 + fi fi # @FUNCTION: python_check_deps @@ -162,7 +167,7 @@ sphinx_compile() { local confpy=${DOCDIR}/conf.py [[ -f ${confpy} ]] || - die "${confpy} not found, distutils_enable_sphinx call wrong" + die "${confpy} not found, DOCDIR=${DOCDIR} call wrong" if [[ ${AUTODOC} == 0 ]]; then if grep -F -q 'sphinx.ext.autodoc' "${confpy}"; then @@ -213,7 +218,7 @@ mkdocs_compile() { local mkdocsyml=${DOCDIR}/mkdocs.yml [[ -f ${mkdocsyml} ]] || - die "${mkdocsyml} not found, distutils_enable_mkdocs call wrong" + die "${mkdocsyml} not found, DOCDIR=${DOCDIR} wrong" pushd "${DOCDIR}" mkdocs build -d "${OUTDIR}" || die @@ -299,8 +304,11 @@ fi # If this is a python package using distutils-r1 # then put the compile function in the specific # python function, else just put it in src_compile -if [[ -n "${DISTUTILS_USE_SETUPTOOLS}" ]]; then +if [[ ${_DISTUTILS_R1} ]]; then python_compile_all() { docs_compile; } else src_compile() { docs_compile; } fi + +_DOCS=1 +fi 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 1D33A138350 for ; Mon, 6 Apr 2020 19:36:51 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5DD50E107F; Mon, 6 Apr 2020 19:36:50 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 32CAEE107F for ; Mon, 6 Apr 2020 19:36:50 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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 EB6AF34EE69 for ; Mon, 6 Apr 2020 19:36:48 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6B5DC1AC for ; Mon, 6 Apr 2020 19:36:46 +0000 (UTC) From: "Andrew Ammerlaan" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Andrew Ammerlaan" Message-ID: <1586201747.764e4b954b8df8d9f1393fe514425c736f03aaf6.andrewammerlaan@gentoo> Subject: [gentoo-commits] repo/proj/guru:dev commit in: eclass/ X-VCS-Repository: repo/proj/guru X-VCS-Files: eclass/docs.eclass X-VCS-Directories: eclass/ X-VCS-Committer: andrewammerlaan X-VCS-Committer-Name: Andrew Ammerlaan X-VCS-Revision: 764e4b954b8df8d9f1393fe514425c736f03aaf6 X-VCS-Branch: dev Date: Mon, 6 Apr 2020 19:36:46 +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: 9093813e-4ad1-4c90-b683-a25f43e0bf77 X-Archives-Hash: 3a1b2926bb6328e63c76e40aa2549672 Message-ID: <20200406193646.XSaNkiaG23RuzIqGS0_FiYfWRSbPWA0lH3JeFZGo2fY@z> commit: 764e4b954b8df8d9f1393fe514425c736f03aaf6 Author: Andrew Ammerlaan riseup net> AuthorDate: Mon Apr 6 19:35:11 2020 +0000 Commit: Andrew Ammerlaan riseup net> CommitDate: Mon Apr 6 19:35:47 2020 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=764e4b95 eclass/docs: USE these handy _ECLASS variables to check if python-(any)-r1 has been inherited Package-Manager: Portage-2.3.96, Repoman-2.3.22 Signed-off-by: Andrew Ammerlaan riseup.net> eclass/docs.eclass | 38 +++++++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 15 deletions(-) diff --git a/eclass/docs.eclass b/eclass/docs.eclass index e3eaaa3..2f243bd 100644 --- a/eclass/docs.eclass +++ b/eclass/docs.eclass @@ -86,18 +86,23 @@ esac # # Defaults to ${DOCDIR}/_build/html -# If PYHTON_COMPAT is not defined this is not a python -# package, if it is defined, odds are that either -# distutils-r1 or python-r1 is inherited as well -# in this case we cannot inherit python-any-r1 -# because these eclasses are incompatible. -# We also need to set 'something' to be able -# to inherit python-any-r1 at all -if [[ -z "${PYTHON_COMPAT}" ]]; then - PYTHON_COMPAT=( python3_{6,7,8} ) - inherit python-any-r1 -else - inherit python-r1 +if [[ ! ${_DOCS} ]]; then + +# For the python based DOCBUILDERS we need to inherit python-any-r1 +if [[ "${DOCBUILDER}"=="sphinx" || "${DOCBUILDER}"=="mkdocs" ]]; then + # If this is not a python package then + # this is not already set, so we need + # to set this to inherit python-any-r1 + if [[ -z "${PYTHON_COMPAT}" ]]; then + PYTHON_COMPAT=( python3_{6,7,8} ) + fi + + # Inherit python-any-r1 if neither python-any-r1 nor + # python-r1 have been inherited, because we need the + # python_gen_any_dep function + if [[ ! ${_PYTHON_R1} && ! ${_PYTHON_ANY_R1} ]]; then + inherit python-any-r1 + fi fi # @FUNCTION: python_check_deps @@ -162,7 +167,7 @@ sphinx_compile() { local confpy=${DOCDIR}/conf.py [[ -f ${confpy} ]] || - die "${confpy} not found, distutils_enable_sphinx call wrong" + die "${confpy} not found, DOCDIR=${DOCDIR} call wrong" if [[ ${AUTODOC} == 0 ]]; then if grep -F -q 'sphinx.ext.autodoc' "${confpy}"; then @@ -213,7 +218,7 @@ mkdocs_compile() { local mkdocsyml=${DOCDIR}/mkdocs.yml [[ -f ${mkdocsyml} ]] || - die "${mkdocsyml} not found, distutils_enable_mkdocs call wrong" + die "${mkdocsyml} not found, DOCDIR=${DOCDIR} wrong" pushd "${DOCDIR}" mkdocs build -d "${OUTDIR}" || die @@ -299,8 +304,11 @@ fi # If this is a python package using distutils-r1 # then put the compile function in the specific # python function, else just put it in src_compile -if [[ -n "${DISTUTILS_USE_SETUPTOOLS}" ]]; then +if [[ ${_DISTUTILS_R1} ]]; then python_compile_all() { docs_compile; } else src_compile() { docs_compile; } fi + +_DOCS=1 +fi