Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: Patrick McLean <chutzpah@g.o>
Subject: Re: [gentoo-dev] [PATCH] python-utils-r1.eclass: Add PYTHON_RELAXED_VERSIONS variable
Date: Thu, 30 Apr 2020 05:51:41
Message-Id: 9dcd5196545ebca31aed047e2fcc802ae1775769.camel@gentoo.org
In Reply to: [gentoo-dev] [PATCH] python-utils-r1.eclass: Add PYTHON_RELAXED_VERSIONS variable by Patrick McLean
1 On Wed, 2020-04-29 at 22:22 -0700, Patrick McLean wrote:
2 > This adds PYTHON_RELAXED_VERSIONS that ebuilds can set before inheriting the
3 > python eclasses that will make the implementation dependencies be simple slot
4 > dependencies rather than >= dependencies. The purpose of this is for packages in
5 > @system to use to avoid circular dependencies like in bug #720048
6 >
7 > Bug: https://bugs.gentoo.org/720048
8 > Signed-off-by: Patrick McLean <chutzpah@g.o>
9 > ---
10 > eclass/python-utils-r1.eclass | 56 ++++++++++++++++++++++++++---------
11 > 1 file changed, 42 insertions(+), 14 deletions(-)
12 >
13 > diff --git a/eclass/python-utils-r1.eclass b/eclass/python-utils-r1.eclass
14 > index e85aefda792..e5781605c8e 100644
15 > --- a/eclass/python-utils-r1.eclass
16 > +++ b/eclass/python-utils-r1.eclass
17 > @@ -57,6 +57,17 @@ readonly _PYTHON_ALL_IMPLS
18 > # which can involve revisions of this eclass that support a different
19 > # set of Python implementations.
20 >
21 > +# @ECLASS-VARIABLE: PYTHON_RELAXED_VERSIONS
22 > +# @INTERNAL
23 > +# @DESCRIPTION:
24 > +# Set to a non-empty value in order to make eclass dependencies on
25 > +# Python versions be simple slot dependencies rather than setting
26 > +# a minimum version.
27 > +#
28 > +# This is intended to be set in ebuilds that are part of @system, or
29 > +# are dependencies of Python implementations themselves to avoid
30 > +# circular dependencies with the Python interpreter.
31
32 Why more hack-variables? I'll just revert the changes.
33
34 > +
35 > # @FUNCTION: _python_impl_supported
36 > # @USAGE: <impl>
37 > # @INTERNAL
38 > @@ -376,20 +387,37 @@ _python_export() {
39 > ;;
40 > PYTHON_PKG_DEP)
41 > local d
42 > - case ${impl} in
43 > - python2.7)
44 > - PYTHON_PKG_DEP='>=dev-lang/python-2.7.17-r1:2.7';;
45 > - python3.6)
46 > - PYTHON_PKG_DEP=">=dev-lang/python-3.6.10:3.6";;
47 > - python3.7)
48 > - PYTHON_PKG_DEP=">=dev-lang/python-3.7.7-r1:3.7";;
49 > - python3.8)
50 > - PYTHON_PKG_DEP=">=dev-lang/python-3.8.2:3.8";;
51 > - pypy3)
52 > - PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.0:0=';;
53 > - *)
54 > - die "Invalid implementation: ${impl}"
55 > - esac
56 > + if [[ -z ${PYTHON_RELAXED_VERSIONS} ]]; then
57 > + case ${impl} in
58 > + python2.7)
59 > + PYTHON_PKG_DEP='>=dev-lang/python-2.7.17-r1:2.7';;
60 > + python3.6)
61 > + PYTHON_PKG_DEP=">=dev-lang/python-3.6.10:3.6";;
62 > + python3.7)
63 > + PYTHON_PKG_DEP=">=dev-lang/python-3.7.7-r1:3.7";;
64 > + python3.8)
65 > + PYTHON_PKG_DEP=">=dev-lang/python-3.8.2:3.8";;
66 > + pypy3)
67 > + PYTHON_PKG_DEP='>=dev-python/pypy3-7.3.0:0=';;
68 > + *)
69 > + die "Invalid implementation: ${impl}"
70 > + esac
71 > + else
72 > + case ${impl} in
73 > + python2.7)
74 > + PYTHON_PKG_DEP='dev-lang/python:2.7';;
75 > + python3.6)
76 > + PYTHON_PKG_DEP="dev-lang/python:3.6";;
77 > + python3.7)
78 > + PYTHON_PKG_DEP="dev-lang/python:3.7";;
79 > + python3.8)
80 > + PYTHON_PKG_DEP="dev-lang/python:3.8";;
81 > + pypy3)
82 > + PYTHON_PKG_DEP='dev-python/pypy3:0=';;
83 > + *)
84 > + die "Invalid implementation: ${impl}"
85 > + esac
86 > + fi
87 >
88 > # use-dep
89 > if [[ ${PYTHON_REQ_USE} ]]; then
90
91 --
92 Best regards,
93 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature