+
    kGjJ                       ^ RI Ht ^ RIt^ RIt^ RIt^ RIt^ RI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 ^ R	IHtHtHt ^ R
I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, ^ RI-H.t. ^ RI/H0t0 ^ RI1H2t2H3t3H4t4 ]! R]5 24      t6]! ]74      Pp                  Ps                  4       t:R R lt;R(R R llt<R R lt=R R lt>R)R  R! llt?R*R" R# llt@ ! R$ R%4      tAR+R& R' lltBR# ),    )annotationsN)reader)HeaderParser)	getLogger)Path)run)NamedTemporaryFile)AnyIterableLiteral)context)main_subshell)
PrefixData)
CondaErrorInvalidVersionSpec)compute_sum)PackageType)	MatchSpec)PackageRecord)PythonDistribution)Requirement)	parse_tag)Version)ensure_externally_managedget_env_site_packagesget_externally_managed_pathszconda.c                   V ^8  d   QhRR/# )   returnint )formats   "/lib/python3.14/site-packages/conda_pypi/main.py__annotate__r$   '   s      c     c                     \         P                  R RP                  V 4      4        \        V !   ^ #   \         d.   p\         P                  RRR7       TP
                  u Rp?# Rp?ii ; i)zconda command: '%s' zconda command system exit:Texc_infoN)loggerinfojoinr   
SystemExitcode)cli_args
env_kwargsexcs   *, r#   run_conda_clir2   '   sX    
KK%sxx'9:x 
 	  04@xxs   	2 A*"A%A*%A*c               D    V ^8  d   QhRRRRRRRRRR	R
RRRRRRRRRRR	/# )r   prefixr   specszIterable[MatchSpec]dry_runboolquiet	verbosityr    force_reinstallyesjsonchannelsIterable[str]override_channelsr   r!   )r"   s   "r#   r$   r$   2   sv     "# "#"#"# "# 	"#
 "# "# 
"# "# "# "# 	"#r%   c
                @   R R\        V 4      .p
V'       d   V
P                  R4       V'       d   V
P                  R4       V'       d    V
P                  RRV,          ,           4       V'       d   V
P                  R4       V'       d   V
P                  R4       V'       d   V
P                  R4       V'       d,   V F%  pV
P                  R	4       V
P                  V4       K'  	  V	'       d   V
P                  R
4       V
P                  R V 4       4       \        V
!  # )installz--prefix	--dry-runz--quiet-v--force-reinstallz--yesz--jsonz	--channelz--override-channelsc              3  8   "   T F  p\        V4      x  K  	  R # 5iN)str).0specs   & r#   	<genexpr>$run_conda_install.<locals>.<genexpr>R   s     /3t99s   )rH   appendextendr2   )r4   r5   r6   r8   r9   r:   r;   r<   r=   r?   commandchannels   &&&&&&&&&&  r#   run_conda_installrQ   2   s     *c&k2G{#y!scIo./*+
wx GNN;'NN7#   ,-NN///'""r%   c                   V ^8  d   QhRR/# r   rO   rH   r!   )r"   s   "r#   r$   r$   W   s     0? 0?c 0?r%   c                X   \         P                  P                  R4      R8X  d   R# \        \        P
                  4      p\        \        P                  4      pW8X  g$   VP                  4       VP                  4       8X  d   R#  \        V4      p\        VP                  R4      4      '       g   R#  \        T4      pT R9   d   \        TP                  R4      4      '       g   R# Rp\        TP                  R4      4      pT'       d8   \        T^ ,          P                  4      pTP                   RTP                   2pT R8w  dP   \         P                   R	8w  d;   \#        T4       F+  pTP%                  4       '       g   K  TP'                  4        K-  	  \)        Y%R
7       R# T R8X  d_   \        TP                  R4      4      '       d   R# \#        T4       F+  pTP%                  4       '       g   K  TP'                  4        K-  	  R# \+        RT  R24      h  \         d     R# i ; i)z
post-command hook to ensure that the target env has the EXTERNALLY-MANAGED file
even when it is created by conda, not 'conda-pypi'.
CONDA_BUILD_STATEBUILDNz
conda-pypicreatepippython.nt)python_versionremovezcommand z not recognized.>   rW   updaterA   )osenvirongetr   r   conda_prefixtarget_prefixresolver   listquery	Exceptionr   versionmajorminornamer   existsunlinkr   
ValueError)	rO   base_prefixrc   base_prefix_dataprefix_datar\   python_recordsrh   paths	   &        r#   (ensure_target_env_has_externally_managedrt   W   s   
 
zz~~)*g5w++,K../M#{':':'<@U@U@W'W%k2$**<899 :
 ]+K11K%%e,-- k//9:nQ/778G 'a?N h277d?4]C;;==KKM D 	"-O	H	!!%())0?D{{}} @ 8G9,<=>>?  s   +H H)(H)c                   V ^8  d   QhRR/# rS   r!   )r"   s   "r#   r$   r$      s     
 
c 
r%   c                   \         P                  P                  R4      R8X  d   R# \        \        P
                  4      p\        \        P                  4      pW8X  g$   VP                  4       VP                  4       8X  d   R# \        V4      p\        VP                  R4      4      '       g   R# \        P                  P                  '       d   \        P                  R4       R# R# )zM
Beta-period post-command hook that points pip users to the conda-pypi beta.
rU   rV   NrX   z
  Did you know? You can install many PyPI packages with conda
  using the conda-pypi beta. Get started:
    https://docs.conda.io/projects/conda/en/stable/new-features.html
)r_   r`   ra   r   r   rb   rc   rd   r   re   rf   pluginsconda_pypi_pip_warningr*   warning)rO   ro   rc   rq   s   &   r#    notify_externally_managed_futurerz      s    
 
zz~~)*g5w++,K../M#{':':'<@U@U@W'W]+K!!%())---U	
 .r%   c               $    V ^8  d   QhRRRRRR/# )r   r4   z
Path | str	checksums)Iterable[Literal['md5', 'sha256']] | Noner   	list[str]r!   )r"   s   "r#   r$   r$      s$      #Lr%   c                    \         P                  P                  4        \        \        V 4      RR7      pVP	                  4        . p\        VP                  R4      4      p\        V4      ^8X  g   Q hV^ ,          pVP                  4        Fn  pVP                  \        P                  8w  d   K$  \        P                  WTWR7      pVP                  '       d   KO  VP                  VP!                  4       4       Kp  	  V# )z
Write pip install pseudo commands for each non-conda-installed Python package in prefix.
See `PyPIDistribution.to_lockfile_line()` for more details.
T)interoperabilityrY   )r|   )r   _cache_clearrH   loadre   rf   leniter_recordspackage_typer   VIRTUAL_PYTHON_WHEELPyPIDistributionfrom_conda_recordeditablerM   to_lockfile_line)r4   r|   pdlinespython_recordrecord	pypi_dists   &&     r#    pypi_lines_for_explicit_lockfiler      s     	CK$	7BGGIE(+,M}"""!!$M//#+"B"BB$666 7 
	 Y//12 $ Lr%   c               8    V ^8  d   QhRRRRRRRRRRR	RR
RRR/# )r   argsr>   ignore_installedr7   r:   r\   rH   implementationabiplatformr   dict[str, Any]r!   )r"   s   "r#   r$   r$      sb     B$ B$
B$B$ B$ 	B$
 B$ 
B$ B$ B$r%   c           
        \        RRR7      pVP                  4         \        P                  RRRRVP                  RVP                  R	,           .pV'       d   VP                  R
4       V'       d   VP                  R4       V'       d   VRVR.,          pV'       d   VRV.,          pV F  p	VRV	.,          pK  	  V F  p	VRV	.,          pK  	  W,          p\        P                  RV4       \        VRRR7      p
V
P                  ^ 8w  dX   \        R\        P                  ! \        \        V4      4       RV
P                   RV
P                   RV
P                    24      h\        P#                  RV
P                   4       \        P#                  RV
P                  4       \%        VP                  R4      ;_uu_ 4       p\&        P(                  ! VP+                  4       4      uuRRR4       \,        P.                  ! VP                  4       #   + '       g   i     M; i \,        P.                  ! TP                  4       R#   \,        P.                  ! TP                  4       i ; i)a,  
Runs pip in dry-run mode with the goal of obtaining a JSON report that encodes
what would have been done. This is useful to invoke pip as a solver only, or
to obtain the URL of which wheel would have been installed for a particular set of constraints.

It returns the parsed JSON payload as a dict.
z.jsonF)suffixdeletez-mpiprA   rB   z--reportz--targetz.dirz--ignore-installedrE   --python-version	--no-deps--implementation--abi
--platformzpip dry-run command: %sT)capture_outputtextz"Failed to dry-run pip:
  command: z
  exit code: z
  stderr:
z
  stdout:
zpip dry-run stdout:
%szpip dry-run stderr:
%srbN)r	   closesys
executablerk   rM   r*   r+   r   
returncoder   shlexr,   maprH   stderrstdoutdebugopenr<   loadsreadr_   rm   )r   r   r:   r\   r   r   r   json_outputcmdtagprocessfs   &&&&&&&     r#   dry_run_pip_jsonr      s   * %GEBK*$NNv%	
 JJ+,JJ*+&DDC&77CCGS>!C CL#&&C -s3c$T:"#jjS#78 9  ' 2 23 4%nn- .%nn-	/  	.?.?+""D))Q ::affh'	 *) 			+""# *)) 			+""#		+""#s7   AI
 3I
 I
  D%I
 $H)
I
 H$	I
 
"I,c                      ] tR tRtRtRtRR R llt]RR R ll4       t]R R	 l4       t	R
 R lt
R R lt]R R l4       t]R R l4       t]R R l4       t]R R l4       tRtR# )r   i  z# pypi: Nc               8    V ^8  d   QhRRRRRRRRRRR	RR
RRR/# )r   rk   rH   rh   r\   z
str | Nonepython_implementationpython_abi_tagsr>   python_platform_tagsrecord_checksumszdict[str, str] | Noner   r7   r!   )r"   s   "r#   r$   PyPIDistribution.__annotate__  sZ        #	
  * ' , 0 r%   c	                	    Wn         W n        W0n        W@n        T;'       g    RV n        T;'       g    RV n        T;'       g    / V n        Wn        R V n        R # )Nr!   )	rk   rh   r\   r   r   r   r   r   url)	selfrk   rh   r\   r   r   r   r   r   s	   &&&&&&&&&r#   __init__PyPIDistribution.__init__  sV     	,%:".44"$8$>$>B! 0 6 6B r%   c          
     ,    V ^8  d   QhRRRRRRRRRR	/# )
r   r   r   r   r4   z
str | Pathr|   r}   r   r   r!   )r"   s   "r#   r$   r     s<     6
 6
6
 %6
 	6

 =6
 
6
r%   c                	   \        V4      pVP                  P                  R 4      '       d   WQP                  ,          R,          pM^VP                  P                  R4      '       d3   WQP                  ,          pVP                  4       '       d
   VR,          pM\	        R4      hRP                  VP                  P                  R4      R,          4      pRVP                  9   d   RpMR	VP                  9   d   R
pMRp\        P                  ! V\        V4      VP                  4      p	V'       d   V	P                  p
\        W4      pMRpV	P                  4       pV P                  V4      p\!        R V 4       R4      pV'       d0   V P#                  \%        W>4      4      pV P'                  V4      w  ppMRRppV ! VP(                  VP                  VVVVVVR7      # )
.dist-infoMETADATAz	.egg-infozPKG-INFOz,Unrecognized anchor file for Python metadatarZ   :N   NpypyppcpythoncpNc              3  Z   "   T F!  vrVP                  R 4      '       g   K  Vx  K#  	  R# 5i)z.dist-info/WHEELN)endswith)rI   rs   _s   &  r#   rK   5PyPIDistribution.from_conda_record.<locals>.<genexpr>C  s      [HDGY9Z44s   +
+)rk   rh   r\   r   r   r   r   r   r!   )r   fnr   is_dirrn   r,   rh   splitbuildr   initrH   manifest_full_pathcompute_record_sum	get_paths_is_record_editablenext_parse_wheel_filer   _tags_from_wheelrk   )clsr   r   r4   r|   sitepackagesanchorr\   python_implpython_distmanifestr   filesr   
wheel_filewheel_detailsabi_tagsplatform_tagss   &&&&&             r#   r   "PyPIDistribution.from_conda_record  s    -V499l++!II-
:FYY,,!II-F}}*,KLL -"7"7"="=c"B2"FG](((K----KK )--fc&k=CXCXY"55H1(F# %%'**51[[]ab
11$v2JKM&)&:&:=&I#Hm&("mHNN)"--$!.	
 		
r%   c                   V ^8  d   QhRR/# )r   linezstr | Iterable[str]r!   )r"   s   "r#   r$   r   V  s     
 
&9 
r%   c           	     	   \        V\        4      '       d^   VP                  V P                  4      '       d   V\	        V P                  4      R  p\
        P                  ! VP                  4       4      pV P                  f   V P                  4       V n        V P                  P                  V4      p\        VP                  4      p\        VP                  4      p\	        V4      ^8w  g   V^ ,          P                  R8w  d   \!        VP                   R24      hVP"                  pV^ ,          P$                  pV ! VVVP&                  VP(                  VP*                  VP,                  R7      # )N==zS is not a valid requirement. PyPI requirements must be exact; i.e. 'name==version'.)rk   rh   r\   r   r   r   )
isinstancerH   
startswith_line_prefixr   r   r   strip_arg_parser_build_arg_parser
parse_argsr   rJ   re   	specifieroperatorr   rk   rh   r\   r   r   r   )r   r   r   requirement
specifierspkg_namerh   s   &&     r#   from_lockfile_line#PyPIDistribution.from_lockfile_lineU  s*   dC  s//00C 0 0134;;tzz|,D??"!335CO))$/!$)),+//0
z?a:a=#9#9T#A$99+ I I  ##Q-''.."&"5"5 HH!%
 	
r%   c                   V ^8  d   QhRR/# r   r   r~   r!   )r"   s   "r#   r$   r   p  s     " ") "r%   c                   V P                   '       d   V P                   V P                    2# V P                   V P                   RV P                   RV P                   RV P
                   2pV P                   F  pVRV 2,          pK  	  V P                   F  pVRV 2,          pK  	  V P                  P                  4        F  w  rEVRV RV 2,          pK  	  V# )aK  
Builds a pseudo command-line input for a pip-like interface, with the goal of providing
enough information to retrieve a single wheel or sdist providing the package. The format is:

```
# pypi: <name>[==<version>] [--python-version str] [--implementation str] [--abi str ...]
        [--platform str ...] [--record-checksum <algorithm>=<value>]
```

All fields above should be part of the same line. The CLI mimics what `pip` currently
accepts, with the exception of `--record-checksum`, which is a custom addition.

The value of `--record-checksum` is given by `compute_record_sum()`.
r   z --python-version z --implementation z --abi z --platform z --record-checksum=:)
r   r   rk   rh   r\   r   r   r   r   items)r   r   r   r   algochecksums   &     r#   r   !PyPIDistribution.to_lockfile_linep  s     888''(
33   !$))Bt||n !4!4 5 !;!; <> 	
 ''CgcUO#D (11Hl8*--D 2"3399;ND)$q
;;D < r%   c                   V ^8  d   QhRR/# r   r!   )r"   s   "r#   r$   r     s     < <	 <r%   c                	    \        R V P                   RV P                   2.V P                  V P                  V P
                  V P                  R7      pVR,          ^ ,          R,          R,          # )r   r   )r\   r   r   r   rA   download_infor   )r   rk   rh   r\   r   r   r   )r   reports   & r#   find_wheel_urlPyPIDistribution.find_wheel_url  sg    !TYYKr$,,89..55$$..
 i #O4U;;r%   c                   V ^8  d   QhRR/# )r   r   zdict[str, list[str]]r!   )r"   s   "r#   r$   r     s     	 	#7 	r%   c                	T   \        V 4      p V P                  4       '       g   / # \        V 4      ;_uu_ 4       p\        4       P	                  V4      pR R R 4       / pXP                  4        F&  w  rEVP                  V. 4      P                  V4       K(  	  V#   + '       g   i     LN; irG   )r   is_filer   r   parser   
setdefaultrM   )rs   r   parseddatakeyvalues   &     r#   r   "PyPIDistribution._parse_wheel_file  sz    Dz||~~I$ZZ1!^))!,F  ,,.JCOOC$++E2 ) Zs   BB'	c                    V ^8  d   QhRRRR/# )r   r  r   r   ztuple[tuple[str], tuple[str]]r!   )r"   s   "r#   r$   r     s     	5 	5~ 	52O 	5r%   c                	`   \        4       p\        4       pV P                  R R4       Fo  p\        V4       F]  pVP                  R8w  d   VP	                  VP                  4       VP
                  R8w  g   KB  VP	                  VP
                  4       K_  	  Kq  	  \        V4      \        V4      3# )Tagnoneanyr!   )setra   r   r   addr   tuple)r  r   r   tag_strr   s   &    r#   r   !PyPIDistribution._tags_from_wheel  s    5xxr*G )77f$LL)<<5(!%%cll3	 * + Xm 444r%   c                    V ^8  d   QhRRRR/# )r   r   ztuple[str, str, int]r   r7   r!   )r"   s   "r#   r$   r     s     
 
#7 
D 
r%   c                	   V  F  vr\        V4      pR VP                  9   d    R# VP                  R8X  g   K6  VP                  P                  R8X  g   KS  VP                  4       '       g   Kk  \        P                  ! VP                  4       4      pVP                  R/ 4      P                  R4      '       g   K   R# 	  R# )__editable__Tzdirect_url.jsonr   dir_infor   F)
r   stemrk   parentr   r	  r<   r   	read_textra   )r   rs   r   r  s   &   r#   r   $PyPIDistribution._is_record_editable  s    HD:D*yy--$++2D2D2T<<>>::dnn&67Dxx
B/33J??#  r%   c                   V ^8  d   QhRR/# )r   r   zargparse.ArgumentParserr!   )r"   s   "r#   r$   r     s      6 r%   c                 	   \         P                  ! 4       p V P                  R 4       V P                  R4       V P                  R4       V P                  RR. R7       V P                  RR. R7       V P                  RR. R7       V # )rJ   r   r   r   rM   )actiondefaultr   z--record-checksum)argparseArgumentParseradd_argument)parsers    r#   r   "PyPIDistribution._build_arg_parser  s    ((*F#././GHbAL2F/"Mr%   )	r   rk   r   r   r   r\   r   r   rh   )NNr!   r!   NFrG   )__name__
__module____qualname____firstlineno__r   r   r   classmethodr   r   r   r  staticmethodr   r   r   r   __static_attributes__r!   r%   r#   r   r     s    LK* 6
 6
p 
 
4"H< 	 	 	5 	5 
 
  r%   r   c               $    V ^8  d   QhRRRRRR/# )r   r   rH   algosr>   r   zdict[str, str]r!   )r"   s   "r#   r$   r$     s!     ) ) )] )^ )r%   c           
     `  a . p \        V 4      ;_uu_ 4       p\        VRRR7      pV F  pVw  org\        S4      oV'       d   \        V4      pSP                  ^ ,          P                  R4      '       d   SP                  R9  d   Ka  SP                  ^ ,          R8X  dD   \        ;QJ d    V3R lR 4       F  '       g   K   RM	  RM! V3R lR 4       4      '       d   R	^ rvVP                  \        S4      Wg34       K  	  R
R
R
4        \        RRR7      ;_uu_ 4       p	T	P                  \         P"                  ! T^ RR7      4       R
R
R
4       T U
u/ uF  q\%        X	P                  T
4      bK  	  up
\&        P(                  ! X	P                  4       #   + '       g   i     L; i  \         d9   p\        P                  RT 4       \        P                  RYR7        R
p?R
# R
p?ii ; i  + '       g   i     L; iu up
i   \&        P(                  ! X	P                  4       i ; i)a  
Given a `RECORD` file, compute hashes out of a subset of its sorted contents.

We skip `*.dist-info` files other than `METADATA` and `WHEEL`.
For non site-packages files, we only keep the path for those than fall in `bin`, `lib`
and `Scripts` because their hash and size might change with path relocation.

The list of tuples `(path, hash, size)` is then sorted and written as JSON with no spaces or
indentation. This output is what gets hashed.
,")	delimiter	quotecharr   z..c              3  @   <"   T F  qSP                   9   x  K  	  R # 5irG   )parts)rI   partrs   s   & r#   rK   %compute_record_sum.<locals>.<genexpr>  s      13L4DJJ&3Ls   TF Nz(Could not compute RECORD checksum for %szCould not open %sr(   w)r   )indent
separators)r   WHEEL)binlibScripts)r6  r   )r   
csv_readerr   r    r;  r   rk   r  rM   rH   OSErrorr*   ry   r   r	   writer<   dumpsr   r_   rm   )r   r4  contentsr   r   rowhash_sizer1   tmpr   rs   s   &&         @r#   r   r     s    H(^^qSC@F$'!eDzt9D::a=)),77DIIMb<b ::a=D(SS 13L1SSS 13L1 . .
 #%a4TE 89  .E22cIIdjj!
KL 3>CDedk#((D11eD
		#((9 ^$  A8L((A 32D
		#((s}   F- AF75F-FF"#FF- H #)G3H H7H F*	%F- *F- -G08-G++G03H	>H "H-)FFr   FFFr!   FrG   )TFr>  r>  r!   r!   ))sha256)C
__future__r   r'  r<   r_   r   r   csvr   rF  email.parserr   loggingr   pathlibr   
subprocessr   tempfiler	   typingr
   r   r   conda.base.contextr   conda.cli.mainr   conda.core.prefix_datar   conda.exceptionsr   r   conda.gateways.disk.readr   conda.models.enumsr   conda.models.match_specr   conda.models.recordsr   1conda.plugins.prefix_data_loaders.pypi.pkg_formatr   packaging.requirementsr   packaging.tagsr   packaging.versionr   conda_pypi.python_pathsr   r   r   r,  r*   __file__r   rd   HEREr2   rQ   rt   rz   r   r   r   r   r!   r%   r#   <module>rg     s    "   	  
 $ %    ' ) ) & ( - ; 0 * - . P . $ %  
VH:&	'H~$$&"#J0?f
44B$JI IX) )r%   