Gentoo Archives: gentoo-dev

From: Matt Turner <mattst88@g.o>
To: gentoo development <gentoo-dev@l.g.o>
Cc: "Michał Górny" <mgorny@g.o>
Subject: Re: [gentoo-dev] [PATCH 29/30] dev-libs/libwacom: Use python_has_version for verbose output
Date: Tue, 08 Feb 2022 23:01:14
Message-Id: CAEdQ38GhTSR=80Tfb1Zm1OX5YqHtFDhyLpr87as+MN8UwO8G6w@mail.gmail.com
In Reply to: [gentoo-dev] [PATCH 29/30] dev-libs/libwacom: Use python_has_version for verbose output by "Michał Górny"
1 On Sun, Feb 6, 2022 at 4:57 AM Michał Górny <mgorny@g.o> wrote:
2 >
3 > Signed-off-by: Michał Górny <mgorny@g.o>
4 > ---
5 > dev-libs/libwacom/libwacom-1.11.ebuild | 6 +++---
6 > dev-libs/libwacom/libwacom-1.12.ebuild | 6 +++---
7 > 2 files changed, 6 insertions(+), 6 deletions(-)
8 >
9 > diff --git a/dev-libs/libwacom/libwacom-1.11.ebuild b/dev-libs/libwacom/libwacom-1.11.ebuild
10 > index acfda32d8405..3e406d573b91 100644
11 > --- a/dev-libs/libwacom/libwacom-1.11.ebuild
12 > +++ b/dev-libs/libwacom/libwacom-1.11.ebuild
13 > @@ -35,9 +35,9 @@ BDEPEND="
14 > "
15 >
16 > python_check_deps() {
17 > - has_version -b "dev-python/python-libevdev[${PYTHON_USEDEP}]" &&
18 > - has_version -b "dev-python/pyudev[${PYTHON_USEDEP}]" &&
19 > - has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
20 > + python_has_version -b "dev-python/python-libevdev[${PYTHON_USEDEP}]" &&
21 > + python_has_version -b "dev-python/pyudev[${PYTHON_USEDEP}]" &&
22 > + python_has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
23 > }
24 >
25 > pkg_setup() {
26 > diff --git a/dev-libs/libwacom/libwacom-1.12.ebuild b/dev-libs/libwacom/libwacom-1.12.ebuild
27 > index acfda32d8405..3e406d573b91 100644
28 > --- a/dev-libs/libwacom/libwacom-1.12.ebuild
29 > +++ b/dev-libs/libwacom/libwacom-1.12.ebuild
30 > @@ -35,9 +35,9 @@ BDEPEND="
31 > "
32 >
33 > python_check_deps() {
34 > - has_version -b "dev-python/python-libevdev[${PYTHON_USEDEP}]" &&
35 > - has_version -b "dev-python/pyudev[${PYTHON_USEDEP}]" &&
36 > - has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
37 > + python_has_version -b "dev-python/python-libevdev[${PYTHON_USEDEP}]" &&
38 > + python_has_version -b "dev-python/pyudev[${PYTHON_USEDEP}]" &&
39 > + python_has_version -b "dev-python/pytest[${PYTHON_USEDEP}]"
40 > }
41 >
42
43 I like this, but just a question -- is this patch just an example of
44 how we can transition other ebuilds, or are you planning a
45 larger-scale replacement?
46
47 Also, I've always felt a little uncomfortable with the
48 python_check_deps() functions because of how easy it is to mess them
49 up. E.g., app-emulation/spice/spice-0.15.0.ebuild contains:
50
51 python_check_deps() {
52 has_version -b ">=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]"
53 has_version -b "dev-python/six[${PYTHON_USEDEP}]"
54 }
55
56 It should have a &&, right? There are many more instances of this in ::gentoo.
57
58 I wonder if this wouldn't be a good opportunity to change the API a
59 little. Could we make python_has_version take multiple arguments and
60 return true iff all are satisfied? Maybe like this?
61
62 python_check_deps() {
63 has_version \
64 -b ">=dev-python/pyparsing-1.5.6-r2[${PYTHON_USEDEP}]" \
65 -b "dev-python/six[${PYTHON_USEDEP}]"
66 }
67
68 What do you think?

Replies