[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gentoo-dev
Subject:    [gentoo-dev] Should Sphinx really depends on PYTHON_COMPAT/PYTHON_USEDEP for `dev-python/*` ebuilds?
From:       Alex Turbov <i.zaufi () gmail ! com>
Date:       2017-05-11 4:47:24
Message-ID: CANktQtuZSzxceyjPxJd2eb2GVovP_V8_ZzF-W8RoyM0y_eBBLA () mail ! gmail ! com
[Download RAW message or body]

Hi Gentoo devs,

I'd like to discuss one thing I've concernted for a long time already.
Recently I've done some `dev-python` ebuild. And as most Python packages
it also uses `dev-python/sphinx` to produce documentation. I want to note
that my primary (and default) Python version is 3.5 and I have some 2.7
packages
(ebuilds) only because they required by something else (really important to
me).
or when it is dependency of some other Python2-only package.

Unfortunately most of `dev-python/*` packages, to produce docs from RST
files,
have `DEPEND` on `dev-python/sphinx[${PYTHON_USEDEP}]`! However, being a
standalone application (just processing a bunch of RST files to HTMLs),
`/usr/bin/sphinx-build` **do not** actually depeds on `PYTHON_COMPAT` of
the ebuild it used inside! It just needs some/any interpreter it (Sphinx)
was "build" with!

So, nowadays Gentoo has some reeally weired IMO behaviour: to build docs for
some package from `dev-python/*` with `PYTHON_TARGETS` set to (for example)
2.7 and
3.5 Python versions, I have to build Sphinx also **for all enabled Python
versions**
of that package, meanwhile **only one** is needed (and really used)! This
is my
real concern: why I have to waste my disk+time to build `dev-python/*`
packages
with `PYTHON_TARGETS` I'll never use? Some of that packages are actually
dependencies
of other Python2-only packages. In other words, to build docs using Python
**3**
version/build of Sphinx, which is work pretty fine already, for Python2
enabled package,
I have to install a lot of Python-2 packages, dependencies of Sphinx to be
built w/ Python 2,
and enable `python2_7` for packages I've already have as Python3-only,
which in turn could
bring even more strange dependencies into scope.

Thus generally specking, Sphinx dependencies have no relations to `DEPEND`
of particular
`dev-python/*` ebuilds! So, in simple case there is should be enough to
specify

    DEPEND=( doc? ( dev-python/sphinx ) )

for that ebuilds. In some rare cases (like
https://bugs.gentoo.org/show_bug.cgi?id=618162)
Sphinx could use some extensions (plugins) and they also have no any
relation to `PYTHON_COMPAT`
of particular `dev-python/*` ebuild! That plugins to work need just the
same `PYTHON_TARGETS`
as used to build Sphinx. Unfortunately I can't find appropriate helper
function(s) in any
currently present Python reelated eclasses (or am I miss smth?), so I used
the following
dependency spec:

    DEPEND=( doc?
        || (
                (
                    dev-python/sphinx[python_targets_python2_7]
                    # NOTE This packages provide extensions for Sphinx
                    dev-python/rst-linker[python_targets_python2_7]
                    dev-python/jaraco-packaging[python_targets_python2_7]
                )
                (
                    dev-python/sphinx[python_targets_python3_5]
                    dev-python/rst-linker[python_targets_python3_5]
                    dev-python/jaraco-packaging[python_targets_python3_5]
                )
                (
                    dev-python/sphinx[python_targets_python3_6]
                    dev-python/rst-linker[python_targets_python3_6]
                    dev-python/jaraco-packaging[python_targets_python3_6]
                )
            )
      )

So, my questions are:

0. am I missed smth? (and there are some other cases, I don't know about)
1. am I missed smth? (and there are some helper functions exist in eclasses
to expess that kind
   of dependencies)
2. I think it would be nice to have some support for Sphinx in eclasses to
simplify ebuilds writing
   (if #1 is false)

Ideas/comments/opinions are really welcome...

[Attachment #3 (text/html)]

<div dir="ltr">Hi Gentoo devs,<br><br>I&#39;d like to discuss one thing I&#39;ve \
concernted for a long time already.<br>Recently I&#39;ve done some `dev-python` \
ebuild. And as most Python packages<br>it also uses `dev-python/sphinx` to produce \
documentation. I want to note<br>that my primary (and default) Python version is 3.5 \
and I have some 2.7 packages<br>(ebuilds) only because they required by something \
else (really important to me).<br>or when it is dependency of some other Python2-only \
package.<br><br>Unfortunately most of `dev-python/*` packages, to produce docs from \
RST files,<br>have `DEPEND` on `dev-python/sphinx[${PYTHON_USEDEP}]`! However, being \
a<br>standalone application (just processing a bunch of RST files to \
HTMLs),<br>`/usr/bin/sphinx-build` **do not** actually depeds on `PYTHON_COMPAT` \
of<br>the ebuild it used inside! It just needs some/any interpreter it \
(Sphinx)<br>was &quot;build&quot; with!<br><br>So, nowadays Gentoo has some reeally \
weired IMO behaviour: to build docs for<br>some package from `dev-python/*` with \
`PYTHON_TARGETS` set to (for example) 2.7 and<br>3.5 Python versions, I have to build \
Sphinx also **for all enabled Python versions**<br>of that package, meanwhile **only \
one** is needed (and really used)! This is my<br>real concern: why I have to waste my \
disk+time to build `dev-python/*` packages<br>with `PYTHON_TARGETS` I&#39;ll never \
use? Some of that packages are actually dependencies<br>of other Python2-only \
packages. In other words, to build docs using Python **3**<br>version/build of \
Sphinx, which is work pretty fine already, for Python2 enabled package,<br>I have to \
install a lot of Python-2 packages, dependencies of Sphinx to be built w/ Python \
2,<br>and enable `python2_7` for packages I&#39;ve already have as Python3-only, \
which in turn could<br>bring even more strange dependencies into scope.<br><br>Thus \
generally specking, Sphinx dependencies have no relations to `DEPEND` of \
particular<br>`dev-python/*` ebuilds! So, in simple case there is should be enough to \
specify<br><br>       DEPEND=( doc? ( dev-python/sphinx ) )<br><br>for that ebuilds. \
In some rare cases (like <a \
href="https://bugs.gentoo.org/show_bug.cgi?id=618162">https://bugs.gentoo.org/show_bug.cgi?id=618162</a>)<br>Sphinx \
could use some extensions (plugins) and they also have no any relation to \
`PYTHON_COMPAT`<br>of particular `dev-python/*` ebuild! That plugins to work need \
just the same `PYTHON_TARGETS`<br>as used to build Sphinx. Unfortunately I can&#39;t \
find appropriate helper function(s) in any<br>currently present Python reelated \
eclasses (or am I miss smth?), so I used the following<br>dependency spec:<br><br>    \
DEPEND=( doc? <br>               || ( <br>                               ( <br>       \
dev-python/sphinx[python_targets_python2_7] <br>                                      \
# NOTE This packages provide extensions for Sphinx<br>                                \
dev-python/rst-linker[python_targets_python2_7]<br>                                   \
dev-python/jaraco-packaging[python_targets_python2_7]<br>                             \
) <br>                               ( <br>                                       \
dev-python/sphinx[python_targets_python3_5] <br>                                      \
dev-python/rst-linker[python_targets_python3_5]<br>                                   \
dev-python/jaraco-packaging[python_targets_python3_5]<br>                             \
) <br>                               ( <br>                                       \
dev-python/sphinx[python_targets_python3_6] <br>                                      \
dev-python/rst-linker[python_targets_python3_6]<br>                                   \
dev-python/jaraco-packaging[python_targets_python3_6]<br>                             \
) <br>                       )<br>           )<br><br>So, my questions are:<br><br>0. \
am I missed smth? (and there are some other cases, I don&#39;t know about)<br>1. am I \
missed smth? (and there are some helper functions exist in eclasses to expess that \
kind <br>     of dependencies)<br>2. I think it would be nice to have some support \
for Sphinx in eclasses to simplify ebuilds writing<br>     (if #1 is false)<br>     \
<br>Ideas/comments/opinions are really welcome...<br><br><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic