<div dir="ltr">Hi Gentoo devs,<br><br>I'd like to discuss one thing I've concernted for a long time already.<br>Recently I'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 "build" 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'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'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'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'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>