* [gentoo-dev] [PATCH 1/1]: distutils-r1.eclass: make distutils_enable_sphinx compatible with DISTUTILS_SINGLE_IMPL
@ 2021-01-16 13:49 Andrew Ammerlaan
2021-01-16 15:37 ` David Seifert
2021-01-16 17:19 ` Michał Górny
0 siblings, 2 replies; 4+ messages in thread
From: Andrew Ammerlaan @ 2021-01-16 13:49 UTC (permalink / raw
To: gentoo-dev
[-- Attachment #1: Type: text/plain, Size: 1585 bytes --]
See my previous email for the rational behind these changes. This closes
https://bugs.gentoo.org/704520 and the PR is here:
https://github.com/gentoo/gentoo/pull/19078
This eclass is maintained by @mgorny, so I would like to hear his
thoughts on these changes in particular.
Best regards,
Andrew
From 9645afdcd4efa7702b538e70bcf2fc4fec93c245 Mon Sep 17 00:00:00 2001
From: Andrew Ammerlaan <andrewammerlaan@riseup.net>
Date: Sat, 16 Jan 2021 14:27:00 +0100
Subject: [PATCH] eclass/distutils-r1: fix distutils_enable_sphinx with
DISTUTILS_SINGLE_IMPL
python-single-r1 does not have the python_gen_any_dep function
use the python_gen_cond_dep instead
Closes: https://bugs.gentoo.org/704520
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
---
eclass/distutils-r1.eclass | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 5ffc91be479cb..e2c1e1e403a76 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -329,9 +329,15 @@ distutils_enable_sphinx() {
die "${FUNCNAME}: do not pass --no-autodoc if external plugins are used"
fi
if [[ ${autodoc} ]]; then
- deps="$(python_gen_any_dep "
- dev-python/sphinx[\${PYTHON_USEDEP}]
- ${deps}")"
+ if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
+ deps="$(python_gen_cond_dep "
+ dev-python/sphinx[\${PYTHON_USEDEP}]
+ ${deps}")"
+ else
+ deps="$(python_gen_any_dep "
+ dev-python/sphinx[\${PYTHON_USEDEP}]
+ ${deps}")"
+ fi
python_check_deps() {
use doc || return 0
[-- Attachment #2: Type: text/html, Size: 2282 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [PATCH 1/1]: distutils-r1.eclass: make distutils_enable_sphinx compatible with DISTUTILS_SINGLE_IMPL
2021-01-16 13:49 [gentoo-dev] [PATCH 1/1]: distutils-r1.eclass: make distutils_enable_sphinx compatible with DISTUTILS_SINGLE_IMPL Andrew Ammerlaan
@ 2021-01-16 15:37 ` David Seifert
2021-01-16 17:19 ` Michał Górny
1 sibling, 0 replies; 4+ messages in thread
From: David Seifert @ 2021-01-16 15:37 UTC (permalink / raw
To: gentoo-dev
On Sat, 2021-01-16 at 14:49 +0100, Andrew Ammerlaan wrote:
> See my previous email for the rational behind these changes. This
> closes https://bugs.gentoo.org/704520 and the PR is here:
> https://github.com/gentoo/gentoo/pull/19078
> This eclass is maintained by @mgorny, so I would like to hear his
> thoughts on these changes in particular.
> Best regards,
> Andrew
>
> From 9645afdcd4efa7702b538e70bcf2fc4fec93c245 Mon Sep 17 00:00:00 2001
> From: Andrew Ammerlaan <andrewammerlaan@riseup.net>
> Date: Sat, 16 Jan 2021 14:27:00 +0100
> Subject: [PATCH] eclass/distutils-r1: fix distutils_enable_sphinx with
> DISTUTILS_SINGLE_IMPL
>
> python-single-r1 does not have the python_gen_any_dep function
> use the python_gen_cond_dep instead
>
> Closes: https://bugs.gentoo.org/704520
>
> Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
> ---
> eclass/distutils-r1.eclass | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
> index 5ffc91be479cb..e2c1e1e403a76 100644
> --- a/eclass/distutils-r1.eclass
> +++ b/eclass/distutils-r1.eclass
> @@ -329,9 +329,15 @@ distutils_enable_sphinx() {
> die "${FUNCNAME}: do not pass --no-autodoc if
> external plugins are used"
> fi
> if [[ ${autodoc} ]]; then
> - deps="$(python_gen_any_dep "
> - dev-python/sphinx[\${PYTHON_USEDEP}]
> - ${deps}")"
> + if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
> + deps="$(python_gen_cond_dep "
> + dev-python/sphinx[\${PYTHON_USEDEP}]
> + ${deps}")"
> + else
> + deps="$(python_gen_any_dep "
> + dev-python/sphinx[\${PYTHON_USEDEP}]
> + ${deps}")"
> + fi
>
> python_check_deps() {
> use doc || return 0
>
Please always send s plaintext email.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [PATCH 1/1]: distutils-r1.eclass: make distutils_enable_sphinx compatible with DISTUTILS_SINGLE_IMPL
2021-01-16 13:49 [gentoo-dev] [PATCH 1/1]: distutils-r1.eclass: make distutils_enable_sphinx compatible with DISTUTILS_SINGLE_IMPL Andrew Ammerlaan
2021-01-16 15:37 ` David Seifert
@ 2021-01-16 17:19 ` Michał Górny
2021-01-16 18:53 ` [gentoo-dev] [PATCH 1/1 v2]: " Andrew Ammerlaan
1 sibling, 1 reply; 4+ messages in thread
From: Michał Górny @ 2021-01-16 17:19 UTC (permalink / raw
To: gentoo-dev
On Sat, 2021-01-16 at 14:49 +0100, Andrew Ammerlaan wrote:
> See my previous email for the rational behind these changes. This closes
> https://bugs.gentoo.org/704520 and the PR is here:
> https://github.com/gentoo/gentoo/pull/19078
>
> This eclass is maintained by @mgorny, so I would like to hear his
> thoughts on these changes in particular.
>
> Best regards,
> Andrew
>
>
> From 9645afdcd4efa7702b538e70bcf2fc4fec93c245 Mon Sep 17 00:00:00 2001
> From: Andrew Ammerlaan <andrewammerlaan@riseup.net>
> Date: Sat, 16 Jan 2021 14:27:00 +0100
> Subject: [PATCH] eclass/distutils-r1: fix distutils_enable_sphinx with
> DISTUTILS_SINGLE_IMPL
>
> python-single-r1 does not have the python_gen_any_dep function
> use the python_gen_cond_dep instead
>
> Closes: https://bugs.gentoo.org/704520
>
> Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
> ---
> eclass/distutils-r1.eclass | 12 +++++++++---
> 1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
> index 5ffc91be479cb..e2c1e1e403a76 100644
> --- a/eclass/distutils-r1.eclass
> +++ b/eclass/distutils-r1.eclass
> @@ -329,9 +329,15 @@ distutils_enable_sphinx() {
> die "${FUNCNAME}: do not pass --no-autodoc if external plugins are used"
> fi
> if [[ ${autodoc} ]]; then
> - deps="$(python_gen_any_dep "
> - dev-python/sphinx[\${PYTHON_USEDEP}]
> - ${deps}")"
> + if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
> + deps="$(python_gen_cond_dep "
> + dev-python/sphinx[\${PYTHON_USEDEP}]
> + ${deps}")"
> + else
> + deps="$(python_gen_any_dep "
> + dev-python/sphinx[\${PYTHON_USEDEP}]
I see an opportunity to move prepending sphinx before in the common
code.
> + ${deps}")"
> + fi
>
>
>
>
> python_check_deps() {
> use doc || return 0
>
--
Best regards,
Michał Górny
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [gentoo-dev] [PATCH 1/1 v2]: distutils-r1.eclass: make distutils_enable_sphinx compatible with DISTUTILS_SINGLE_IMPL
2021-01-16 17:19 ` Michał Górny
@ 2021-01-16 18:53 ` Andrew Ammerlaan
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Ammerlaan @ 2021-01-16 18:53 UTC (permalink / raw
To: gentoo-dev
version 2: now prepending dev-python/sphinx before calling
python_gen_*_dep functions as suggested by @mgorny. The check that
prevents --no-autodoc form being set while additional dependencies are
added is moved into the if statement, because ${deps} is now always non
empty.
Best regards,
Andrew
On 16/01/2021 18:19, Michał Górny wrote:
> On Sat, 2021-01-16 at 14:49 +0100, Andrew Ammerlaan wrote:
>> See my previous email for the rational behind these changes. This closes
>> https://bugs.gentoo.org/704520 and the PR is here:
>> https://github.com/gentoo/gentoo/pull/19078
>>
>> This eclass is maintained by @mgorny, so I would like to hear his
>> thoughts on these changes in particular.
>>
>> Best regards,
>> Andrew
>
> I see an opportunity to move prepending sphinx before in the common
> code.
>
From caf841204458e618a1a6d388717a731e7cd94b88 Mon Sep 17 00:00:00 2001
From: Andrew Ammerlaan <andrewammerlaan@riseup.net>
Date: Sat, 16 Jan 2021 14:27:00 +0100
Subject: [PATCH] eclass/distutils-r1: fix distutils_enable_sphinx with
DISTUTILS_SINGLE_IMPL
python-single-r1 does not have the python_gen_any_dep function
use the python_gen_cond_dep instead
Closes: https://bugs.gentoo.org/704520
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
---
eclass/distutils-r1.eclass | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/eclass/distutils-r1.eclass b/eclass/distutils-r1.eclass
index 5ffc91be479cb..3d2bec5bfcb32 100644
--- a/eclass/distutils-r1.eclass
+++ b/eclass/distutils-r1.eclass
@@ -316,22 +316,25 @@ distutils_enable_sphinx() {
_DISTUTILS_SPHINX_PLUGINS=( "${@}" )
local deps autodoc=1 d
+ deps="dev-python/sphinx[\${PYTHON_USEDEP}]"
for d; do
if [[ ${d} == --no-autodoc ]]; then
autodoc=
else
deps+="
${d}[\${PYTHON_USEDEP}]"
+ if [[ ! ${autodoc} ]]; then
+ die "${FUNCNAME}: do not pass --no-autodoc if external plugins are
used"
+ fi
fi
done
- if [[ ! ${autodoc} && -n ${deps} ]]; then
- die "${FUNCNAME}: do not pass --no-autodoc if external plugins are used"
- fi
if [[ ${autodoc} ]]; then
- deps="$(python_gen_any_dep "
- dev-python/sphinx[\${PYTHON_USEDEP}]
- ${deps}")"
+ if [[ ${DISTUTILS_SINGLE_IMPL} ]]; then
+ deps="$(python_gen_cond_dep "${deps}")"
+ else
+ deps="$(python_gen_any_dep "${deps}")"
+ fi
python_check_deps() {
use doc || return 0
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2021-01-16 18:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-01-16 13:49 [gentoo-dev] [PATCH 1/1]: distutils-r1.eclass: make distutils_enable_sphinx compatible with DISTUTILS_SINGLE_IMPL Andrew Ammerlaan
2021-01-16 15:37 ` David Seifert
2021-01-16 17:19 ` Michał Górny
2021-01-16 18:53 ` [gentoo-dev] [PATCH 1/1 v2]: " Andrew Ammerlaan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox