Gentoo Archives: gentoo-dev

From: Jason Zaman <perfinion@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] [RFC] dev-python/setuptools deps in distutils-r1 packages
Date: Tue, 26 Nov 2019 13:30:43
Message-Id: 20191126133014.GA47055@baraddur.perfinion.com
In Reply to: [gentoo-dev] [RFC] dev-python/setuptools deps in distutils-r1 packages by "Michał Górny"
1 On Mon, Nov 25, 2019 at 06:38:47PM +0100, Michał Górny wrote:
2 > Hi,
3 >
4 > TL;DR: should we depend on setuptools by default? Alternatively, should
5 > we add distutils_enable_setuptools API to provide at least partial
6 > validity checks.
7 >
8 >
9 > Variant 1: automatic dependency on setuptools
10 > =============================================
11 > Basically, we add a new trinary pre-inherit variable:
12 >
13 > DISTUTILS_USE_SETUPTOOLS=no
14 > -> no deps
15 > DISTUTILS_USE_SETUPTOOLS=bdepend
16 > -> add to BDEPEND (the default)
17 > DISTUTILS_USE_SETUPTOOLS=rdepend
18 > -> add to BDEPEND+RDEPEND
19 >
20 > This is roughly 'erring on the safe side'. The default will work for
21 > the majority of packages. We will have to disable it for setuptools
22 > bootstrap deps, and devs will be able to adjust it to correct values
23 > as they update ebuilds. For the time being, existing *DEPEND
24 > on setuptools will avoid breaking stuff.
25 >
26 > This will also enable me to add extra QA checks to esetup.py. It should
27 > be able to reasonably detect incorrect value and report it. This will
28 > imply some 'false positives' for packages that use the old method of
29 > specifying setuptools in RDEPEND but that's a minor hassle.
30 >
31 > Pros:
32 > - works out of the box for the majority of packages
33 > - enables full-range QA checking
34 >
35 > Cons:
36 > - pre-inherit variable
37 > - some (harmless) false positives on existing packages
38 >
39
40 I like variant 1 most since in almost all cases it'll be less work in
41 the ebuilds. What about distutils_optional tho? In tensorflow I have all
42 the python support behind USE="python" and guard all the deps. In the
43 optional case is there any way for this to work other than just setting
44 it to no and doing it manually?
45 I assume if i set it to no and make it optional then the esetup.py
46 checks wouldnt happen which isnt as nice.
47
48 -- Jason

Replies