public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Alex Turbov <i.zaufi@gmail.com>
To: gentoo-dev@lists.gentoo.org
Cc: "Michał Górny" <mgorny@gentoo.org>
Subject: [gentoo-dev] Should Sphinx really depends on PYTHON_COMPAT/PYTHON_USEDEP for `dev-python/*` ebuilds?
Date: Thu, 11 May 2017 11:47:24 +0700	[thread overview]
Message-ID: <CANktQtuZSzxceyjPxJd2eb2GVovP_V8_ZzF-W8RoyM0y_eBBLA@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 3669 bytes --]

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 #2: Type: text/html, Size: 4339 bytes --]

             reply	other threads:[~2017-05-11  4:47 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  4:47 Alex Turbov [this message]
2017-05-11  7:51 ` [gentoo-dev] Should Sphinx really depends on PYTHON_COMPAT/PYTHON_USEDEP for `dev-python/*` ebuilds? Michał Górny
2017-05-12  6:20   ` Alex Turbov
2017-05-12 17:18     ` Michał Górny
2017-05-13  0:42   ` Daniel Campbell
2017-05-13  1:28     ` Dale
2017-05-13  7:32     ` Michał Górny
2017-05-18  4:44       ` Daniel Campbell
2017-05-18  5:10         ` Michał Górny
2017-05-18  6:23           ` Alex Turbov
2017-05-18  6:46             ` Michał Górny
2017-05-12 18:32 ` Michał Górny
2017-05-18 22:07   ` Daniel Campbell
2017-05-18 22:30     ` Michał Górny
2017-05-19  1:18       ` Daniel Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CANktQtuZSzxceyjPxJd2eb2GVovP_V8_ZzF-W8RoyM0y_eBBLA@mail.gmail.com \
    --to=i.zaufi@gmail.com \
    --cc=gentoo-dev@lists.gentoo.org \
    --cc=mgorny@gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox