
    vKg                         S SK r S SKrS SKrS SK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   " S	 S
\R                   \5      r " S S5      rg)    N)_normalization_path
namespaces)easy_install   )_read_utf8_with_fallback)log)DistutilsOptionError)convert_pathc                       \ rS rSrSrSr\R                  SS/-   r\R                  S/-   rSr	S r
S	 rSS jr\S 5       rSS jrSS jrS rS rSrg
)develop   zSet up package for developmentz%install package in 'development mode')	uninstalluzUninstall this source package)z	egg-path=Nz-Set the path to be used in the .egg-link filer   Fc                     U R                   (       a(  SU l        U R                  5         U R                  5         OU R	                  5         U R                  5         g )NT)r   multi_versionuninstall_linkuninstall_namespacesinstall_for_developmentwarn_deprecated_optionsselfs    Z/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/setuptools/command/develop.pyrundevelop.run   sA    >>!%D!%%'((*$$&    c                 h    S U l         S U l        [        R                  " U 5        S U l        SU l        g )N.)r   egg_pathr   initialize_options
setup_pathalways_copy_fromr   s    r   r    develop.initialize_options&   s-    ''- #r   Nc           	      h   SS K nU R                  S5      nUR                  /U l        [        R
                  " U 5        U R                  5         U R                  5         U R                  R                  [        R                  " S5      5        [        R                  " UR                  5      S-   n[        R                  R                  U R                   U5      U l        UR$                  U l        U R&                  c.  [        R                  R)                  UR$                  5      U l        [*        R,                  " U R$                  5      n[*        R,                  " [        R                  R                  U R                   U R&                  5      5      nXT:w  a  [/        SU-   5      eUR1                  UUR3                  U[        R                  R)                  UR4                  5      5      UR                  S9U l        U R9                  U R$                  U R                   U R&                  5      U l        g )Nr   egg_infoz*.eggz	.egg-linkzA--egg-path must be a relative path from the install directory to project_name)pkg_resourcesget_finalized_commandegg_nameargsr   finalize_optionsexpand_basedirsexpand_dirspackage_indexscanglobr   filename_component_brokenospathjoininstall_diregg_linkegg_baser   abspathr   normpathr
   DistributionPathMetadatar%   dist_resolve_setup_pathr!   )r   r(   eiegg_link_fntargetr   s         r   r,   develop.finalize_options-   s   ''
3[[M	%%d+		' 23 44R[[AKO 	 T%5%5{C== GGOOBKK8DM.>>"'',,t/?/?"OP&!#)*  "..&&vrwwr{{/KL / 
	 22MMMM
r   c                    U R                  [        R                  S5      R                  S5      nU[        R                  :w  a  SUR                  S5      S-   -  n[        R                  " [        R                  R                  XU5      5      n[        R                  " [        R                  5      nXE:w  a  [        SUU5      eU$ )z
Generate a path from egg_base back to '.' where the
setup script resides and ensure that path points to the
setup path from $install_dir/$egg_path.
/z../   zGCan't get a consistent path to setup script from installation directory)replacer3   seprstripcurdircountr   r:   r4   r5   r
   )r8   r6   r   path_to_setupresolvedrI   s         r   r>   develop._resolve_setup_pathV   s     !((5<<SABII%!]%8%8%=%ABM>>"'',,{m"TU		*&*	  r   c                    U R                  S5        U R                  SSS9  U R                  S5        [        R                  (       a*  U R	                  [        R                  5        S [        l        U R                  5         [        R                  " SU R                  U R                  5        U R                  (       dI  [        U R                  SSS9 nUR                  U R                  S	-   U R                  -   5        S S S 5        U R                  S U R                   U R"                  (       + 5        g ! , (       d  f       N;= f)
Nr%   	build_extT)inplacezCreating %s (link to %s)wzutf-8)encoding
)run_commandreinitialize_command
setuptoolsbootstrap_install_fromr   install_namespacesr	   infor7   r8   dry_runopenwriter   r!   process_distributionr=   no_deps)r   fs     r   r   develop.install_for_developmentk   s    $ 	!!+t!<%,,j??@04J-! 	+T]]DMMJ||dmmS7;q,t>? < 	!!$		t||3CD	 <;s   ,D55
Ec                    [         R                  R                  U R                  5      (       a  [        R
                  " SU R                  U R                  5        [        U R                  5      R                  5        Vs/ sH  nUR                  5       PM     nnX R                  /U R                  U R                  /4;  a  [        R                  " SU5        g U R                  (       d   [         R                  " U R                  5        U R                  (       d  U R                  U R                   5        U R"                  R$                  (       a  [        R                  " S5        g g s  snf )NzRemoving %s (link to %s)z$Link points to %s: uninstall abortedz5Note: you must uninstall or replace scripts manually!)r3   r4   existsr7   r	   rY   r8   r   
splitlinesrH   r   r!   warnrZ   unlink
update_pthr=   distributionscripts)r   linecontentss      r   r   develop.uninstall_link   s    77>>$--((HH/N 5T]]CNNPPD P  
 $--1QRR?J<<		$--(||OODII&$$HHLM %s    E+c                    XR                   La  [        R                  " X5      $ U R                  U5        U R                  R
                  =(       d    /  Hg  n[        R                  R                  [        U5      5      n[        R                  R                  U5      n[        U5      nU R                  XXC5        Mi     g N)r=   r   install_egg_scriptsinstall_wrapper_scriptsrg   rh   r3   r4   r9   r   basenamer   install_script)r   r=   script_namescript_pathscript_texts        r   rn   develop.install_egg_scripts   s    yy 33D??
 	$$T*  ,,44::K''//,{*CDK''**;7K2;?K;L	 ; r   c                 D    [        U5      n[        R                  " X5      $ rm   )VersionlessRequirementr   ro   r   r=   s     r   ro   develop.install_wrapper_scripts   s    %d+33D??r   )	r"   r+   r=   r8   r7   r   r   r!   r   returnN)__name__
__module____qualname____firstlineno____doc__descriptionr   user_optionsboolean_optionscommand_consumes_argumentsr   r    r,   staticmethodr>   r   r   rn   ro   __static_attributes__ r   r   r   r      sz    (9K,,;L0 L
 #22k]BO!&'$'
R  (E,N(&@r   r   c                   6    \ rS rSrSrS	S jrS\4S jrS rSr	g)
rw      a}  
Adapt a pkg_resources.Distribution to simply return the project
name as the 'requirement' so that scripts will work across
multiple versions.

>>> from pkg_resources import Distribution
>>> dist = Distribution(project_name='foo', version='1.0')
>>> str(dist.as_requirement())
'foo==1.0'
>>> adapted_dist = VersionlessRequirement(dist)
>>> str(adapted_dist.as_requirement())
'foo'
Nc                     Xl         g rm   )_VersionlessRequirement__distrx   s     r   __init__VersionlessRequirement.__init__   s    r   namec                 .    [        U R                  U5      $ rm   )getattrr   )r   r   s     r   __getattr__"VersionlessRequirement.__getattr__   s    t{{D))r   c                     U R                   $ rm   r&   r   s    r   as_requirement%VersionlessRequirement.as_requirement   s       r   )__distrz   )
r|   r}   r~   r   r   r   strr   r   r   r   r   r   rw   rw      s    * *!r   rw   )r1   r3   rV   r   r   r   setuptools.command.easy_installr   unicode_utilsr   	distutilsr	   distutils.errorsr
   distutils.utilr   DevelopInstallerr   rw   r   r   r   <module>r      sF     	  8 8 8 4  1 '[@j))< [@|! !r   