[OE-core] [PATCH 1/3] distutils3.bbclass: add egg files/directories to python path

Jose Lamego jose.a.lamego at linux.intel.com
Mon Mar 13 20:30:54 UTC 2017


Ping

On 02/08/2017 04:30 PM, Jose Lamego wrote:
> 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 at 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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.openembedded.org/pipermail/openembedded-core/attachments/20170313/50764b6b/attachment-0002.sig>


More information about the Openembedded-core mailing list