
    vKg                         S r SSKrSSKrSSKrSSKrSSKrSSKrSSKJr  SSK	J
r
  SSKJr  SSKJrJr  SrS	r\R$                  S
 5       r\R$                  S 5       r " S S5      r " S S5      r " S S5      rg)zdevelop tests    N)paths_on_pythonpath)develop)Distribution   )contexts
namespaceszHfrom setuptools import setup

setup(name='foo',
    packages=['foo'],
)
zprint "foo"
c              #     #    [         R                  " 5        n[         R                  " 5        nU R                  SU5        U R                  SU5        S v   S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f7f)Nzsite.USER_BASEzsite.USER_SITE)r   tempdirsetattr)monkeypatch	user_base	user_sites      ]/var/www/highfloat_scraper/venv/lib/python3.13/site-packages/setuptools/tests/test_develop.py	temp_userr      sb     				y9 0)< 0)<   
	 
	s3   B
A9)A(A9	B
(
A6	2A99
BB
c              #     #    U nUR                  S5      nUS-  nUR                  5       (       a  [        [        U5      5      eUR	                  S5       nUR                  [        5        S S S 5        US-  nUR	                  S5       nUR                  [        5        S S S 5        UR                  5          Uv   S S S 5        g ! , (       d  f       N`= f! , (       d  f       N== f! , (       d  f       g = f7f)Nfoosetup.pywz__init__.py)	mkdirisfile
ValueErrordiropenwriteSETUP_PYINIT_PYas_cwd)tmpdirr   targetr   setupfinits          r   test_envr#   &   s     F
,,u
CZE||~~V%%	CA	 
D	31	 
	 
 
 
	sN   AC8C+C8	CC87C'<	C8
CC8
C$ C8'
C51C8c                       \ rS rSr\" \S5      r\" \S5      =(       a    \R                  \R                  :g  r	S r
\R                  R                  SS9S 5       rSrg	)
TestDevelop6   real_prefixbase_prefixc                     [         R                  " S5        [        SS/SSS/0S9n[        U5      nSUl        [        U5      nUR                  5         Xl        UR                  5         g)	zw
Test that console scripts are installed and that they reference
only the project by name and not the current version.
zTTODO: needs a fixture to cause 'develop' to be invoked without mutating environment.r   z0.0console_scriptszfoocmd = foo:foo)namepackagesversionentry_pointsr   N)	pytestskipdictr   script_namer   ensure_finalizedinstall_dirrun)selfr   settingsdistcmds        r   test_console_scripts TestDevelop.test_console_scripts:   ss    
 	:	
 W!&$		
 H%%dm 	    z0legacy behavior retained for compatibility #4167reasonc                     [        SS9n[        U5      n[        U5      nUR                  5         [        R
                  " UR                  5      nUR                  S:X  d   eUR                  S:X  d   eg )NzFoo $$$ Bar_baz-bing)r+   z	.egg-linkFoo_Bar_baz_bing)	r1   r   r   r3   pathlibPathegg_linksuffixstem)r6   r7   r8   r9   links        r   test_egg_link_filename"TestDevelop.test_egg_link_filenameU   sg    '
 H%dm||CLL){{k)))yy....r<    N)__name__
__module____qualname____firstlineno__hasattrsysin_virtualenvr(   prefixin_venvr:   r/   markxfailrG   __static_attributes__rI   r<   r   r%   r%   6   sY    C/Mc=)Kcoo.KG6 [[PQ	/ R	/r<   r%   c                   *    \ rS rSrSrS rS rS rSrg)TestResolverb   z
TODO: These tests were written with a minimal understanding
of what _resolve_setup_path is intending to do. Come up with
more meaningful cases that look like real-world scenarios.
c                 @    [         R                  " SSS5      S:X  d   eg )N.r   _resolve_setup_pathr6   s    r   test_resolve_setup_path_cwd(TestResolver.test_resolve_setup_path_cwdi   s    **3S9S@@@r<   c                 @    [         R                  " SSS5      S:X  d   eg )NpkgsrZ   ../r[   r]   s    r   test_resolve_setup_path_one_dir,TestResolver.test_resolve_setup_path_one_dirl   s    **63?5HHHr<   c                 @    [         R                  " SSS5      S:X  d   eg )Nzpkgs/rZ   ra   rb   r[   r]   s    r   .test_resolve_setup_path_one_dir_trailing_slash;TestResolver.test_resolve_setup_path_one_dir_trailing_slasho   s    **7C@EIIIr<   rI   N)	rJ   rK   rL   rM   __doc__r^   rc   rf   rU   rI   r<   r   rW   rW   b   s    AIJr<   rW   c                       \ rS rSr\S 5       r\R                  R                  \	" \
R                  R                  S5      5      SS9\R                  R                  \R                  " 5       S:H  SS9S 5       5       rS	rg
)TestNamespacess   c                    [         R                  SSS[        U5      /nU R                  5          [	        [        U5      /5         [
        R                  " U5        S S S 5        S S S 5        g ! , (       d  f       N= f! , (       d  f       g = f)Nr   r   z--install-dir)rO   
executablestrr   r   
subprocess
check_call)src_dirr   develop_cmds      r   install_developTestNamespaces.install_developt   sg     NNK
 ^^$c&k]3%%k2 4 33 s#   A>A-A>-
A;	7A>>
BAPPVEYORz-https://github.com/pypa/setuptools/issues/851r=   PyPyz.https://github.com/pypa/setuptools/issues/1202c           	         [         R                  " US5      n[         R                  " US5      nUS-  n[        R                  SSS[	        U5      S[	        U5      /n[
        R                  " U5        U R                  X45        [         R                  " U5        [        R                  SS	/n[        [	        U5      /5         [
        R                  " U5        S
S
S
5        [        R                  SS/n[        [	        U5      /5         [
        R                  " U5        S
S
S
5        g
! , (       d  f       NV= f! , (       d  f       g
= f)z
Installing two packages sharing the same namespace, one installed
naturally using pip or `--single-version-externally-managed`
and the other installed using `develop` should leave the namespace
in tact and both packages reachable by import.
z	myns.pkgAz	myns.pkgBr,   z-mpipinstallz-tz-cz"import myns.pkgA; import myns.pkgBNzimport pkg_resources)
r   build_namespace_packagerO   rm   rn   ro   rp   rs   make_site_dirr   )r6   r   pkg_Apkg_Br   install_cmd
try_importpkg_resources_imps           r   !test_namespace_package_importable0TestNamespaces.test_namespace_package_importable   s    226;G226;G*$ NNJK
 	k*U+  (NN0


 !#f+/!!*- 0
 NN"

 !#f+/!!"34 0/ 0/ 0/s   D)	D:)
D7:
ErI   N)rJ   rK   rL   rM   staticmethodrs   r/   rS   skipifboolosenvirongetplatformpython_implementationr   rU   rI   r<   r   rj   rj   s   s    
3 
3 [[RZZ^^J'(>   [[&&(F2?  &5		&5r<   rj   )rh   r   rA   r   ro   rO   r/   setuptools._pathr   setuptools.command.developr   setuptools.distr    r   r   r   r   fixturer   r#   r%   rW   rj   rI   r<   r   <module>r      s     	    
  0 . ( "    )/ )/XJ J"<5 <5r<   