7f( dZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddl m Z m Z mZmZmZmZmZmZddlmZddlmZddlmZdd lmZdd lmZmZm Z dd l!m"Z"m#Z#dd l$m%Z%dd l&m'Z'ddl(m)Z)ddl*m+Z+m,Z,e rddl-m.Z.ej/e0Z1de2de2deee2ee2e2fffdZ3GddZ4de2fdZ5dee2fdZ6GddZ7Gdde7Z8dS)z;Build Environment used for isolation during sdist building N) OrderedDict) TracebackType) TYPE_CHECKINGIterableListOptionalSetTupleTypeUnion)where)Version)__file__) open_spinner) get_platlib get_purelib get_scheme)get_default_environmentget_environment)VERBOSE)get_requirement)call_subprocess) TempDirectory tempdir_kinds) PackageFinderabreturnc||kr||fn|fSN)rrs w/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/build_env.py_dedupr# s!VVAq66!%ceZdZdeddfdZdS)_PrefixpathrNc||_d|_td|}|j|_t |j|j|_dS)NF)prefix) r'setuprscriptsbin_dirr#purelibplatliblib_dirs)selfr'schemes r"__init__z_Prefix.__init__%sD  Bt,,,~ v~v~>> r$)__name__ __module__ __qualname__strr3r!r$r"r&r&$s6?S?T??????r$r&ctjtj}|st |Stj|dz S)zGet a file to pass to a Python executable, to run the currently-running pip. This is used to run a pip subprocess, for installing requirements into the build environment. z__pip-runner__.py) pathlibPath pip_locationresolveparentis_dirr7osfsdecode)sources r"get_runnable_piprB-sV \, ' ' / / 1 1 8F ==??6{{ ;v 33 4 44r$cttdrtj}ntt g}d|DS)zGet system site packages Usually from site.getsitepackages, but fallback on `get_purelib()/get_platlib()` if unavailable (e.g. in a virtualenv created by virtualenv<20) Returns normalized set of strings. getsitepackagescLh|]!}tj|"Sr!)r?r'normcase).0r's r" z+_get_system_sitepackages..Ns( < < z,BuildEnvironment.__init__..WsV% % 727<< t<<== >% % % % % % r$)normaloverlayrJzsitecustomize.pywzutf-8)encodinga import os, site, sys # First, drop system-sites related paths. original_sys_path = sys.path[:] known_paths = set() for path in {system_sites!r}: site.addsitedir(path, known_paths=known_paths) system_paths = set( os.path.normcase(path) for path in sys.path[len(original_sys_path):] ) original_sys_path = [ path for path in original_sys_path if os.path.normcase(path) not in system_paths ] sys.path = original_sys_path # Second, add lib directories. # ensuring .pth file are processed. for path in {lib_dirs!r}: assert not path in sys.path site.addsitedir(path) )rKr0)rr BUILD_ENVr _prefixes _bin_dirs _lib_dirsreversedlistvaluesappendr-extendr0rLr?r'rS _site_direxistsmkdiropenwritetextwrapdedentformat)r1r*rKfprUs @r"r3zBuildEnvironment.__init__Ts m&=PTUUU$% % % % -% % %    %'$&tDN$9$9$;$;<<== 3 3F N ! !&. 1 1 1 N ! !&/ 2 2 2 2 011 hmV<<w~~dn-- % HT^ $ $ $  GLL); < z.BuildEnvironment.__enter__..s:    "*..t,,   r$)PATHPYTHONNOUSERSITE PYTHONPATHrr1) _save_envr]rcsplitr?pathseprdroupdaterS)r1r'old_path pythonpaths r" __enter__zBuildEnvironment.__enter__s  B    ~aaa >&)  4 KKrz22 3 3 3n%   --$' jooj99       r$exc_typeexc_valexc_tbc|jD]7\}}|!tj|d(|tj|<8dSr )rvitemsr?ropop)r1r}r~rvarname old_values r"__exit__zBuildEnvironment.__exit__s^ #'."6"6"8"8 0 0 GY  w----&/ 7##  0 0r$reqscjt}t}|rt|drt|jn t }|D]}t |}|j|jddis5||j }|s| |gt|j tr|j d|j }n|j d|j }|j|j ds| ||f||fS) zReturn 2 sets: - conflicting requirements: set of (installed, wanted) reqs tuples - missing requirements: set of reqs r^Nextrar)z==z===T) prereleases)setrIrr^rrmarkerevaluateget_distributionrTadd isinstanceversionr specifiercontains) r1rmissing conflictingenvreq_strreqdistinstalled_req_strs r"check_requirementsz#BuildEnvironment.check_requirementssU%%ee  B4--////,..    B B%g..:)#*2E2EwPRm2T2T)++CH55KK(((dlG44G+.8(E(Et|(E(E%%+.8(F(F (F(F%}--dl-MMBOO%6$@AAAG##r$finderr requirementsprefix_as_stringrPc|j|}|jrJd|_|sdS|t||||dS)NT)rP)r\r+_install_requirementsrB)r1rrrrPr*s r"install_requirementsz%BuildEnvironment.install_requirementsso 01<   F ""       #     r$ pip_runnabler*c tj|dddd|jddg }tt jkr|dn7ttkr|dd D]h}t|j |}| d | d d zd t|pdhfi|j}|rB| d|dg|ddD]} | d| gn|d|jD]} | d| g|jD]} | d| g|jr|d|jr|d|d | |dt)i} t+d|5} t-|d|| | ddddS#1swxYwYdS)Ninstallz--ignore-installedz --no-userz--prefixz--no-warn-script-locationz--disable-pip-version-checkz-vvz-v) no_binary only_binaryz--_-,z:none:z-irz--extra-index-urlz --no-indexz --find-linksz--trusted-hostz--prez--prefer-binary_PIP_STANDALONE_CERTz Installing zpip subprocess to install ) command_descspinner extra_environ)sys executabler'loggergetEffectiveLevelloggingDEBUGrbrgetattrformat_controlrcreplacerSsorted index_urls find_links trusted_hostsallow_all_prereleases prefer_binaryr rr)rrrr*rPargsrformatsr extra_indexlinkhostrrs r"rz&BuildEnvironment._install_requirementss N     K ' )    # # % % 6 6 KK      % % ' '7 2 2 KK   :  Nf3^DDG KK>11#s;;;HHVG$9z::;;    &  & KKz!}- . . .)!""~ @ @  0+>???? @ KK % % %% 0 0D KK. / / / /( 2 2D KK)40 1 1 1 1  ' ! KK   + KK) * * * D L!!!/9 ... / / 7 @$@@+                       s II IrN)r4r5r6__doc__r3r|rr BaseExceptionrrrr7r r rr staticmethodr&rr!r$r"rNrNQsyKK4444l    * 04 ./ 0-( 0' 0  0 0 0 0 $SM $ s5c?#SX- . $ $ $ $D  sm          *999sm9 9  9 999\999r$rNc eZdZdZddZddZdeeedeedee ddfd Z dd Z d d d e e de de ddf dZdS)NoOpBuildEnvironmentz0A no-op drop-in replacement for BuildEnvironmentrNcdSr r!r1s r"r3zNoOpBuildEnvironment.__init__" r$cdSr r!rs r"r|zNoOpBuildEnvironment.__enter__%rr$r}r~rcdSr r!)r1r}r~rs r"rzNoOpBuildEnvironment.__exit__(s r$cdSr r!rs r"cleanupzNoOpBuildEnvironment.cleanup0rr$rrrrrPctr )NotImplementedError)r1rrrrPs r"rz)NoOpBuildEnvironment.install_requirements3s"###r$r)r4r5r6rr3r|rr rrrrrr7rr!r$r"rrs::         4 ./ -( '           $$sm$ $  $ $$$$$$r$r)9rrr?r9rJrri collectionsrtypesrtypingrrrrr r r r pip._vendor.certifir pip._vendor.packaging.versionrpiprr;pip._internal.cli.spinnersrpip._internal.locationsrrrpip._internal.metadatarrpip._internal.utils.loggingrpip._internal.utils.packagingrpip._internal.utils.subprocessrpip._internal.utils.temp_dirrr"pip._internal.index.package_finderr getLoggerr4rr7r#r&rBrLrNrr!r$r"rs  ######SSSSSSSSSSSSSSSSSSSS%%%%%%111111((((((333333HHHHHHHHHHKKKKKKKK//////999999::::::EEEEEEEEA@@@@@@  8 $ $&c&c&eE#Jc3h$?@&&&&???????? 5# 5 5 5 5 =#c(====(KKKKKKKK\$$$$$+$$$$$r$