\bg[!ddlZddlZddlZddlZddlZddlZddlmZdZdZ GddZ dZ e d d d d d ddddddddddddddZ dS)N)Metadatacfdd|dDS)N c3K|]A}||d=|VBdS)#N)strip startswith).0lines u/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/pkg_resources/tests/test_working_set.py z!strip_comments..sd  ::<<!% 7 7 < < )joinsplit)ss r strip_commentsr s> 99GGDMM  rc#K|}tjd|D]}|s|dd}dt|cxkrdksnJ|ddd\}}|r9t j|d}td|f}nd}tj ||| }|VdS) 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])rrr-z requires.txtN) project_nameversionmetadata) r rerlenpoprsplittextwrapdedentr pkg_resources Distribution)rspecfieldsnamerrequiresrdists r parse_distributionsr's &  A++  D!$$CKK$$$$1$$$$$$ 1 ,,S!44 g  vzz!}}55H :;;HHH)w    rceZdZddZdZdS) FakeInstallerreturnNc||_dSN)_installable_dists)selfinstallable_distss r __init__zFakeInstaller.__init__;s"3rcjtttfd|jdS)Nc |vSr,)r&reqs r z(FakeInstaller.__call__..@s TS[r)nextiterfilterr-)r.r4s `r __call__zFakeInstaller.__call__>s9 0000$2IJJ K KT   r)r*N)__name__ __module__ __qualname__r0r9r3rr r)r):s74444     rr)c Jg}g}|D]z}dtj|ddD\}}}}}} t t |}t t |}t t j|}|d|f|dzd| ffD]\} } } || t| } tj d| r-tt | } t| tsJnt t | } |t!j|||| | Ɛ|t jd|| S) Nc3XK|]%}t|V&dSr,)rlstrip)r rs r rz7parametrize_test_working_set_resolve..OsF   188:: & &      rz F_replace_conflictingTz\w+$z^installed_dists,installable_dists,requirements,replace_conflicting,resolved_dists_or_exception)ids)rrr?rlistr'r parse_requirementsappendrr rmatchgetattr issubclass Exceptionpytestparammark parametrize) test_listidlist argvaluestestr$installed_distsr/ requirements expected1 expected2id_replace_conflictingexpecteds r $parametrize_test_working_set_resolverYDs FI""  _T**113399&!DD          2?CCDD !45F!G!GHHM<\JJKK 5) $ * *D) <3    .C$h MM#   %hnn&6&677Hx** ?"=(;;!(I666666 3H = =>>    #% '      ( ; " " &   #  rz # 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 ctjg}tt|j|t j|j|t||}tj |r9tj |5|ddddS#1swxYwYdSt|t|ksJdS)N) installerrW)r WorkingSetrCmapadd functoolspartialresolver)inspectisclassrJraisessorted)rRr/rSrWresolved_dists_or_exceptionws resolve_calls r test_working_set_resolveriss#l  !" % %BRV_ % %&&&$  122/ L 233M ]6 7 7   LNNN                  llnn%%0K)L)LLLLLLLs B!!B%(B%) r_rbrrrJr test_resourcesrrr'r)rYrir3rr rksF  $$$$$$"""J        ,,,^&% $&"$&$,(,,,,,(08y nn^ MM_ nn^ MMMr