<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>14990</bug_id>
          
          <creation_ts>2022-12-15 23:07:07 +0000</creation_ts>
          <short_desc>layerindex update_layer.py still uses deprecated distutils; collections</short_desc>
          <delta_ts>2022-12-16 17:01:06 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>Layer Index</product>
          <component>Layer Index</component>
          <version>4.2</version>
          <rep_platform>All</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.2 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Orling">tim.orling</reporter>
          <assigned_to name="Tim Orling">tim.orling</assigned_to>
          <cc>randy.macleod</cc>
          
          <qa_contact name="apoorv sangal">apoorvsangal</qa_contact>
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>94536</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-12-15 23:07:07 +0000</bug_when>
    <thetext>Our aging code base is still using distutils

e.g. https://layers.openembedded.org/layerindex/updates/35783/

/opt/layerindex/layerindex/update_layer.py:22: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  from distutils.version import LooseVersion
ERROR: 
ERROR: Traceback (most recent call last):
  File &quot;/opt/layerindex/layerindex/update_layer.py&quot;, line 384, in main
    (tinfoil, tempdir) = recipeparse.init_parser(settings, branch, bitbakepath, nocheckout=options.nocheckout, logger=logger)
  File &quot;/opt/layerindex/layerindex/recipeparse.py&quot;, line 91, in init_parser
    tinfoil = utils.setup_tinfoil(bitbakepath, enable_tracking, loglevel=logger.getEffectiveLevel())
  File &quot;/opt/layerindex/layerindex/utils.py&quot;, line 200, in setup_tinfoil
    import bb.tinfoil
  File &quot;/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/__init__.py&quot;, line 119, in &lt;module&gt;
    from bb import fetch2 as fetch
  File &quot;/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/fetch2/__init__.py&quot;, line 26, in &lt;module&gt;
    import bb.persist_data, bb.utils
  File &quot;/opt/workdir/git___git_openembedded_org_bitbake/lib/bb/persist_data.py&quot;, line 22, in &lt;module&gt;
    from collections import Mapping
ImportError: cannot import name &apos;Mapping&apos; from &apos;collections&apos; (/usr/lib/python3.10/collections/__init__.py)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94537</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-12-15 23:12:31 +0000</bug_when>
    <thetext>LooseVersion is one of the items that does not have a setuptools replacement, but we have bb.utils.vercmp_string_op if it can be used.

e.g. https://git.yoctoproject.org/poky/commit/?id=f0627490711f29f0e308a0afc4fc4f8e54f58dec</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94538</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-12-15 23:18:50 +0000</bug_when>
    <thetext>The actual breaking code (because of update to ubuntu:jammy and Python 3.10.y) is
ImportError: cannot import name &apos;Mapping&apos; from &apos;collections&apos; (/usr/lib/python3.10/collections/__init__.py)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94539</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-12-15 23:20:18 +0000</bug_when>
    <thetext>Above was for gatesgarth... probably need someone to just turn off those older branch updates.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94544</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2022-12-16 17:01:06 +0000</bug_when>
    <thetext>Fixed in:
https://lore.kernel.org/yocto/125fe439624b307582389aad8c8a6b920bb6b2c8.1671208436.git.tim.orling@konsulko.com/T/#u

Commit:
https://git.yoctoproject.org/layerindex-web/commit/?id=0cc6d8eb1f511d7008f71498e0c6e1d85d1256fe</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>