<?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>15372</bug_id>
          
          <creation_ts>2024-01-29 14:30:28 +0000</creation_ts>
          <short_desc>Mark python packages as externally managed</short_desc>
          <delta_ts>2026-10-28 11:51:21 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>4.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>6.2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>tim.orling</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>98057</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-01-29 14:30:28 +0000</bug_when>
    <thetext>As per https://packaging.python.org/en/latest/specifications/externally-managed-environments/, we should mark /usr/lib/python3.X as &quot;externally managed&quot;, so that pip doesn&apos;t try and delete/upgrade/install into it directly.

1) tell python and pip to look in /usr/local/ so that there is still somewhere system-level to write to
2) Drop an EXTERNALLY-MANAGED file into /usr/lib/python3.X.

Regarding (1), https://github.com/pypa/distutils/pull/70 looks relevant.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98664</commentid>
    <comment_count>1</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-03-28 15:18:47 +0000</bug_when>
    <thetext>I believe this means that for crops containers we will need virtualenv installed (which is already required for debian-12 anyway). Otherwise, the user cannot run `pip install --user` at runtime?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98667</commentid>
    <comment_count>2</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-03-28 15:28:12 +0000</bug_when>
    <thetext>This would be possibly too invasive or affect other layers in some odd behaviour changes, so moving to 5.1 M1.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98668</commentid>
    <comment_count>3</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2024-03-28 16:01:06 +0000</bug_when>
    <thetext>pip install --user will still work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98673</commentid>
    <comment_count>4</comment_count>
    <who name="Tim Orling">tim.orling</who>
    <bug_when>2024-03-28 18:24:13 +0000</bug_when>
    <thetext>(In reply to Ross Burton from comment #3)
&gt; pip install --user will still work.

Yeah, I think I meant `pip install` will not work without `--user`. Munging multiple things from some work happening in crops for debian-12 and virtualenv.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>