[OE-core] "inherit setuptools" versus "inherit pypi" -- a python style question

Robert P. J. Day rpjday at crashcourse.ca
Fri Mar 3 11:04:44 UTC 2017


On Fri, 3 Mar 2017, Jack Mitchell wrote:

> On 03/03/17 10:06, Robert P. J. Day wrote:
> > On Fri, 3 Mar 2017, Anders Darander wrote:
> >
> >> * Robert P. J. Day <rpjday at crashcourse.ca> [170302 12:33]:
> >>
> >>> On Thu, 2 Mar 2017, Robert P. J. Day wrote:
> >>
> >>>>   inherit pypi setuptools
> >>>>   require python-psutil.inc
> >>
> >>>> and the corresponding .inc file contains:
> >>
> >>>>   RDEPENDS_${PN} += " \
> >>>>     ${PYTHON_PN}-shell \
> >>>>     ${PYTHON_PN}-subprocess \
> >>>>     ${PYTHON_PN}-threading \
> >>>>   "
> >>
> >>>> so the first recipe inherits pypi, the second one inherits setuptools,
> >>>> and the third inherits *both*. what is the *preferred* style?
> >>
> >> Well, different purposes... If you take a look at pypi.bbclass, it's all
> >> about how to retrieve the module (source code). setuptools.bbclass is
> >> about how to install the module...
> >>
> >> Ie retrieving and installing...
> >
> >   yes, i finally twigged to that, but is there a *preferred* style?
> > from what i've seen, if there is a pair of files for a python module:
> >
> >   * foo.bb (which includes ...)
> >   * foo.inc
> >
> > the common style seems to be that:
> >
> >   * foo.bb inherits setuptools, while
> >   * foo.inc inherits pypi (if necessary, of course)
> >
> > at least i think that was the common style. obviously, there are
> > perfectly acceptable variations, i'd just like to know if there is a
> > recommended style.
>
> One reason for this is for py2/py3 reciepes. python-foo.bb will
> inherit setuptools, while python3-foo has to inherit setuptools3. So
> I would imagine that setuptools should always go in the bb. While
> pypi is python version agnostic I believe.

  right, which suggests that even if one has a recipe for which there
is only one version (python2 or python3), it's still a good idea to
break it as above just in case, some day, you want to support both
versions. that's all i mean by "style." thanks.

rday

-- 

========================================================================
Robert P. J. Day                                 Ottawa, Ontario, CANADA
                        http://crashcourse.ca

Twitter:                                       http://twitter.com/rpjday
LinkedIn:                               http://ca.linkedin.com/in/rpjday
========================================================================




More information about the Openembedded-core mailing list