All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jose Lamego <jose.a.lamego@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: Re: [PATCH 1/3] distutils3.bbclass: add egg files/directories to python path
Date: Wed, 8 Feb 2017 16:30:44 -0600	[thread overview]
Message-ID: <267c07ef-e6d0-7bf4-bcd1-b79ffa11844f@linux.intel.com> (raw)
In-Reply-To: <a3fe53ae33e80c917e2897d49a91c191bb230616.1484667160.git.jose.a.lamego@linux.intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 1729 bytes --]

Ping.

On 01/17/2017 09:42 AM, Jose Lamego wrote:
> Packages that use .egg files or directories for installation may
> not be found when imported at the python3 interpreter.
> .egg files/directories path must be included in a .pth file to
> be appropriately included in python path.
> 
> This change looks for .egg files/directories in sitepackages
> and adds its path to a .pth file during package installation.
> It ensures that any new package that uses .egg files/recipes
> will be appropriately added to path by performing the check from
> the distutils3 class.
> 
> [YOCTO #8673]
> 
> Signed-off-by: Jose Lamego <jose.a.lamego@linux.intel.com>
> ---
>  meta/classes/distutils3.bbclass | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/meta/classes/distutils3.bbclass b/meta/classes/distutils3.bbclass
> index a6720c5..f8e2e2e 100644
> --- a/meta/classes/distutils3.bbclass
> +++ b/meta/classes/distutils3.bbclass
> @@ -68,6 +68,16 @@ distutils3_do_install() {
>              mv -f ${D}${datadir}/share/* ${D}${datadir}/
>              rmdir ${D}${datadir}/share
>          fi
> +
> +        # detect if .egg files/directories were created and add their
> +        # path to a .pth file
> +        SHORT_PN=$(echo "${PN}" | sed 's/${PYTHON_PN}-//g')
> +        if test -e ${D}${PYTHON_SITEPACKAGES_DIR}/${SHORT_PN}*.egg; then
> +            EGG_NAME=$(basename $(find ${D}${PYTHON_SITEPACKAGES_DIR}/ \
> +-name ${SHORT_PN}\*.egg))
> +            echo "./${EGG_NAME}" > ${D}${PYTHON_SITEPACKAGES_DIR}/\
> +${SHORT_PN}.pth
> +        fi
>  }
>  distutils3_do_install[vardepsexclude] = "MACHINE"
>  
> 

-- 
Jose Lamego | OTC Embedded Platforms & Tools | GDC


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 501 bytes --]

  reply	other threads:[~2017-02-08 22:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-17 15:42 [PATCH 0/3] distutils3: add egg files to path Jose Lamego
2017-01-17 15:42 ` [PATCH 1/3] distutils3.bbclass: add egg files/directories to python path Jose Lamego
2017-02-08 22:30   ` Jose Lamego [this message]
2017-03-13 20:30     ` Jose Lamego
2017-01-17 15:42 ` [PATCH 2/3] python3-pip: Remove pth file creation at recipe level Jose Lamego
2017-02-08 22:31   ` Jose Lamego
2017-03-13 20:31     ` Jose Lamego
2017-01-17 15:42 ` [PATCH 3/3] python3-setuptools: " Jose Lamego
2017-02-08 22:31   ` Jose Lamego
2017-03-13 20:31     ` Jose Lamego
2017-01-17 17:09 ` [PATCH 0/3] distutils3: add egg files to path Burton, Ross

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=267c07ef-e6d0-7bf4-bcd1-b79ffa11844f@linux.intel.com \
    --to=jose.a.lamego@linux.intel.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.