7f&dZddlZddlmZddlmZddlmZddlm Z m Z ddl m Z ddl mZd ZejeZd e d ed eeeffd Zde d ed efdZde ded efdZde ded efdZded eedffdZdeedfd ed dfdZdS)z0Support functions for working with wheel files. N)Message)Parser)Tuple) BadZipFileZipFile)canonicalize_name)UnsupportedWheel)r wheel_zipnamereturnc t||}t||}t|}n&#t$r}t|d|d}~wwxYwt ||||fS)zExtract information from the provided wheel, ensuring it meets basic standards. Returns the name of the .dist-info directory and the parsed WHEEL metadata. z has an invalid wheel, N)wheel_dist_info_dirwheel_metadata wheel_versionr check_compatibility)r r info_dirmetadataversiones y/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/utils/wheel.py parse_wheelrs D&y$77!)X66)) DDD$BBqBBCCCD&&& X s/2 AAAsourcecd|D}d|D}|stdt|dkr5tdd||d}t |}t |}||std|d ||S) zReturns the name of the contained .dist-info directory. Raises AssertionError or UnsupportedWheel if not found, >1 found, or it doesn't match the provided name. cFh|]}|dddS)/r r)split).0ps r z&wheel_dist_info_dir..-s)===aqwwsAq!===c<g|]}|d|S)z .dist-info)endswith)rss r z'wheel_dist_info_dir../s)@@@qqzz,'?'?@@@@r!z.dist-info directory not foundr z)multiple .dist-info directories found: {}z, rz.dist-info directory z does not start with )namelistr lenformatjoinr startswith)rr subdirs info_dirsr info_dir_namecanonical_names rrr&s>=6??+<+<===G@@G@@@I A?@@@ 9~~ 7 > >tyy?S?S T T   |H%h//M&t,,N  # #N 3 3  WH W W^ W W    Or!pathc ||S#tttf$r}t d|d|d}~wwxYw)Nzcould not read z file: )readrKeyError RuntimeErrorr )rr/rs rread_wheel_metadata_filer4EseG{{4    , /GGGEEEEEFFFGsAAA dist_info_dirc|d}t||} |}n'#t$r}td|d|d}~wwxYwt |S)ziReturn the WHEEL metadata of an extracted wheel, if possible. Otherwise, raise UnsupportedWheel. z/WHEELzerror decoding z: N)r4decodeUnicodeDecodeErrorr rparsestr)rr5r/wheel_contents wheel_textrs rrrNs # # #D-fd;;NB#**,, BBB@@@1@@AAAB 88  Z ( ((s, AA  A wheel_data.c|d}|td|} ttt|dS#t $rtd|wxYw)zbGiven WHEEL metadata, return the parsed Wheel-Version. Otherwise, raise UnsupportedWheel. z Wheel-VersionNzWHEEL is missing Wheel-Version.zinvalid Wheel-Version: )r striptuplemapintr ValueError)r< version_textrs rrraso.L?@@@  ""GFSgmmC0011222 FFFDDDEEEFs 4A$$Brc b|dtdkrItd|dt t ||tkrCt ddt t |dSdS)aRaises errors or warns if called with an incompatible Wheel-Version. pip should refuse to install a Wheel-Version that's a major series ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when installing a version only minor version ahead (e.g 1.2 > 1.1). version: a 2-tuple representing a Wheel-Version (Major, Minor) name: name of wheel or package to raise exception about :raises UnsupportedWheel: when an incompatible Wheel-Version is given rzB{}'s Wheel-Version ({}) is not compatible with this version of pipr>z*Installing from a newer Wheel-Version (%s)N)VERSION_COMPATIBLEr r(r)rAstrloggerwarning)rr s rrrqsqz&q))) VD#((3sG+<+<"="=>>    % % % 8 HHSg&& ' '      & %r!)__doc__logging email.messager email.parserrtypingrzipfilerrpip._vendor.packaging.utilsrpip._internal.exceptionsr rF getLogger__name__rHrGrrbytesr4rrBrrr!rrVs!!!!!!''''''''999999555555  8 $ $7#%W 2E$ss>GWGCGEGGGG)7)3)7))))& Fg F%S/ F F F F  sCx        r!