1 |
On Tue, 2019-11-26 at 21:30 +0800, Jason Zaman wrote: |
2 |
> On Mon, Nov 25, 2019 at 06:38:47PM +0100, Michał Górny wrote: |
3 |
> > Hi, |
4 |
> > |
5 |
> > TL;DR: should we depend on setuptools by default? Alternatively, should |
6 |
> > we add distutils_enable_setuptools API to provide at least partial |
7 |
> > validity checks. |
8 |
> > |
9 |
> > |
10 |
> > Variant 1: automatic dependency on setuptools |
11 |
> > ============================================= |
12 |
> > Basically, we add a new trinary pre-inherit variable: |
13 |
> > |
14 |
> > DISTUTILS_USE_SETUPTOOLS=no |
15 |
> > -> no deps |
16 |
> > DISTUTILS_USE_SETUPTOOLS=bdepend |
17 |
> > -> add to BDEPEND (the default) |
18 |
> > DISTUTILS_USE_SETUPTOOLS=rdepend |
19 |
> > -> add to BDEPEND+RDEPEND |
20 |
> > |
21 |
> > This is roughly 'erring on the safe side'. The default will work for |
22 |
> > the majority of packages. We will have to disable it for setuptools |
23 |
> > bootstrap deps, and devs will be able to adjust it to correct values |
24 |
> > as they update ebuilds. For the time being, existing *DEPEND |
25 |
> > on setuptools will avoid breaking stuff. |
26 |
> > |
27 |
> > This will also enable me to add extra QA checks to esetup.py. It should |
28 |
> > be able to reasonably detect incorrect value and report it. This will |
29 |
> > imply some 'false positives' for packages that use the old method of |
30 |
> > specifying setuptools in RDEPEND but that's a minor hassle. |
31 |
> > |
32 |
> > Pros: |
33 |
> > - works out of the box for the majority of packages |
34 |
> > - enables full-range QA checking |
35 |
> > |
36 |
> > Cons: |
37 |
> > - pre-inherit variable |
38 |
> > - some (harmless) false positives on existing packages |
39 |
> > |
40 |
> |
41 |
> I like variant 1 most since in almost all cases it'll be less work in |
42 |
> the ebuilds. What about distutils_optional tho? In tensorflow I have all |
43 |
> the python support behind USE="python" and guard all the deps. In the |
44 |
> optional case is there any way for this to work other than just setting |
45 |
> it to no and doing it manually? |
46 |
> I assume if i set it to no and make it optional then the esetup.py |
47 |
> checks wouldnt happen which isnt as nice. |
48 |
> |
49 |
|
50 |
Hmm, I gave it some more thought and I have an idea. |
51 |
|
52 |
We could introduce new ${DISTUTILS_RDEPEND} and ${DISTUTILS_DEPEND} |
53 |
variables, and deprecate (as a general rule) direct ${PYTHON_DEPS} usage |
54 |
in favor of it. Then we could easily inject setuptools into it. |
55 |
|
56 |
Bad news is that it will make it incorrect to do BDEPEND=${RDEPEND} |
57 |
in general, even when DISTUTILS_RDEPEND==DISTUTILS_DEPEND. |
58 |
|
59 |
-- |
60 |
Best regards, |
61 |
Michał Górny |