+
    kGjF                    2   R t ^ RIHt ^ RIt^ RIHtHt ^ RIHt ^ RI	H
t
 ^ RIHtHt ^ RIHt ^ RIHt ^ R	IHt ^ R
IHt ^ RIHt ^ RIHt ]'       d   ^ RIHt ^ RIHt R R ltR R ltR R lt R R lt!R R lt"R R lt#R R lt$R R lt%R R  lt&R# )!z4Health check: Report packages not installed by conda)annotationsN)PathPurePosixPath)TYPE_CHECKING)
SubdirData)OK_MARKX_MARK)context)reinstall_packages)NULL)
PrefixData)PrefixRecord)pypi_to_conda_name)	Namespace)ConfirmCallbackc                    V ^8  d   QhRRRR/# )   prefixstrreturnlist[PrefixRecord] )formats   "Jlib/python3.14/site-packages/conda_pypi/health_checks/external_packages.py__annotate__r      s      3 +=     c                @    \        V RR7      pVP                  4       pV# )z3Identify packages that were not installed by conda.Tinteroperability)r   get_python_packages)r   prefix_dataexternal_packagess   &  r   find_external_packagesr"      s#    Vd;K#779r   c               $    V ^8  d   QhRRRRRR/# )r   r   r   verboseboolr   Noner   )r   s   "r   r   r   "   s!     	 	C 	$ 	4 	r   c                    \        V 4      pV'       g   \        \         R24       R# \        \         R24       V F#  p\        VP                  VP
                  4       K%  	  \        R4       R# )z&Print packages not installed by conda.z No external packages found.
z, These packages are not installed by conda:
 N)r"   printr   r   nameversion)r   r$   r!   packages   &&  r   print_external_packagesr-   "   sS    .v6	789EFG(G',,0 )b	r   c                    V ^8  d   QhRRRR/# )r   r*   r   r   r%   r   )r   s   "r   r   r   .   s      C D r   c                D    \         P                  ! V 4      p\        V4      # )z@Check if a package with the given name exists in conda channels.)r   	query_allr%   )r*   results   & r   conda_has_packager2   .   s    !!$'F<r   c                    V ^8  d   QhRRRR/# )r   packagesr   r   z$tuple[list[str], list[PrefixRecord]]r   )r   s   "r   r   r   4   s     1 1 1)1r   c                   . p. pV  Fz  p\        VP                  4      p\        V4      '       g   K+  VP                  V4       VP                  V8w  d   \	        RVP                   RV R24       VP                  V4       K|  	  W3# )z9Determine which packages can be safely migrated to conda.zNote: 'z' will be reinstalled as 'z' from conda channels.
)r   r*   r2   appendr)   )r4   safe_pkgs_conda_namessafe_pkgs_pypipkg
conda_names   &    r   build_migration_planr;   4   s     N'1
 Z((!((4xx:%chhZ'A*Mef !!#&  !00r   c                    V ^8  d   QhRRRR/# )r   prefix_recordr   r   ztuple[PurePosixPath, ...]r   )r   s   "r   r   r   J   s     Y Yl Y?X Yr   c                    \         ;QJ d    . R V P                   4       F  NK  	  5# ! R V P                   4       4      # )zDReturn package file paths normalized to conda's manifest path style.c              3  X   "   T F   p\        VP                  R R4      4      x  K"  	  R# 5i)\/N)r   replace).0paths   & r   	<genexpr>-normalize_conda_file_paths.<locals>.<genexpr>L   s%     XDWDt||D#677DWs   (*)tuplefiles)r=   s   &r   normalize_conda_file_pathsrI   J   s0    5XMDWDWX5X5XMDWDWXXXr   c                    V ^8  d   QhRRRR/# )r   r=   r   r   set[PurePosixPath]r   )r   s   "r   r   r   O   s     	 	L 	EW 	r   c                    \        4       p\        V 4       FN  pV.VP                  O F8  pVP                  P	                  R4      '       g   K&  VP                  V4        KL  	  KP  	  V# )z@Identify dist-info and egg-info directories from a PrefixRecord.)z
.dist-infoz	.egg-info)setrI   parentsr*   endswithadd)r=   directories	file_pathrD   s   &   r    find_python_metadata_directoriesrS   O   s]    %K/>	3!2!23Dyy!!"=>>% 4 ?
 r   c                    V ^8  d   QhRRRR/# )r   r   r   r   rK   r   )r   s   "r   r   r   [   s      # *< r   c                    \        V RR7      P                  4       pVP                  4        UUu0 uF  p\        V4       F  pVkK  	  K  	  upp# u uppi )zEGet the set of file paths owned by conda packages in the environment.Fr   )r   reloaditer_recordsrI   )r   r    recordrR   s   &   r   get_conda_owned_pathsrY   [   s[     Ve<CCEK "..00F3F;I 	; 	0  s   Ac               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   r=   r   conda_owned_pathsrK   r   r&   r   )r   s   "r   r   r   f   s,          , AS 	 r   c                  a \        R4       \        V 4      p\        \        V4      4       F  o\        ;QJ d    V3R lV 4       F  '       g   K   RM	  RM! V3R lV 4       4      pV'       d   KG  VP
                  ! SP                  !  pVP                  4       '       g   Ky  \        RV 24       \        P                  ! V4       K  	  R# )z@Remove dist-info directories left behind by pip after migration.z)Cleaning up stale metadata directories...c              3  \   <"   T F!  pVS8H  ;'       g    SVP                   9   x  K#  	  R # 5i)N)rN   )rC   
owned_pathmetadata_dirs   & r   rE   'clean_up_stale_files.<locals>.<genexpr>o   s3      
/
 ,&LL,*:L:L*LL/s   ,,TFzRemoving stale metadata: N)
r)   r   sortedrS   anyjoinpathpartsis_dirshutilrmtree)r   r=   r[   prefix_pathis_conda_ownedrD   r_   s   &&&   @r   clean_up_stale_filesrj   f   s    
 

56v,K?NO 
/
 
/
 

 ##\%7%78;;==-dV45MM$ Pr   c               (    V ^8  d   QhRRRRRRRR/# )	r   r   r   argsr   confirmr   r   intr   )r   s   "r   r   r   }   s)     * *S *	 *O *PS *r   c                   V \         P                  8X  d   \        R4       ^ # \        V 4      pV'       g   \        R4       ^ # \	        V4      w  rEV'       g   \        R4       ^ # \        4        V! R4       RVn        . Vn        R
Vn        \        Vn	         \        VVRR7       \        T 4      pT F  p\        YT4       K  	  ^ #   \         d   p\        RT 24        R	p?^# R	p?ii ; i)z(Migrate pip-installed packages to conda.z0Cannot migrate packages in the base environment.zNo external packages found.zNo safe packages to migrate.z$Reinstall these packages with conda?FT)force_reinstallz)Failed to reinstall packages with conda: N)zrepodata.json)r	   root_prefixr)   r"   r;   	use_localfilerepodata_fnsr   update_modifierr
   	ExceptionrY   rj   )	r   rl   rm   r!   r7   safe_pkgs_pypi_nameser[   r9   s	   &&&      r   migrate_to_condary   }   s     $$$@A.v6+,2FGX2Y/ ,-	G23DNDI*DD! 	
 .f5#V*;< $   9!=>s   C C,C''C,)'__doc__
__future__r   rf   pathlibr   r   typingr   	conda.apir   conda.base.constantsr   r   conda.base.contextr	   conda.cli.installr
   conda.common.constantsr   conda.core.prefix_datar   conda.models.recordsr   conda_pypi.name_mappingr   argparser   conda.plugins.typesr   r"   r-   r2   r;   rI   rS   rY   rj   ry   r   r   r   <module>r      se    ; "  '     0 & 0 ' - - 6"3	1,Y
	 .*r   