[OE-core] [PATCH v2] python*-setuptools: add separate packages for pkg_resources module

richard.purdie at linuxfoundation.org richard.purdie at linuxfoundation.org
Tue May 21 11:11:05 UTC 2019


On Tue, 2019-05-21 at 11:59 +0100, luca.boccassi at gmail.com wrote:
> From: Luca Boccassi <luca.boccassi at microsoft.com>
> 
> The pkg_resources Python module is useful by itself, for example for
> automatic loading of resources shipped in a Python package.
> Add separate packages for it, so that users can depend on them
> individually and avoid pulling in the entire setuptools, which
> include scripts to download other packages, which might not be
> desired on minimal images.
> 
> Other distributions like Debian and Ubuntu already split setuptools
> and pkg-resources in this way.
> 
> The setuptools packages now depend on the new pkg-resources packages,
> to avoid regressions for other packages that depend on them
> already.
> 
> Signed-off-by: Luca Boccassi <luca.boccassi at microsoft.com>
> ---
> v2: restrict new RDEPENDS to class-target. As advised by Alexander,
> bitbake
>     cannot resolve native rdeps that mention package names rather
> than
>     recipe names.
> 
>  meta/recipes-devtools/python/python-setuptools.inc | 6 ++++++
>  1 file changed, 6 insertions(+)
> 
> diff --git a/meta/recipes-devtools/python/python-setuptools.inc
> b/meta/recipes-devtools/python/python-setuptools.inc
> index 357aa07086..c5dcee7059 100644
> --- a/meta/recipes-devtools/python/python-setuptools.inc
> +++ b/meta/recipes-devtools/python/python-setuptools.inc
> @@ -37,3 +37,9 @@ do_install_prepend() {
>  }
>  
>  BBCLASSEXTEND = "native nativesdk"
> +
> +PACKAGES =+ "${PYTHON_PN}-pkg-resources "
> +FILES_${PYTHON_PN}-pkg-resources =
> "${PYTHON_SITEPACKAGES_DIR}/pkg_resources/*"
> +# Due to a bitbake bug, the native class cannot have a dependency on
> something
> +# that is not a recipe name.
> +RDEPENDS_${PN}_append_class-target = " ${PYTHON_PN}-pkg-resources"

Its not a bitbake bug as such but the way OE-Core decided to implement
native recipes.

I'm guessing but the best thing to do here is probably add:

RPROVIDES_append_class-native = " ${PYTHON_PN}-pkg-resources-native"

which is slightly cleaner than the target change above (I'm left
wondering if nativesdk works in that case).

Cheers,

Richard




More information about the Openembedded-core mailing list