\bg.ddlmZddlZddlZddlZddlZddlZddlZddlZddl m Z ddl m Z ddl Z ddlmZddlmZddlmZmZmZddlmZd d lmZmZd d lmZGd d eZe jdZ GddZ!GddZ"dS)) annotationsN)Path)mock)path)errors)egg_infomanifest_maker write_entries) Distribution)contexts environment)DALSceZdZdS) EnvironmentN)__name__ __module__ __qualname__o/builddir/build/BUILD/cloudlinux-venv-1.0.7/venv/lib/python3.11/site-packages/setuptools/tests/test_egg_info.pyrrsDrrc #Ktjd5t}tjt jd}tfd|D|_tttj |j tj|jddtd|jzii|VddddS#1swxYwYdS)Nzsetuptools-test.)prefix)homelibscriptsdatazegg-basec3\K|]&}|tj|fV'dS)N)osrjoin).0dirnameenv_dirs r zenv.."s8WWw'27<<#A#ABWWWWWWrrz.pydistutils.cfgzT [egg_info] egg-base = %(egg-base)s )r tempdirrrchmodstatS_IRWXUdictpathslistmapmkdirvaluesrbuildr)envsubsr#s @rr0r0sC  !3 4 4 4'"" $,''';WWWWRVWWWWW  S39++-- . ./// If "Di  %%    #sC C11C58C5c*eZdZedZdZed|dZdZed Z d Z d Z d Z d Z dZdZd}dZdejjZdejjZdZGddZeddddddddd d!d"eee#d$Zd%Zd&Zd'Zd(Zd)Ze j!d*ed+d,d-d.fed/d,d-dfed0d,d-d.fed+d1d,d2d.fe j"ed3d,d-d.d45gd6Z#e j!d7ed8d9d:d;dd9d:d;d * * 8c  & &z3 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 sy~a0000000sA22A69A6c:||||tjd}t jd|||tjd}||ksJdS)z9Ensure timestamps are updated when the command is re-run.rlgMbP?N)r8rprrgetmtimetimesleep)r7rYr0 timestamp_a timestamp_bs r test_rebuiltzTestEggInfo.test_rebuilts  "":s333g&&~66  5 "":s333g&&~66 k))))))rc|tjtdddid|||t jdd}t j|d}t|d 5}d | d vsJ ddddS#1swxYwYdS) Nz: recursive-include docs *.rst z usage.rstzRun 'hi') MANIFEST.indocsr?rlrnrJrKzdocs/usage.rst r8rr/rrprr rUrVrA)r7rYr0 egg_info_dir sources_txtr]s rtest_manifest_template_is_readz*TestEggInfo.test_manifest_template_is_reads.   Z    "":s333w||C88 gll<?? + 0 0 0 ++c$eZdZedZdS)TestEggInfo.RequiresTestHelperc g}g}|D]J}|dd}|dd}t|dkr/|d}t j|}ni}|d} fd|D\} } } | | df| dz| d ffD]y\} }}|| d }|d r|d d}tj j }|tj ||| || zLtj d||S)Nz rrr cDg|]}t|jdiS)r)rformat)r!a format_dicts r z>TestEggInfo.RequiresTestHelper.parametrize..sDLLL67NDGGN11[11LLLrF _in_setup_cfgTrz@xfail )marksz;requires,use_setup_cfg,expected_requires,install_cmd_kwargs)ids)lstriprApoplenstripast literal_evalappend startswithr~markxfailparam parametrize) test_listridlist argvaluestest test_params name_kwargsvalinstall_cmd_kwargsnamesetup_py_requiressetup_cfg_requiresexpected_requiresid_ruse_cfgrs ` rrz*TestEggInfo.RequiresTestHelper.parametrizesFI!  "kkmm11&!<< )ooa0066t<< {##a''%a...00C),)9#)>)>&&)+&"1~++--LLLL;FLLLH!#57H,e4O+-?F/*C7MM#&&&E**:662#+ABB< & 1$$ $#-."' $;**M+ rN)rrr staticmethodrrrrRequiresTestHelperrs- % %  % % % rrz install_requires_deterministic install_requires=["wheel>=0.5", "pytest"] [options] install_requires = wheel>=0.5 pytest wheel>=0.5 pytest z install_requires_ordered install_requires=["pytest>=3.0.2,!=10.9999"] [options] install_requires = pytest>=3.0.2,!=10.9999 pytest!=10.9999,>=3.0.2 z install_requires_with_marker install_requires=["barbazquux;{mismatch_marker}"], [options] install_requires = barbazquux; {mismatch_marker} [:{mismatch_marker_alternate}] barbazquux z install_requires_with_extra {'cmd': ['egg_info']} install_requires=["barbazquux [test]"], [options] install_requires = barbazquux [test] barbazquux[test] a install_requires_with_extra_and_marker install_requires=["barbazquux [test]; {mismatch_marker}"], [options] install_requires = barbazquux [test]; {mismatch_marker} [:{mismatch_marker_alternate}] barbazquux[test] z setup_requires_with_markers setup_requires=["barbazquux;{mismatch_marker}"], [options] setup_requires = barbazquux; {mismatch_marker} z extras_require_with_extra {'cmd': ['egg_info']} extras_require={{"extra": ["barbazquux [test]"]}}, [options.extras_require] extra = barbazquux [test] [extra] barbazquux[test] aF extras_require_with_extra_and_marker_in_req extras_require={{"extra": ["barbazquux [test]; {mismatch_marker}"]}}, [options.extras_require] extra = barbazquux [test]; {mismatch_marker} [extra] [extra:{mismatch_marker_alternate}] barbazquux[test] z extras_require_with_marker extras_require={{":{mismatch_marker}": ["barbazquux"]}}, @xfail [options.extras_require] :{mismatch_marker} = barbazquux [:{mismatch_marker}] barbazquux a( extras_require_with_marker_in_req extras_require={{"extra": ["barbazquux; {mismatch_marker}"]}}, [options.extras_require] extra = barbazquux; {mismatch_marker} [extra] [extra:{mismatch_marker_alternate}] barbazquux z extras_require_with_empty_section extras_require={{"empty": []}}, [options.extras_require] empty = [empty] )invalid_markermismatch_markermismatch_marker_alternatecH||||j||fi|tjdd}tj|d}tj|r>t |d5} | } dddn #1swxYwYnd} | |ksJtj tj|j ddgksJdS) Nr?rlz requires.txtrJrKrr barbazquux*) rrprrr existsrUrVrglobr*) r7rYr0rrrrr requires_txtfpinstall_requiress r test_requireszTestEggInfo.test_requires9sK| ((=AAA"":sII6HIIIw||C88 w||L.AA 7>>, ' ' "lW555 -#%7799  - - - - - - - - - - - - - - - " &&((,=====yci&6 FFGG2MMMMMMsB77B;>B;cd}||tjt5|||ddddS#1swxYwYdS)z Packages that pass unordered install_requires sequences should be rejected as they produce non-deterministic builds. See #458. z0install_requires={"fake-factory==0.5.2", "pytz"}N)rr~rrrp)r7rYr0reqs r*test_install_requires_unordered_disallowedz6TestEggInfo.test_install_requires_unordered_disalloweds A ((--- ]> * * 8 8  & &z3 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8sAAAc~d}||j}||tjt 5|||dddn #1swxYwYtjtj |j ddgksJdS)Nz/extras_require={{":{marker}": ["barbazquux"]}},markerrr rrrr~rrrprrrr r*r7rYr0tmplrs r'test_extras_require_with_invalid_markerz3TestEggInfo.test_extras_require_with_invalid_markers@kk!4k55 ((--- ]> * * 8 8  & &z3 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8yci&6 FFGG2MMMMMM A//A36A3c~d}||j}||tjt 5|||dddn #1swxYwYtjtj |j ddgksJdS)Nz5extras_require={{"extra": ["barbazquux; {marker}"]}},rrrrrs r.test_extras_require_with_invalid_marker_in_reqz:TestEggInfo.test_extras_require_with_invalid_marker_in_reqsFkk!4k55 ((--- ]> * * 8 8  & &z3 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8yci&6 FFGG2MMMMMMrc ~|dtj|jd}t jdgtj |jdt|gd|tj dd }ttj |d d 5}| d }dddn #1swxYwYd|vsJd|vsJdS)Nz*extras_require={"foobar": ["barbazquux"]},rHOMErrr cmdpypath data_streamr0r?rlrmrJrKrzProvides-Extra: foobarMetadata-Version: 2.1rrenvironcopyupdater*r run_setup_pypathsepr strrrUrVrAr7rYr0rrrr9s rtest_provides_extrazTestEggInfo.test_provides_extras^ (()UVVV*//##**6"+     :??CIe$4c*oo#FGG     w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3'>9999&.8888882(D&&D*-D*c L|dtj|jd}t jdgtj |jdt|gd|tj dd }ttj |d d 5}| }dddn #1swxYwYd |vsJdS)Nz0install_requires=["spam ; python_version<'3.6'"]rrrrr rr?rlrmrJrKzProvides-Extra:)rrrrrr*rrrr rrrUrV)r7rYr0rrr pkg_info_texts rtest_doesnt_provides_extraz&TestEggInfo.test_doesnt_provides_extrasI (( B   *//##**6"+     :??CIe$4c*oo#FGG     w||C88 "',,|Z887 K K K &rGGIIM & & & & & & & & & & & & & & & 555555s2DDD)fileslicense_in_sourcesz} [metadata] license_file = LICENSE z Test license)rHLICENSETz [metadata] license_file = INVALID_LICENSE z zexclude LICENSE)rHrrz [metadata] license_file = LICEN[CS]E* glob_pattern)idc |tj|tjdgt j|jdt|gt jdd}t|d d}|rd |vsJdSd |vsJd |vsJdS) Nrrrrr?rlrnrJrKrINVALID_LICENSE) r8rr/rrrrr r*rr read_text)r7rYr0rrr sources_texts rtest_setup_cfg_license_filez'TestEggInfo.test_setup_cfg_license_file!sD  5  :??CIe$4c*oo#FGG    w||C88 L-88BBGBTT  9 ,,,,,,L0000$L888888r)r incl_licenses excl_licensesz [metadata] license_files = LICENSE-ABC LICENSE-XYZ ABC license XYZ license)rH LICENSE-ABC LICENSE-XYZr r z [metadata] license_files = LICENSE-ABC, LICENSE-XYZ z [metadata] license_files = LICENSE-ABC zv [metadata] license_files = z [metadata] license_files = LICENSE-XYZ z [metadata] license_files = LICENSE-ABC INVALID_LICENSE )rHr rrz~ [metadata] license_files = LICENSE zexclude LICENSE-XYZ)rHrr r rz ABC copyingz ABC noticez ABC authorsLicensezInvalid license)rHr  COPYING-ABC NOTICE-ABC AUTHORS-ABC LICENCE-XYZrINVALID-LICENSE)r r rrrrrdefault_glob_patternsz [metadata] license_files = LICENSE* z XYZ notice)rHr  NOTICE-XYZrno_default_glob_patternsz [metadata] license_files = LICENSE-ABC LICENSE* files_only_added_oncec 6|tj|tjdgt j|jdt|gt jdd}t|d d}d | D}|D]} | | d ksJ|D]} | | d ksJdS) Nrrrr?rlrnrJrKc6g|]}|Srrr!lines rrz.A LLL$LLLrr rr8rr/rrrrr r*rrr splitlinescount r7rYr0rrrrr sources_lineslfs rtest_setup_cfg_license_filesz(TestEggInfo.test_setup_cfg_license_filesus+D  5  :??CIe$4c*oo#FGG    w||C88 L-88BBGBTT LL,2I2I2K2KLLL  0 0B &&r**a///// 0 0B &&r**a///// 0 0rz [metadata] license_file = license_files = z [metadata] license_file = LICENSE-ABC LICENSE-XYZ a  [metadata] license_file = LICENSE-ABC license_files = LICENSE-XYZ LICENSE-PQR z PQR license)rHr  LICENSE-PQRr )r r#r a9 [metadata] license_file = LICENSE-ABC license_files = LICENSE-ABC LICENSE-XYZ LICENSE-PQR z [metadata] license_file = LICENSE-ABC license_files = LICENSE-XYZ r#)rHr#a [metadata] license_file = LICENSE-ABC license_files = LICENSE-PQR LICENSE-XYZ z'exclude LICENSE-ABC exclude LICENSE-PQR)rHrr r#r z~ [metadata] license_file = LICENSE* z [metadata] license_file = LICENSE* license_files = NOTICE* )rHr rrrrcombined_glob_patterrnsc 6|tj|tjdgt j|jdt|gt jdd}t|d d}d | D}|D]} | | d ksJ|D]} | | d ksJdS) Nrrrr?rlrnrJrKc6g|]}|Srrrs rrzITestEggInfo.test_setup_cfg_license_file_license_files..rrr rrrs r)test_setup_cfg_license_file_license_filesz5TestEggInfo.test_setup_cfg_license_file_license_filesIs+L  5  :??CIe$4c*oo#FGG    w||C88 L-88BBGBTT LL,2I2I2K2KLLL  0 0B &&r**a///// 0 0B &&r**a///// 0 0rc |tjtddddddt jdgt j|j dt|g t jd d }tt j|d d 5}| d}dddn #1swxYwYd|D}d|dksJd|ddvsJd|ddvsJdS)zCAll matched license files should have a corresponding License-File.z [metadata] license_files = NOTICE* LICENSE* rr includedz not include)rHr r NOTICEIGNORErrrr?rlrmrJrKrNc<g|]}|d|S)z License-File:)rrs rrz?TestEggInfo.test_license_file_attr_pkg_info..s9   t/O/O    rzLicense-File: NOTICErzLicense-File: LICENSE-ABCr zLicense-File: LICENSE-XYZ)r8rr/rrrrrr r*rrUrVrA)r7rYr0rrr9license_file_liness rtest_license_file_attr_pkg_infoz+TestEggInfo.test_license_file_attr_pkg_infos  ")( #      :??CIe$4c*oo#FGG    w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3  +    &);A)>>>>>*.@.DDDDD*.@.DDDDDDDs(D  DDc  |dtjdgtj|jdt|gdtjdd}ttj|dd 5}| d }d d d n #1swxYwY| |d ksJd S)z5Make sure latest metadata version is used by default.rrrr rrrr?rlrmrJrKrN)r@r ) rrrrrr r*rrrUrVrArFr7rYr0rrr9s rtest_metadata_versionz!TestEggInfo.test_metadata_version$s' ((,,,  :??CIe$4c*oo#FGG    w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3''776AAAAAA4(C((C,/C,c |dtj|jd}t jdgtj |jdt|gd|tj dd }ttj |d d 5}| d }dddn #1swxYwYd}||vsJd|vsJdS)Nz.long_description_content_type='text/markdown',rrrrr rr?rlrmrJrKrz'Description-Content-Type: text/markdownrrr7rYr0rrrr9 expected_lines r"test_long_description_content_typez.TestEggInfo.test_long_description_content_type2sm (( @   *//##**6"+     :??CIe$4c*oo#FGG     w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3A ....&.888888rc d|dtjdgtj|jdt|gdtjdd}ttj|dd 5}| d }dddn #1swxYwYd |vsJd |dksJ|| d d}d|vsJd|vsJdS)Nzqlong_description='This is a long description\nover multiple lines',long_description_content_type='text/markdown',rrr r0r?rlrmrJrKrrrzThis is a long descriptionzover multiple lines) rrrrrr r*rrrUrVrAindex)r7rYr0rrr9long_desc_liness rtest_long_descriptionz!TestEggInfo.test_long_descriptionMsz (( =      :??CIe$4c*oo#FGG    w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3&.8888^B'''''()=)=b)A)A)C)CD+>>>>$777777r3c |dtj|jd}t jdgtj |jdt|gd|tj dd }ttj |d d 5}| d }dddn #1swxYwYd}||vsJd}||vsJ||dksJdS)Nzproject_urls={ 'Link One': 'https://example.com/one/', 'Link Two': 'https://example.com/two/', },rrrrr rr?rlrmrJrKrz/Project-URL: Link One, https://example.com/one/z/Project-URL: Link Two, https://example.com/two/r r@rrrrrr*rrrr rrrUrVrArFr5s rtest_project_urlszTestEggInfo.test_project_urlsds ((    *//##**6"+     :??CIe$4c*oo#FGG     w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3I ....I ....''776AAAAAArc |dtjdgtj|jdt|gdtjdd}ttj|dd 5}| d }d d d n #1swxYwYd |vsJd S)zTest single line license.zlicense='MIT',rrr r0r?rlrmrJrKrNz License: MIT rrrrrr r*rrrUrVrAr1s r test_licensezTestEggInfo.test_licenses (()9:::  :??CIe$4c*oo#FGG    w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3//////r3c 4|dtjdgtj|jdt|gdtjdd}ttj|dd 5}| d }d d d n #1swxYwYd |vsJd|vsJdd |vsJd S)z:Test license is escaped correctly if longer than one line.z>>>->1J1JJJJJJJr3c |dtj|jd}t jdgtj |jdt|gd|tj dd }ttj |d d 5}| d }dddn #1swxYwYd|vsJ||dksJdS)Nzpython_requires='>=2.7.12',rrrrr rr?rlrmrJrKrzRequires-Python: >=2.7.12r>r?rs rtest_python_requires_egg_infoz)TestEggInfo.test_python_requires_egg_infosl (()JKKK*//##**6"+     :??CIe$4c*oo#FGG     w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3*n<<<<''776AAAAAArcDddg}|D]}tj|sJdS)Nz:standard file not found: should have one of foo.py, bar.pyz"standard file 'setup.py' not found)r _should_suppress_warning)r7fixturesrs r'test_manifest_maker_warning_suppressionz3TestEggInfo.test_manifest_maker_warning_suppressionsH H 0   @ @C!:3?? ? ?? ? @ @rc|tddd}d|_t|}||d|jjvsJt|jdzd5}| d }d|vsJ ddddS#1swxYwYdS) Nfoo0.0.1rversionz non_setup.pyr5z /SOURCES.txtrJrKr) r8r script_namerfinalize_optionsrfilelistrrUrVrA)r7rYr[egg_info_instancer]sourcess rtest_egg_info_includes_setup_pyz+TestEggInfo.test_egg_info_includes_setup_pys$ Uw??@@)$TNN**,,,.7===== #,~= P P P )TUffhhnnT**G((((( ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) ) )s.C  CCNc Ztj|jd}|dg}t j|tj|jdt|gd|\}}|r J||r||vsJdSdS)Nrrrrr r) rrrrr*rrrr r)r7rYr0routputrcoders rrpz!TestEggInfo._run_egg_info_commands*//##**6"+   ;C!-:??CIe$4c*oo#FGG    d x  "T>>>> " "!>rc|tjdtdi|||t jdd}tt j|dd5}| d}dddn #1swxYwYd |vsJdS) NrHz [egg_info] tag_build = dev tag_date = 0 tag_svn_revision = 0 r?rlrmrJrKrzVersion: 0.0.0.dev0rr1s rtest_egg_info_tag_only_oncez'TestEggInfo.test_egg_info_tag_only_onces  "   "":s333w||C88 "',,|Z887 K K K 3rWWYY__T22N 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3$666666s(CCC)r9r:r;r<)F)NN)2rrrrr6r8rrFr`rWrjrtrrrrrrsys version_inforDrrrrrrrrrrrr~rrrr"r'r.r2r7r<r@rCrErGrKrVrpr[rrrr3r32s 4   L    \ >>>422\2!>!>!>F***   111B * * *<<<$     4::!';O!@ F F!'!G!!N''''''''R##           &'";g$TTjNNkTTjN* 8 8 8NNNNNN999"666$ ['"&""" . "&""" . "&""" .  "&""" $5-    FL!%""" .!   a= @@B99C@@B9& [3"&"""$1#0   . $"&""" $1#0   .  "&"""$1#0   ""&""" $1#0   .  "&""" $1#0    "&"""$2  "# ""&""" .   "&""" $5-     "&"""$9#0#0   .! $ FL!##0#0".#0#0('8  ##*+   . FL!%"""$1".  -    FL!%"""$1  *   W{ ~~~00~~~0* [3"&"""$1#0   . ""&"""$1#0   . &"&"""$1#0#0  >==! ("&" " "$1#0#0 >==% ,"&"""$1#0#0   .! ("&"""$2   . &"&"""$N#0#0#0 >==% ( FL!%""" $1".  -    FL!%"""$1".#0   -,!   [_ bbF00GbbF0*!E!E!EF B B B9996888.BBB@ 0 0 0KKK$BBB"@@@ ) ) )""""&77777rr3ceZdZdZdZdS)TestWriteEntriesc,tddd}ddi|_|d}d}tjt j|5}t|dd d |jj d vsJ ddddS#1swxYwYdS) NrMrNrOzfoo = invalid-identifier:foorz(Problems to parse .*invalid-identifier.*ry entry_pointsroz#ensure entry-point follows the specr) r raget_command_objr~rr OptionErrorr rr)r7rYr0r[r expected_msgexs rtest_invalid_entry_pointz)TestWriteEntries.test_invalid_entry_pointsUw??@@"$BC"":..B ]6-\ B B B Mb #~/A B B B8BHM!+=>>>)**44g4FF'72222'7222222rN)rrrrfrjrrrr_r_s5MMM 3 3 3 3 3rr_)# __future__rrrrrbr'r\rpathlibrunittestrr~jaracor setuptoolsrsetuptools.command.egg_inforr r setuptools.distr rr rtextwraprrrfixturer0r3r_rrrrts""""""  OOOOOOOOOO((((((########     #   *|7|7|7|7|7|7|7|7~%3333333333r