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...