
    q"h_                         S SK r S SKJrJrJrJrJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  S SKJr  \(       a  S SKJr  \ R&                  " \5      r " S	 S
\
5      rg)    N)TYPE_CHECKINGIterableOptionalSetTuple)BuildEnvironment)AbstractDistribution)InstallationError)BaseDistribution)runner_with_spinner_message)PackageFinderc                       \ rS rSrSr\S\\   4S j5       rS\	4S jr
SSS\S	\SS
4S jrSS jrS\\   4S jrS\\   4S jrSS jrS\S\\\\4      SS
4S jrS\\   SS
4S jrSrg
)SourceDistribution   zRepresents a source distribution.

The preparation step for these needs metadata for the packages to be
generated, either using PEP 517 or using the legacy `setup.py egg_info`.
returnc                 |    U R                   R                  (       d   eU R                   R                  R                  $ )z/Identify this requirement uniquely by its link.)reqlinkurl_without_fragmentselfs    S/var/www/html/env/lib/python3.13/site-packages/pip/_internal/distributions/sdist.pybuild_tracker_id#SourceDistribution.build_tracker_id   s(     xx}}}xx}}111    c                 6    U R                   R                  5       $ )N)r   get_distr   s    r   get_metadata_distribution,SourceDistribution.get_metadata_distribution   s    xx  ""r   finderr   build_isolationcheck_build_depsNc                 b   U R                   R                  5         U R                   R                  =(       a    UnU(       a<  U R                  U5        U R                   R	                  5         U R                  U5        U R                   R                  =(       a    UnU(       as  U R                   R                  nUc   eU R                   R                  R                  U5      u  pxU(       a  U R                  SU5        U(       a  U R                  U5        U R                   R                  5         g )Nthe backend dependencies)r   load_pyproject_toml
use_pep517_prepare_build_backendisolated_editable_sanity_check_install_build_reqspyproject_requires	build_envcheck_requirements_raise_conflicts_raise_missing_reqsprepare_metadata)	r   r    r!   r"   should_isolateshould_check_depsr*   conflictingmissings	            r   prepare_distribution_metadata0SourceDistribution.prepare_distribution_metadata    s     	$$& ,,@ ''/ HH335$$V, HH//D4D!%!<!<%111#'88#5#5#H#H"$ K %%&@+N((1!!#r   c                 &   U R                   R                  nUc   e[        5       U R                   l        U R                   R                  R	                  XSSS9  U R                   R                  R                  U R                   R                  5      u  p4U(       a  U R                  SU5        U(       a]  [        R                  SU R                   5        [        R                  SSR                  [        [        [        U5      5      5      5        g g )Noverlayzbuild dependencieskindz"PEP 517/518 supported requirementsz4Missing build requirements in pyproject.toml for %s.z`The project does not specify a build backend, and pip cannot fall back to setuptools without %s.z and )r   r*   r   r+   install_requirementsr,   requirements_to_checkr-   loggerwarningjoinmapreprsorted)r   r    r*   r2   r3   s        r   r'   )SourceDistribution._prepare_build_backendG   s     "XX88!----///	8L 	0 	
  $xx11DDHH** 
 !!"FTNNF NNASvg78 r   c                 <   U R                   R                     [        S5      nU R                   R                  nUc   eUR	                  U5         UR                  5       sS S S 5        sS S S 5        $ ! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)Nz#Getting requirements to build wheel)r   r+   r   pep517_backendsubprocess_runnerget_requires_for_build_wheelr   runnerbackends      r   _get_build_requires_wheel,SourceDistribution._get_build_requires_wheela   sw    XX01VWFhh--G&&&**62;;= 32	   322	  #   8BA2	B2
B 	<B
Bc                 <   U R                   R                     [        S5      nU R                   R                  nUc   eUR	                  U5         UR                  5       sS S S 5        sS S S 5        $ ! , (       d  f       O= f S S S 5        g ! , (       d  f       g = f)Nz&Getting requirements to build editable)r   r+   r   rD   rE   get_requires_for_build_editablerG   s      r   _get_build_requires_editable/SourceDistribution._get_build_requires_editablei   s{    XX08F hh--G&&&**62>>@ 32   322  rL   c                    U R                   R                  (       aG  U R                   R                  (       a,  U R                   R                  (       a  U R	                  5       nOU R                  5       nU R                   R                  R                  U5      u  p4U(       a  U R                  SU5        U R                   R                  R                  XSSS9  g )Nr$   normalzbackend dependenciesr8   )
r   editablepermit_editable_wheelssupports_pyproject_editablerO   rJ   r+   r,   r-   r:   )r   r    
build_reqsr2   r3   s        r   r)   &SourceDistribution._install_build_reqss   s    
 HH//44::<J779J#xx11DDZP!!"<kJ//X,B 	0 	
r   conflicting_withconflicting_reqsc           
          SnUR                  U R                  USR                  S [        U5       5       5      S9n[	        U5      e)NzZSome build dependencies for {requirement} conflict with {conflicting_with}: {description}., c              3   4   #    U  H  u  pU S U 3v   M     g7f)z is incompatible with N ).0	installedwanteds      r   	<genexpr>6SourceDistribution._raise_conflicts.<locals>.<genexpr>   s&      ")A%I +3F8<)As   )requirementrX   description)formatr   r>   rA   r
   )r   rX   rY   format_stringerror_messages        r   r-   #SourceDistribution._raise_conflicts   sY    ? 	 &,,-		 ")/0@)A"  - 
  ..r   r3   c                     SnUR                  U R                  SR                  [        [        [        U5      5      5      S9n[        U5      e)NzASome build dependencies for {requirement} are missing: {missing}.r[   )rc   r3   )re   r   r>   r?   r@   rA   r
   )r   r3   rf   rg   s       r   r.   &SourceDistribution._raise_missing_reqs   sK    O 	 &,,$))CfWo4N*O - 
  ..r   r]   )r    r   r   N)__name__
__module____qualname____firstlineno____doc__propertyr   strr   r   r   boolr4   r'   r   rJ   rO   r)   r   r   r-   r.   __static_attributes__r]   r   r   r   r      s     2(3- 2 2
#+; #%$%$ %$ 	%$
 
%$N4>8C= >Ahsm A
&/ #/7:5c?7K/	/"/3s8 / /r   r   )loggingtypingr   r   r   r   r   pip._internal.build_envr    pip._internal.distributions.baser	   pip._internal.exceptionsr
   pip._internal.metadatar   pip._internal.utils.subprocessr   "pip._internal.index.package_finderr   	getLoggerrk   r<   r   r]   r   r   <module>r}      sB     @ @ 4 A 6 3 F@			8	$N/- N/r   