From: Daniel Campbell <zlg@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: Thu, 18 May 2017 15:07:03 -0700 [thread overview]
Message-ID: <20170518220702.GB3460@sporkbox> (raw)
In-Reply-To: <1494613973.1885.4.camel@gentoo.org>
[-- Attachment #1: Type: text/plain, Size: 3761 bytes --]
On Fri, May 12, 2017 at 08:32:53PM +0200, Michał Górny wrote:
> 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
Would this bloat python-r1 too much? I understand the need to keep
eclasses small and efficient. This looks like it might work, and I'm
willing to test it, though I'd need some time to learn how to properly
test Python packages. Is #gentoo-python a good place to seek guidance,
after looking through docs?
Is this a unique-enough case to justify a python-doc eclass? It looks
like it would depend on python-any* or python-r* anyway, so maybe it's a
bit redundant. It's an option, though.
I hadn't considered the dependency <-> implementation relationship; nice
catch! If what you wrote above is as clean as we can get it, I'm
willing to help you on it. I'm just not sure how I'd be most helpful
since I've never written an eclass.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2017-05-18 22:07 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
2017-05-18 22:07 ` Daniel Campbell [this message]
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=20170518220702.GB3460@sporkbox \
--to=zlg@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