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.
> 

Hmm, I gave it some more thought and I have an idea.

We could introduce new ${DISTUTILS_RDEPEND} and ${DISTUTILS_DEPEND}
variables, and deprecate (as a general rule) direct ${PYTHON_DEPS} usage
in favor of it.  Then we could easily inject setuptools into it.

Bad news is that it will make it incorrect to do BDEPEND=${RDEPEND}
in general, even when DISTUTILS_RDEPEND==DISTUTILS_DEPEND.

-- 
Best regards,
Michał Górny

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to