<?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>15348</bug_id>
          
          <creation_ts>2024-01-17 01:31:19 +0000</creation_ts>
          <short_desc>layerindex: update_layer.py remove use of deprecated pkg_resources</short_desc>
          <delta_ts>2024-02-01 02:35:41 +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>5.0</version>
          <rep_platform>x86</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>5.0 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tim Orling">tim.orling</reporter>
          <assigned_to name="Tim Orling">tim.orling</assigned_to>
          
          
          <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>97805</commentid>
    <comment_count>0</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-01-17 01:31:19 +0000</bug_when>
    <thetext>/opt/layerindex/layerindex/update_layer.py:22: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
 
  from pkg_resources import parse_version</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97884</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-01-18 01:54:46 +0000</bug_when>
    <thetext>https://patchwork.yoctoproject.org/project/yocto/patch/20240118014528.564270-1-tim.orling@konsulko.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97941</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-01-22 20:19:28 +0000</bug_when>
    <thetext>packaging.version.parse() seemed like a good replacement, but it cannot handle versions like autotools (2.72d) since it does not match the PEP-440 patterns for allowed Python package versions.

https://github.com/pypa/packaging/issues/631

https://packaging.python.org/en/latest/specifications/version-specifiers/#summary-of-differences-from-pkg-resources-parse-version

&quot;This specification purposely restricts the syntax which constitutes a valid version while pkg_resources.parse_version attempts to provide some meaning from any arbitrary string.&quot;

Which means that any Python which has &quot;packaging&quot; &gt;= 22 will no longer parse LegacyVersion() and it throws an InvalidVersion exception with &quot;packaging&quot; == 21

Invalid version: &apos;2.72e&apos;

Probably better off using the vercmp code from lib/bb/utils.py.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>97948</commentid>
    <comment_count>3</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-01-23 01:08:32 +0000</bug_when>
    <thetext>pypi.org has a similar problem of needing the LegacyVersion behavior, so we use their packaging_legacy instead in v2:

https://patchwork.yoctoproject.org/project/yocto/patch/20240123001125.1470142-1-tim.orling@konsulko.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98078</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-02-01 02:35:41 +0000</bug_when>
    <thetext>Merged:
https://git.yoctoproject.org/layerindex-web/commit/?id=83378f2f9c881505027220a98514bcb933d82682

and deployed.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>