On Tue, 2019-11-26 at 21:30 +0800, Jason Zaman wrote: > On Mon, Nov 25, 2019 at 06:38:47PM +0100, Michał Górny wrote: > > Hi, > > > > TL;DR: should we depend on setuptools by default? Alternatively, should > > we add distutils_enable_setuptools API to provide at least partial > > validity checks. > > > > > > Variant 1: automatic dependency on setuptools > > ============================================= > > Basically, we add a new trinary pre-inherit variable: > > > > DISTUTILS_USE_SETUPTOOLS=no > > -> no deps > > DISTUTILS_USE_SETUPTOOLS=bdepend > > -> add to BDEPEND (the default) > > DISTUTILS_USE_SETUPTOOLS=rdepend > > -> add to BDEPEND+RDEPEND > > > > This is roughly 'erring on the safe side'. The default will work for > > the majority of packages. We will have to disable it for setuptools > > bootstrap deps, and devs will be able to adjust it to correct values > > as they update ebuilds. For the time being, existing *DEPEND > > on setuptools will avoid breaking stuff. > > > > This will also enable me to add extra QA checks to esetup.py. It should > > be able to reasonably detect incorrect value and report it. This will > > imply some 'false positives' for packages that use the old method of > > specifying setuptools in RDEPEND but that's a minor hassle. > > > > Pros: > > - works out of the box for the majority of packages > > - enables full-range QA checking > > > > Cons: > > - pre-inherit variable > > - some (harmless) false positives on existing packages > > > > I like variant 1 most since in almost all cases it'll be less work in > the ebuilds. What about distutils_optional tho? In tensorflow I have all > the python support behind USE="python" and guard all the deps. In the > optional case is there any way for this to work other than just setting > it to no and doing it manually? > I assume if i set it to no and make it optional then the esetup.py > checks wouldnt happen which isnt as nice. That's a very good question, and I'm afraid I don't have a good answer. To be honest, I don't see how we could solve this. Since you need to add the appropriate variables to BDEPEND and RDEPEND yourself, there's little purpose in trying to introduce some kind of indirection for this -- it may detect that you've declared the wrong kind of dep but it won't detect if you used the helper variables correctly, so we're back to square one. I guess the only reasonable thing to do is to ignore it entirely for this use case, and rely on the developer doing things right. Hopefully, FWICS it's just 43 packages at the moment, so this wouldn't be that bad. -- Best regards, Michał Górny