Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: python@g.o
Subject: [gentoo-dev] [PATCHES] python-r1.eclass: any-of dep API support
Date: Sat, 20 May 2017 13:31:09
Message-Id: 20170520133044.9692-1-mgorny@gentoo.org
1 Hi, everyone.
2
3 Here's a set of patches inspired by the recent Sphinx dependency
4 discussion. They make python-r1 (and therefore distutils-r1) capable
5 of any-of dependency logic similar to the one used in python-any-r1.
6
7 The basic goal is relatively simple -- to improve handling of pure
8 build-time dependencies in the eclass. It solves two common problems:
9
10 a. dependencies on packages that support only a subset of PYTHON_COMPAT,
11
12 b. dependencies that need to be implementation-bound between themselves
13 (e.g. Sphinx plugins).
14
15 The new API improves both of those cases significantly. For the former,
16 we no longer force user to select additional targets via REQUIRED_USE --
17 instead, we just any-of dependencies + python_check_deps() to select
18 implementation independently of whether it is enabled or not.
19
20 For the latter, we no longer have to force all targets of the package
21 on all the involved dependencies. Again, using any-of dep
22 and appropriate python_check_deps() we can enforce a single (any)
23 target throughout all the packages and use it.
24
25 The first three patches do some code refactoring that makes the change
26 easier and possibly improves maintainability of the code. The next two
27 patches add support for python_check_deps() and python_gen_any_dep()
28 respectively. The last two patches provide examples for both use cases
29 mentioned.
30
31 Please review.
32
33 --
34 Best regards,
35 Michał Górny

Replies