
    sh!                         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 rS r	 " S S5      r
S r\" S	S
SSSSSSSSSSSSSSSS5      S 5       rg)    N   )Metadatac                 P    SR                  S U R                  S5       5       5      $ )N
c              3      #    U  HD  nUR                  5       (       d  M  UR                  5       R                  S 5      (       a  M@  Uv   MF     g7f)#N)strip
startswith).0lines     x/Users/tiagomarins/Projetos/claudeai/copy_bank/venv/lib/python3.13/site-packages/pkg_resources/tests/test_working_set.py	<genexpr>!strip_comments.<locals>.<genexpr>   s;      !D::< 	 $

 7 7 < 	!s   A"A	A)joinsplit)ss    r   strip_commentsr      s(    99 GGDM      c              #     #    U R                  5       n [        R                  " SU 5       H  nU(       d  M  UR                  SS5      nS[        U5      s=::  a  S::  d   e   eUR	                  S5      R                  SS5      u  p4U(       a3  [        R                  " UR	                  S5      5      n[        SU45      nOSn[        R                  " X4US	9nUv   M     g7f)
aa  
Parse a series of distribution specs of the form:
{project_name}-{version}
   [optional, indented requirements specification]

Example:

    foo-0.2
    bar-1.0
      foo>=3.0
      [feature]
      baz

yield 2 distributions:
    - project_name=foo, version=0.2
    - project_name=bar, version=1.0,
      requires=['foo>=3.0', 'baz; extra=="feature"']
z\n(?=[^\s])r   r      r   -zrequires.txtN)project_nameversionmetadata)r	   rer   lenpoprsplittextwrapdedentr   pkg_resourcesDistribution)r   specfieldsnamer   requiresr   dists           r   parse_distributionsr(      s     & 	
	A+D!$CK$1$$$$$

1,,S!4vzz!}5H :;HH))
 
 ,s   CC c                   $    \ rS rSrSS jrS rSrg)FakeInstaller:   Nc                     Xl         g N_installable_dists)selfinstallable_distss     r   __init__FakeInstaller.__init__;   s    "3r   c                 ^   ^ [        [        [        U4S jU R                  5      5      S 5      $ )Nc                    > U T;   $ r-    )r'   reqs    r   <lambda>(FakeInstaller.__call__.<locals>.<lambda>@   s	    TS[r   )nextiterfilterr/   )r0   r7   s    `r   __call__FakeInstaller.__call__>   s(    0$2I2IJKT
 	
r   r.   )returnN)__name__
__module____qualname____firstlineno__r2   r=   __static_attributes__r6   r   r   r*   r*   :   s    4
r   r*   c                     / n/ nU  GHO  nS [         R                  " U5      R                  5       R                  SS5       5       u  nnnnnn	[	        [        U5      5      n[	        [        U5      5      n[	        [        R                  " U5      5      nUSU4US-   SU	44 H  u  pnUR                  U
5        [        UR                  5       5      n[        R                  " SU5      (       a(  [        [        U5      n[        U[        5      (       d   eO[	        [        U5      5      nUR                  [         R"                  " UUUUU5      5        M     GMR     [         R$                  R'                  SUUS	9$ )
Nc              3   T   #    U  H  n[        UR                  5       5      v   M      g 7fr-   )r   lstrip)r   r   s     r   r   7parametrize_test_working_set_resolve.<locals>.<genexpr>O   s%      
D 188:&&Ds   &(z

   F_replace_conflictingTz\w+$)installed_distsr1   requirementsreplace_conflictingresolved_dists_or_exception)ids)r   r    rG   r   listr(   r!   parse_requirementsappendr   r	   r   matchgetattr
issubclass	Exceptionpytestparammarkparametrize)	test_listidlist	argvaluestestr%   rK   r1   rL   	expected1	expected2id_rM   expecteds                r   $parametrize_test_working_set_resolverc   D   sq   FI
__T*11399&!D
	

 2?CD !45F!GHM<<\JK5)$**D)<3
.Ch MM#%hnn&67Hxx**"=(;!(I6666 3H =>#% '3
 F ;;""	
 	 # 
 
r   z
    # id
    noop

    # installed

    # installable

    # wanted

    # resolved

    # resolved [replace conflicting]
    z
    # id
    already_installed

    # installed
    foo-3.0

    # installable

    # wanted
    foo>=2.1,!=3.1,<4

    # resolved
    foo-3.0

    # resolved [replace conflicting]
    foo-3.0
    z
    # id
    installable_not_installed

    # installed

    # installable
    foo-3.0
    foo-4.0

    # wanted
    foo>=2.1,!=3.1,<4

    # resolved
    foo-3.0

    # resolved [replace conflicting]
    foo-3.0
    z
    # id
    not_installable

    # installed

    # installable

    # wanted
    foo>=2.1,!=3.1,<4

    # resolved
    DistributionNotFound

    # resolved [replace conflicting]
    DistributionNotFound
    z
    # id
    no_matching_version

    # installed

    # installable
    foo-3.1

    # wanted
    foo>=2.1,!=3.1,<4

    # resolved
    DistributionNotFound

    # resolved [replace conflicting]
    DistributionNotFound
    z
    # id
    installable_with_installed_conflict

    # installed
    foo-3.1

    # installable
    foo-3.5

    # wanted
    foo>=2.1,!=3.1,<4

    # resolved
    VersionConflict

    # resolved [replace conflicting]
    foo-3.5
    z
    # id
    not_installable_with_installed_conflict

    # installed
    foo-3.1

    # installable

    # wanted
    foo>=2.1,!=3.1,<4

    # resolved
    VersionConflict

    # resolved [replace conflicting]
    DistributionNotFound
    a  
    # id
    installed_with_installed_require

    # installed
    foo-3.9
    baz-0.1
        foo>=2.1,!=3.1,<4

    # installable

    # wanted
    baz

    # resolved
    foo-3.9
    baz-0.1

    # resolved [replace conflicting]
    foo-3.9
    baz-0.1
    a  
    # id
    installed_with_conflicting_installed_require

    # installed
    foo-5
    baz-0.1
        foo>=2.1,!=3.1,<4

    # installable

    # wanted
    baz

    # resolved
    VersionConflict

    # resolved [replace conflicting]
    DistributionNotFound
    a  
    # id
    installed_with_installable_conflicting_require

    # installed
    foo-5
    baz-0.1
        foo>=2.1,!=3.1,<4

    # installable
    foo-2.9

    # wanted
    baz

    # resolved
    VersionConflict

    # resolved [replace conflicting]
    baz-0.1
    foo-2.9
    a  
    # id
    installed_with_installable_require

    # installed
    baz-0.1
        foo>=2.1,!=3.1,<4

    # installable
    foo-3.9

    # wanted
    baz

    # resolved
    foo-3.9
    baz-0.1

    # resolved [replace conflicting]
    foo-3.9
    baz-0.1
    a  
    # id
    installable_with_installed_require

    # installed
    foo-3.9

    # installable
    baz-0.1
        foo>=2.1,!=3.1,<4

    # wanted
    baz

    # resolved
    foo-3.9
    baz-0.1

    # resolved [replace conflicting]
    foo-3.9
    baz-0.1
    a	  
    # id
    installable_with_installable_require

    # installed

    # installable
    foo-3.9
    baz-0.1
        foo>=2.1,!=3.1,<4

    # wanted
    baz

    # resolved
    foo-3.9
    baz-0.1

    # resolved [replace conflicting]
    foo-3.9
    baz-0.1
    a  
    # id
    installable_with_conflicting_installable_require

    # installed
    foo-5

    # installable
    foo-2.9
    baz-0.1
        foo>=2.1,!=3.1,<4

    # wanted
    baz

    # resolved
    VersionConflict

    # resolved [replace conflicting]
    baz-0.1
    foo-2.9
    z
    # id
    conflicting_installables

    # installed

    # installable
    foo-2.9
    foo-5.0

    # wanted
    foo>=2.1,!=3.1,<4
    foo>=4

    # resolved
    VersionConflict

    # resolved [replace conflicting]
    VersionConflict
    a+  
    # id
    installables_with_conflicting_requires

    # installed

    # installable
    foo-2.9
        dep==1.0
    baz-5.0
        dep==2.0
    dep-1.0
    dep-2.0

    # wanted
    foo
    baz

    # resolved
    VersionConflict

    # resolved [replace conflicting]
    VersionConflict
    ap  
    # id
    installables_with_conflicting_nested_requires

    # installed

    # installable
    foo-2.9
        dep1
    dep1-1.0
        subdep<1.0
    baz-5.0
        dep2
    dep2-1.0
        subdep>1.0
    subdep-0.9
    subdep-1.1

    # wanted
    foo
    baz

    # resolved
    VersionConflict

    # resolved [replace conflicting]
    VersionConflict
    z
    # id
    wanted_normalized_name_installed_canonical

    # installed
    foo.bar-3.6

    # installable

    # wanted
    foo-bar==3.6

    # resolved
    foo.bar-3.6

    # resolved [replace conflicting]
    foo.bar-3.6
    c                    [         R                  " / 5      n[        [        UR                  U 5      5        [
        R                  " UR                  U[        U5      US9n[        R                  " U5      (       a'  [        R                  " U5         U" 5         S S S 5        g [        U" 5       5      [        U5      :X  d   eg ! , (       d  f       g = f)N)	installerrM   )r!   
WorkingSetrP   mapadd	functoolspartialresolver*   inspectisclassrW   raisessorted)rK   r1   rL   rM   rN   wsresolve_calls          r   test_working_set_resolverr   w   s    l 
	!	!"	%BRVV_	%&$$


 12/	L 233]]67N 87 ln%0K)LLLL 87s   C
C)ri   rl   r   r   rW   r!   test_resourcesr   r   r(   r*   rc   rr   r6   r   r   <module>rt      s      	    $"J
 
0f &$&"$&$,(,,,,,(08y
n^M_n^Mr   