public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] Should Sphinx really depends on PYTHON_COMPAT/PYTHON_USEDEP for `dev-python/*` ebuilds?
Date: Fri, 12 May 2017 20:32:53 +0200	[thread overview]
Message-ID: <1494613973.1885.4.camel@gentoo.org> (raw)
In-Reply-To: <CANktQtuZSzxceyjPxJd2eb2GVovP_V8_ZzF-W8RoyM0y_eBBLA@mail.gmail.com>

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

On czw, 2017-05-11 at 11:47 +0700, Alex Turbov wrote:
>     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]
>                 )
>             )
>       )
> 

One more thing I've missed in my initial mail. The other problem with
this solution (alone) is that it doesn't enforce the implementation that
satisfied the dependency.

Let's take a simple example. You've built sphinx for 2.7+3.5 but rst-
linker and jaraco-packaging for 3.5 only. The dependency is satisfied
because the 3.5 branch matches. However, you have no rule to enforce
3.5, so sphinx could be actually called with 2.7 and fail.

This is a generic problem that was pretty much solved by python-any-r1.
I think we should be able to copy the most important pieces of the API
to python-r1 to achieve something similar, i.e. add python_gen_any_dep
to generate the depstrings and make python_setup aware of
python_check_deps(). Then the above would be written alike:

  DEPEND="doc? ( $(python_gen_any_dep '
      dev-python/sphinx[${PYTHON_USEDEP}]
      dev-python/rst-linker[${PYTHON_USEDEP}]
      dev-python/jaraco-packaging[${PYTHON_USEDEP}]
    ') )"

  python_check_deps() {
    has_version "dev-python/sphinx[${PYTHON_USEDEP}]" &&
    has_version "dev-python/rst-linker[${PYTHON_USEDEP}]" &&
    has_version "dev-python/jaraco-packaging[${PYTHON_USEDEP}]"
  }

python_setup would verify which implementation has the dependencies
satisfied, and set it for the common code building docs.

However:

1. I think it would work. However, I can't be sure until I implement it,
and even then I might miss something.

2. It's a significant extension to the API, and kinda goes against
the goal of making the eclass simpler. However, it mostly fits what is
in python-any-r1 already, so at least it doesn't introduce a new API.

So I'd like others to chime in and let me know whether they consider
this a worthwhile addition before I start working on it.

-- 
Best regards,
Michał Górny

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 963 bytes --]

  parent reply	other threads:[~2017-05-12 18:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-11  4:47 [gentoo-dev] Should Sphinx really depends on PYTHON_COMPAT/PYTHON_USEDEP for `dev-python/*` ebuilds? Alex Turbov
2017-05-11  7:51 ` 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 [this message]
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=1494613973.1885.4.camel@gentoo.org \
    --to=mgorny@gentoo.org \
    --cc=gentoo-dev@lists.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