Ë %!WÀšãó—dZddlZddlZddlZddlZddlmZddlmZm Z m Z m Z m Z m Z mZmZddlmZddlmZmZddlmZmZe e eeefeefZdd gZGd „d«ZGd „d ee«ZGd „dee«ZGd„d e«Z y)z)Source of information about a wheel file.éN)Úcontextmanager)ÚBinaryIOÚClassVarÚIteratorÚListÚOptionalÚTupleÚTypeÚcast)ÚInstallerError)Ú RecordEntryÚparse_record_file)Úcanonicalize_nameÚparse_wheel_filenameÚ WheelSourceÚ WheelFilec󲇗eZdZUdZeZeeee d<de de ddfˆfd„ Z e d„«Z e d „«Ze dee fd „«Zd e de fd „Zdd „Zdeefd„ZˆxZS)rzyRepresents an installable wheel. This is an abstract class, whose methods have to be implemented by subclasses. Úvalidation_errorÚ distributionÚversionÚreturnNcó>•—t‰|�«||_||_y)z¦Initialize a WheelSource object. :param distribution: distribution name (like ``urllib3``) :param version: version associated with the wheel N)ÚsuperÚ__init__rr)ÚselfrrÚ __class__s €ú6/usr/lib/python3.12/site-packages/installer/sources.pyrzWheelSource.__init__sø€ô ‰ÑÔØ(ˆÔ؈� ócó:—|j›d|j›d�S)ú Name of the dist-info directory.Ú-ú .dist-info©rr©rs rÚ dist_info_dirzWheelSource.dist_info_dir&s"€ð×#Ñ#Ð$ A d§l¡l ^°:Ð>Ð>rcó:—|j›d|j›d�S)zName of the data directory.r!z.datar#r$s rÚdata_dirzWheelSource.data_dir+s"€ð×#Ñ#Ð$ A d§l¡l ^°5Ð9Ð9rcó—t‚)z±Get names of all files in the dist-info directory. Sample usage/behaviour:: >>> wheel_source.dist_info_filenames ['METADATA', 'WHEEL'] ©ÚNotImplementedErrorr$s rÚdist_info_filenameszWheelSource.dist_info_filenames0s €ô"Ð!rÚfilenamecó—t‚)zÚGet contents, from ``filename`` in the dist-info directory. Sample usage/behaviour:: >>> wheel_source.read_dist_info("METADATA") ... :param filename: name of the file r))rr,s rÚread_dist_infozWheelSource.read_dist_info;s €ô"Ð!rcó—t‚)z¡Validate ``RECORD`` of the wheel. This method should be called before :py:func:`install ` if validation is required. r)r$s rÚvalidate_recordzWheelSource.validate_recordGs €ô "Ð!rcó—t‚)aÞSequential access to all contents of the wheel (including dist-info files). This method should return an iterable. Each value from the iterable must be a tuple containing 3 elements: - record: 3-value tuple, to pass to :py:meth:`RecordEntry.from_elements `. - stream: An :py:class:`io.BufferedReader` object, providing the contents of the file at the location provided by the first element (path). - is_executable: A boolean, representing whether the item has an executable bit. All paths must be relative to the root of the wheel. Sample usage/behaviour:: >>> iterable = wheel_source.get_contents() >>> next(iterable) (('pkg/__init__.py', '', '0'), <...>, False) This method may be called multiple times. Each iterable returned must provide the same content upon reading from a specific file's stream. r)r$s rÚ get_contentszWheelSource.get_contentsOs €ô."Ð!r)rN)Ú__name__Ú __module__Ú __qualname__Ú__doc__Ú ValueErrorrrr Ú ExceptionÚ__annotations__ÚstrrÚpropertyr%r'rr+r.r0rÚWheelContentElementr2Ú __classcell__©rs@rrrs©ø…ñð 3=Ð�h˜t I™Ñ/Ó<ð Sð°3ð¸4õðñ?óð?ðñ:óð:ðð" T¨#¡Yò"óð"ð " sð "¨só "ó"ð"˜hÐ':Ñ;÷"rcó>‡—eZdZdZdeeddfˆfd„ Zdefd„ZˆxZS)Ú_WheelFileValidationErrorz*Raised when a wheel file fails validation.ÚissuesrNcóD•—t‰|�t|««||_y©N)rrÚreprrA)rrArs €rrz"_WheelFileValidationError.__init__lsø€Ü ‰Ñœ˜f›Ô&؈� rcó"—d|j›d�S)Nz WheelFileValidationError(issues=Ú))rAr$s rÚ__repr__z"_WheelFileValidationError.__repr__ps€Ø1°$·+±+°ÀÐBÐBr) r3r4r5r6rr:rrGr=r>s@rr@r@is+ø„Ù4ð˜t C™yð¨TõðC˜#÷Crr@cóF‡—eZdZdZdedeededdfˆfd„ Zdefd„ZˆxZS) Ú_WheelFileBadDistInfoz8Raised when a wheel file has issues around `.dist-info`.Úreasonr,Ú dist_inforNcóN•—t‰|�|«||_||_||_yrC)rrrJr,rK)rrJr,rKrs €rrz_WheelFileBadDistInfo.__init__ws%ø€Ü ‰Ñ˜Ô ؈Œ Ø ˆŒ Ø"ˆ�rcóT—|j›d|j›d|j›d�S)Nz (filename=z , dist_info=rF©rJr,rKr$s rÚ__str__z_WheelFileBadDistInfo.__str__}s,€à�{‰{ˆm˜; t§}¡}Ð&7°|ÀDÇNÁNÐCUÐUVÐ Wð r) r3r4r5r6r:rrrOr=r>s@rrIrIts8ø„ÙBð# #ð#°¸#±ð#È3ð#ÐSWõ#ð  ˜÷ rrIc󨇗eZdZdZeZdejddfˆfd„ Ze e ddde dfd„««Z e defd „«Ze deefd „«Zd edefd „Zd dœdeddfd„Zde efd„ZˆxZS)rzèImplements `WheelSource`, for an existing file from the filesystem. Example usage:: >>> with WheelFile.open("sampleproject-2.0.0-py3-none-any.whl") as source: ... installer.install(source, destination) ÚfrNcóð•—||_|jsJ‚tjj |j«}t |«}t ‰|�|j|j¬«d|_ y)z€Initialize a WheelFile object. :param f: An open zipfile, which will stay open as long as this object is used. )rrN) Ú_zipfiler,ÚosÚpathÚbasenamerrrrrÚ_dist_info_dir)rrQrVÚ parsed_namers €rrzWheelFile.__init__Žshø€ð ˆŒ Ø�zŠzЈzä—7‘7×#Ñ# A§J¡JÓ/ˆÜ*¨8Ó4ˆ Ü ‰ÑØ×'Ñ'Ø$×1Ñ1ð ô ð.2ˆÕrrUzos.PathLike[str]c#ótK—tj|«5}||«–—ddd«y#1swYyxYw­w)z%Create a wheelfile from a given path.N)ÚzipfileÚZipFile)ÚclsrUrQs rÚopenzWheelFile.openžs*èø€ô�_‰_˜TÔ " aÙ�a“&ŠL÷#× "Ñ "üs‚8˜ ,£ 8¬5±8c óT—|j� |jS|jj«D�chc]}|jdd«d’Œ}}|D�cgc]}|j d«sŒ|‘Œ}} |\}|jdd «d}t|«}t|j«}||k7r"t d |jj|¬«‚||_|Scc}wcc}w#t $r6t d|jjtt|««¬«d‚wxYw) r NÚ/érr"z6Wheel doesn't contain exactly one .dist-info directoryrNr!éz7Wheel .dist-info directory doesn't match wheel filename) rWrSÚnamelistÚsplitÚendswithr7rIr,r:ÚsortedÚrsplitrr) rrUÚtop_level_directoriesÚnameÚ dist_infosr%Údi_dnameÚ norm_di_dnameÚnorm_file_dnames rr%zWheelFile.dist_info_dir¥sD€ð × Ñ Ð *Ø×&Ñ&Ð &ð/3¯m©m×.DÑ.DÔ.Fó! Ù.F dˆD�J‰J�s˜AÓ ˜qÓ !Ð.Fð ð! ñ3ó Ù2�T°d·m±mÀLÕ6QŠDÐ2ð ð ð Ø)Ñ ˆ]ð!×'Ñ'¨¨QÓ/°Ñ2ˆÜ)¨(Ó3ˆ Ü+¨D×,=Ñ,=Ó>ˆà ˜OÒ +Ü'ØPØŸ™×/Ñ/Ø'ôð ð ,ˆÔØÐùò;! ùò øô ò Ü'ØOØŸ™×/Ñ/Üœf ZÓ0Ó1ôðð  ð úsµCÁC#Á.C#Á5C(Ã(?D'cóÖ—|j}|jj«D�cgc]5}|dddk7r+|tj||g«k(r|t |«dzd‘Œ7c}Scc}w)z2Get names of all files in the dist-info directory.éÿÿÿÿNr_r`)r%rSrbÚ posixpathÚ commonprefixÚlen)rÚbaserhs rr+zWheelFile.dist_info_filenamesÊsw€ð×!Ñ!ˆðŸ ™ ×.Ñ.Ô0ó á0�Ø�B�Cˆy˜CÒØ”y×-Ñ-¨t°T¨lÓ;Ò;ð ”�T“˜Q‘�Ò !Ø0ñ ð ùò s©:A&r,có–—tj|j|«}|jj |«j d«S)z;Get contents, from ``filename`` in the dist-info directory.zutf-8)roÚjoinr%rSÚreadÚdecode)rr,rUs rr.zWheelFile.read_dist_infoÕs8€ä�~‰~˜d×0Ñ0°(Ó;ˆØ�}‰}×!Ñ! $Ó'×.Ñ.¨wÓ7Ð7rT)Úvalidate_contentsrwcó–— |jd«j«}t|«D�cic]}|d|“Œ }}g}|j j«D�]#}|j dddk(rŒ|j|j d«}|jtj|j|j g«k(rY|j jd«ddvr9|�6|jd |j j ›d |j ›d �«ŒÄ|€7|jd |j j ›d |j ›d �«Œýtj|Ž}|j |j›d�k(rC|j € |j"�)|jd |j j ›d�«�Œn|j � |j"€6|jd |j j ›d|j ›d�«|s�ŒÀ|j j%|«} |j'| «r�Œî|jd |j j ›d|j ›d�«�Œ&|r t |«‚ycc}w#t$r,}t d|j j ›d|›�g«|‚d}~wwxYw)a¤Validate ``RECORD`` of the wheel. This method should be called before :py:func:`install ` if validation is required. File names will always be validated against ``RECORD``. If ``validate_contents`` is true, sizes and hashes of files will also be validated against ``RECORD``. :param validate_contents: Whether to validate content integrity. ÚRECORDrz!Unable to retrieve `RECORD` from z: Nrnr_)z RECORD.p7sz RECORD.jwszIn z, digital signature file z$ is incorrectly contained in RECORD.z, z is not mentioned in RECORDz/RECORDz/, RECORD file incorrectly contains hash / size.z, hash / size of z is not included in RECORDz didn't match RECORD)r.Ú splitlinesrr8r@rSr,ÚinfolistÚpopr%rorprcÚappendr Ú from_elementsÚhash_ÚsizeruÚvalidate) rrwÚ record_linesÚrecordÚrecord_mappingÚexcrAÚitemÚ record_argsÚdatas rr0zWheelFile.validate_recordÚs²€ð Ø×.Ñ.¨xÓ8×CÑCÓEˆLä0AÀ,Ô0OóÙ0O f��q‘ ˜6Ñ!Ð0Oð ððˆà—M‘M×*Ñ*×,ˆDØ�}‰}˜R˜SÐ! SÒ(Øà(×,Ñ,¨T¯]©]¸DÓAˆKà×!Ñ!¤Y×%;Ñ%;Ø×#Ñ# T§]¡]Ð3ó&òà—-‘-×%Ñ% cÓ*¨2Ñ.Ð2NÑNàÐ*à—M‘MؘdŸm™m×4Ñ4Ð5Ð5NÈtÏ}É}Èoð^BðCôðàÐ"Ø— ‘ ؘ$Ÿ-™-×0Ñ0Ð1°°D·M±M°?ÐB]Ð^ôðä ×.Ñ.° Ð<ˆFà�}‰} 4×#5Ñ#5Ð"6°gÐ >Ò>à—<‘<Ð+¨v¯{©{Ð/Fà—M‘MؘdŸm™m×4Ñ4Ð5Ð5dÐeôñØ�|‰|Ð# v§{¡{Ð':à— ‘ ؘ$Ÿ-™-×0Ñ0Ð1Ð1BÀ4Ç=Á=À/ÐQkÐlôó!Ø—}‘}×)Ñ)¨$Ó/�Ø—‘ tÖ,Ø—M‘MؘdŸm™m×4Ñ4Ð5Ð5FÀtÇ}Á}ÀoÐUiÐjöðS-ñZ Ü+¨FÓ3Ð 3ð ùòoøôò Ü+Ø4°T·]±]×5KÑ5KÐ4LÈBÈsÈgÐVÐWóàð ûð ús'‚,J® J»JÊJÊ KÊ'KËKc#ó<K—|jd«j«}t|«}|D�cic]}|d|“Œ }}|jj «D]­}|j dddk(rŒ|j |j |j ddf«}|jdz }t|xrtj|«xr|dz«}|jj|«5}td |«} || |f–—ddd«Œ¯ycc}w#1swYŒ¿xYw­w) aSequential access to all contents of the wheel (including dist-info files). This implementation requires that every file that is a part of the wheel archive has a corresponding entry in RECORD. If they are not, an :any:`AssertionError` will be raised. ryrrnNr_ÚééIr) r.rzrrSr{r,r|Ú external_attrÚboolÚstatÚS_ISREGr]r ) rr‚Úrecordsrƒr„r†ÚmodeÚ is_executableÚstreamÚ stream_casteds rr2zWheelFile.get_contents#sèø€ð×*Ñ*¨8Ó4×?Ñ?ÓAˆ Ü# LÓ1ˆÙ:AÓB¹'°˜& ™) VÑ+¸'ˆÐBà—M‘M×*Ñ*Ö,ˆDØ�}‰}˜R˜SÐ! SÒ(Øð$×'Ñ'¨¯ © ¸¿ ¹ ÀrÈ2Ð7NÓOˆFð×%Ñ%¨Ñ+ˆDÜ  Ò!M¬$¯,©,°tÓ*<Ò!MÀÈÁÓNˆMà—‘×#Ñ# DÔ)¨VÜ $ Z°Ó 8� ؘm¨]Ð:Ò:÷*Ð)ñ-ùòC÷*Ð)üs(‚/D± D ¾B.DÃ,DÄDÄD ÄD)r3r4r5r6r@rrZr[rÚ classmethodrrr]r;r:r%rr+r.rŽr0r<r2r=r>s@rrrƒsÔø„ñð1Ðð2˜'Ÿ/™/ð2¨dõ2ð ØðÐ*ð¨x¸ Ñ/Dòóóðð ð"˜sò"óð"ðHð  T¨#¡Yò óð ð8 sð8¨só8ð <@òG4°DðG4ÀDóG4ðR;˜hÐ':Ñ;÷;r)!r6rTror�rZÚ contextlibrÚtypingrrrrrr r r Úinstaller.exceptionsr Úinstaller.recordsr rÚinstaller.utilsrrr:rŽr<Ú__all__rr7r@rIr©rrÚržs‹ðÙ/ã ÛÛ ÛÝ%ßR×RÓRå/ß<ßCà˜E # s¨C -Ñ0°(¸DÐ@ÑAÐð ˜+Ð &€÷R"ñR"ôjC  ¨NôCô  ˜J¨ô  ôz;� õz;r