Ë
    nûàgš!  ã                   ó¤   — d dl Z d dlZd dlZd dlZd dlZd dlZddlmZ d„ Zd„ Z	 G d„ d«      Z
d„ Z ed	d
dddddddddddddddd«      d„ «       Zy)é    Né   )ÚMetadatac                 óP   — dj                  d„ | j                  d«      D «       «      S )Nú
c              3   ó~   K  — | ]5  }|j                  «       r#|j                  «       j                  d «      s|–— Œ7 y­w)ú#N)ÚstripÚ
startswith)Ú.0Úlines     úb/var/www/skyplay_api_hub/venv/lib/python3.12/site-packages/pkg_resources/tests/test_working_set.pyú	<genexpr>z!strip_comments.<locals>.<genexpr>   s4   è ø€ ò àØ�:‰:Œ< §
¡
£× 7Ñ 7¸Ô <ô 	ñùs   ‚;=)ÚjoinÚsplit)Úss    r   Ústrip_commentsr      s(   € Ø�9‰9ñ à—G‘G˜D“Môó ð ó    c              #   óª  K  — | j                  «       } t        j                  d| «      D ]¦  }|sŒ|j                  dd«      }dt        |«      cxk  rdk  sJ ‚ J ‚|j	                  d«      j                  dd«      \  }}|r2t        j                  |j	                  d«      «      }t        d|f«      }nd}t        j                  |||¬	«      }|–— Œ¨ y­w)
a™  
    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‰ˆˆgÙÜ—‘ v§z¡z°!£}Ó5ˆHÜ °Ð :Ó;‰HàˆHÜ×)Ñ)Ø w¸ô
ˆð ‹
ñùs   ‚CCc                   ó   — e Zd Zdd„Zd„ Zy)ÚFakeInstallerNc                 ó   — || _         y ©N)Ú_installable_dists)ÚselfÚinstallable_distss     r   Ú__init__zFakeInstaller.__init__;   s
   € Ø"3ˆÕr   c                 ó\   ‡— t        t        t        ˆfd„| j                  «      «      d «      S )Nc                 ó   •— | ‰v S r+   © )r&   Úreqs    €r   ú<lambda>z(FakeInstaller.__call__.<locals>.<lambda>@   s   ø€  T¨S [€ r   )ÚnextÚiterÚfilterr,   )r-   r3   s    `r   Ú__call__zFakeInstaller.__call__>   s(   ø€ ÜÜ”Ó0°$×2IÑ2IÓJÓKÈTó
ð 	
r   )ÚreturnN)Ú__name__Ú
__module__Ú__qualname__r/   r8   r2   r   r   r)   r)   :   s   „ ó4ó
r   r)   c                  óÖ  — g }g }| D �]>  }d„ t        j                  |«      j                  «       j                  dd«      D «       \  }}}}}}	t	        t        |«      «      }t	        t        |«      «      }t	        t        j                  |«      «      }|d|f|dz   d|	ffD ]¤  \  }
}}|j                  |
«       t        |j                  «       «      }t        j                  d|«      r"t        t        |«      }t        |t        «      sJ ‚t	        t        |«      «      }|j                  t!        j"                  |||||«      «       Œ¦ �ŒA t         j$                  j'                  d||¬	«      S )
Nc              3   óN   K  — | ]  }t        |j                  «       «      –— Œ y ­wr+   )r   Úlstrip)r   r   s     r   r   z7parametrize_test_working_set_resolve.<locals>.<genexpr>O   s#   è ø€ ò 
àô ˜1Ÿ8™8›:×&ñ
ùs   ‚#%z

é   FÚ_replace_conflictingTz\w+$)Úinstalled_distsr.   ÚrequirementsÚreplace_conflictingÚresolved_dists_or_exception)Úids)r   r   r?   r   Úlistr'   r    Úparse_requirementsÚappendr   r	   r   ÚmatchÚgetattrÚ
issubclassÚ	ExceptionÚpytestÚparamÚmarkÚparametrize)Ú	test_listÚidlistÚ	argvaluesÚtestr$   rB   r.   rC   Ú	expected1Ú	expected2Úid_rD   Úexpecteds                r   Ú$parametrize_test_working_set_resolverZ   D   sx  € Ø€FØ€IØó "ˆñ
ä—_‘_ TÓ*×1Ñ1Ó3×9Ñ9¸&À!ÓDô
ñ	
ØØØØØØô
 Ô2°?ÓCÓDˆÜ Ô!4Ð5FÓ!GÓHÐÜœM×<Ñ<¸\ÓJÓKˆà�5˜)Ð$ØÐ*Ñ*¨D°)Ð<ð3
ò 	Ñ.ˆCÐ$ hð �M‰M˜#ÔÜ% h§n¡nÓ&6Ó7ˆHÜ�x‰x˜ Ô*Ü"¤=°(Ó;�Ü! (¬IÔ6Ð6Ð6äÔ 3°HÓ =Ó>�Ø×ÑÜ—‘Ø#Ø%Ø Ø'Øóõò	ð"ô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                 óŽ  — t        j                  g «      }t        t        |j                  | «      «       t        j                  |j                  |t        |«      |¬«      }t        j                  |«      r&t        j                  |«      5   |«        d d d «       y t         |«       «      t        |«      k(  sJ ‚y # 1 sw Y   y xY w)N)Ú	installerrD   )r    Ú
WorkingSetrG   ÚmapÚaddÚ	functoolsÚpartialÚresolver)   ÚinspectÚisclassrN   ÚraisesÚsorted)rB   r.   rC   rD   rE   ÚwsÚresolve_calls          r   Útest_working_set_resolveri   w   s¦   € ôl 
×	!Ñ	! "Ó	%€BÜŒˆR�V‰V�_Ó	%Ô&Ü×$Ñ$Ø
�
‰
ØÜÐ 1Ó2Ø/ô	€Lô ‡�Ð2Ô3Ü�]‰]Ð6Ó7ñ 	ÙŒN÷	ð 	ô ‘l“nÓ%¬Ð0KÓ)LÒLÐLÑL÷	ð 	ús   ÂB;Â;C)r`   rc   r   r   rN   r    Útest_resourcesr   r   r'   r)   rZ   ri   r2   r   r   ú<module>rk      s°   ðÛ Û Û 	Û ã ã å $òò"÷J
ñ 
ò0ñf &ððð$ð&ð"ð$ð&ð$ð,ð(ð,ð,ð,ð,ð,ð(ð0ð8óy
nñ^Mó_nñ^Mr   