Files
intellecton/venv/lib/python3.12/site-packages/packaging/__pycache__/metadata.cpython-312.pyc
T

150 lines
31 KiB
Plaintext
Raw Normal View History

Ë
jr—ãóddlmZddlZddlZddlZddlZddlZddlZddl Z ddl m
Z
m Z m Z m
Z
mZmZddlmZmZmZmZddlmZddlmZmZe j4rddlmZe j8d «Zgd
¢ZdNd ZGd d
e «Z!Gdded¬«Z"hd£Z#hd£Z$dhZ%dOdZ&dPdZ'dQdZ(iddddddddddd d!“d"d"“d#d$“d%d&“d'd(“d)d)“d*d*“d+d,“d-d.“d/d/“d0d1“d2d3“d4d5d6d7dd8d9d:d;d<d=d>d?d@dAdBœ¥Z)e)jU«Dcic]\}}||Œ
c}}Z+GdC„dDejXjZ«Z.GdE„dFej^j`«Z1dRdG„Z2e3«Z4gdH¢Z5e
dHZ6e7gdI¢«Z8GdJ„dKe e«Z9GdL„dM«Z:ycc}}w)Sé)Ú annotationsN)ÚAnyÚCallableÚGenericÚLiteralÚ TypedDictÚcasté)ÚlicensesÚ requirementsÚ
specifiersÚutils)Úversion)ÚExceptionGroupÚ_ErrorCollector)ÚNormalizedLicenseExpressionÚT)rÚInvalidMetadataÚMetadataÚ
RFC822MessageÚ RFC822PolicyÚ RawMetadataÚ parse_emailcótS©N)Ú__all__©óúU/home/antigravity/intellecton/venv/lib/python3.12/site-packages/packaging/metadata.pyÚ__dir__r (sÜ €Nrcó2eZdZUdZded< dˆfd ZˆxZS)rz'A metadata field contains invalid data.ÚstrÚfieldcó2||_t| |«yr)r#ÚsuperÚ__init__)Úselfr#ÚmessageÚ __class__s €rr&zInvalidMetadata.__init__2sø€ØˆŒ
Ü
јÕ!r)r#r"r(r"ÚreturnÚNone)Ú__name__Ú
__module__Ú __qualname__Ú__doc__Ú__annotations__r&Ú
__classcell__©r)s@rrr,sø…Ù ƒJØ"rrcóReZdZUdZded<ded<ded<ded<ded<ded <ded
<ded <ded <ded
<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded<ded <ded!<ded"<ded#<ded$<y%)&rA dictionary of raw core metadata.
Each field in core metadata maps to a key of this dictionary (when data is
provided). The key is lower-case and underscores are used instead of dashes
compared to the equivalent core metadata field. Any core metadata field that
can be specified multiple times or can hold multiple values in a single
field have a key with a plural name. See :class:`Metadata` whose attributes
match the keys of this dictionary.
Core metadata fields that can be specified multiple times are stored as a
list or dict depending on which is appropriate for the field. Any fields
which hold multiple values in a single field are stored as a list. All fields
are considered optional.
r"Úmetadata_versionÚnamerú list[str]Ú platformsÚsummaryÚ descriptionÚkeywordsÚ home_pageÚauthorÚ author_emailÚlicenseÚsupported_platformsÚ download_urlÚ classifiersÚrequiresÚprovidesÚ obsoletesÚ
maintainerÚmaintainer_emailÚ
requires_distÚ
provides_distÚobsoletes_distÚrequires_pythonÚrequires_externalúdict[str, str]Ú project_urlsÚdescription_content_typeÚprovides_extraÚdynamicÚlicense_expressionÚ
license_filesÚ import_namesÚimport_namespacesN)r,r-r.r/r0rrrrr;ñ
ð ÓØ
ƒIØ
ƒLØÓØ
ƒLØÓØÓ؃NØ ƒKØÓØ
ƒLðÓØÓØÓØÓØÓðƒOØÓØÓØÓØÓØÓØ Ó Ø Ó ðÓðÓðÓØÓðÓØ Ô rrF)Útotal>r5r<r>r8rr;rEr9r=r@rJrFr4rQrN>rPrCrBrDr7rArSrRrHrGrIrOrTrKr?rMcóf|jd«Dcgc]}|j«Œc}Scc}w)zCSplit a string of comma-separated keywords into a list of keywords.ú,)ÚsplitÚstrip)ÚdataÚks rÚ_parse_keywordsr\²s$à#Ÿz™z¨#›Ö /˜!ˆAG‰G /ùÒ /s.cóxi}|D]2}d|jd«D«\}}}||vr td«|||<Œ4|S)z?Parse a list of label/URL string pairings separated by a comma.c3ó<K|]}|j«Œy­wr)rY)Ú.0Úss rú <genexpr>z&_parse_project_urls.<locals>.<genexpr>Òsèø€Ò@ q˜ŸŸÑ@ùsrWz duplicate labels in project urls)Ú partitionÚKeyError)rZÚurlsÚpairÚlabelÚurls rÚ_parse_project_urlsri·sXà
€DØòˆñ0A¨D¯N©N¸3Ó,?Ô@‰
ˆˆq D‰=ôÐ ˆˆ ð?ðB €Krcót|t«r$|j«}t|t«sJ|S|jd¬«}t|t«sJ |j dd«S#t
$r}t
d«|d}~wwxYw)zGet the body of the message.T©ÚdecodeÚutf8Ústrictzpayload in an invalid encodingN)Ú
isinstancer"Ú get_payloadÚbytesrlÚUnicodeDecodeErrorÚ
ValueError)ÚmsgÚsourceÚpayloadÚbpayloadÚexcs rÚ _get_payloadryÞsˆô&œ#ÔØ—/#ˆÜ˜'¤3Ôˆð—?‘?¨$ܘ(¤EÔ HØ—?‘? 6¨8Ó 4øÜ HÜÐ>ÀCÐ Gûð HúsÁA,Á, BÁ5 BÂBr<z author-emailr=Ú
classifierrAr9zdescription-content-typerNz download-urlr@rPz home-pager;ú import-namerSzimport-namespacerTr:r>zlicense-expressionrQz license-filerRrEzmaintainer-emailrFúmetadata-versionr4r5rDrIr7rCrHrOrBrGrKrJr8r?r)r5rDzobsoletes-distÚplatformú project-urlrCz
provides-distzprovides-extrarBz
requires-distzrequires-externalzrequires-pythonr8zsupported-platformrcó$eZdZdZdZdZdZddZy)r
This is :class:`email.policy.EmailPolicy`, but with a simple ``header_store_parse``
implementation that handles multi-line values, and some nice defaults.
TFrcóVt|«dz}|jddd|zz«}||fS)ú
ú )ÚlenÚreplace)r'r5ÚvalueÚsizes rÚheader_store_parsezRFC822Policy.header_store_parse-s2Ü4y˜1‰}ˆØ
˜d D¨3°©:Ñ$5Ó6ˆØeˆrN)r5r"r†r"r*ztuple[str, str])r,r-r.r/rmÚ mangle_from_Úmax_line_lengthrˆrrrrr#sñð
€DØ€LØ€Oôrrcó:eZdZdZdˆfd Z d ddZˆxZS)r
This is :class:`email.message.EmailMessage` with two small changes: it defaults to
our `RFC822Policy`, and it correctly writes unicode when being called
with `bytes()`.
có6t|t«¬«y)Úpolicy)r%r&r)r'r)s €rr&zRFC822Message.__init__;sø€Ü
Ѥ £ÐÕ/rcóF|j||¬«jd«S)zi
Return the bytes representation of the message.
This handles unicode encoding.
rzutf-8)Ú as_stringÚencode)r'ÚunixfromrŽs rÚas_byteszRFC822Message.as_bytes>s"ð~‰~˜h¨vˆ6×=¸Fr)r*r+)FN)rÚboolrŽzemail.policy.Policy | Noner*rq)r,r-r.r/r&r“r1r2s@rrr4s5ø„ñõ LPðGØðGØ.HðGà ÷Grrc óúi}i}t|t«rHtjj tj
j ¬«j|«}nGtjjtj
j ¬«j|«}t|j««D}|j«}|j|«xsg}g}d}|D} t| tjjtf«sJt| tjj«r‰g}
tjj!| «D]-\} } | j#dd«d}
|
j'| |
f«Œ/|j'ttjj)|
«««ŒÜ|j'| «Œî|s|||<Œ't*j-|«}||||<ŒE|t.vrt1|«dk(r
|d||<Œe|d k(r
|d
gk(rg||<Œw|t2vr|||<Œ†|d k(r!t1|«dk(rt5|d«||<Œ¬|d k(r t7|«||<ŒÂ|||<ŒÉ t;||«}|rbd
|vr?t=d|j?d
««}|jAd
g«jC||g«nd
|vr|d
j'|«n||d
< t=d|«|fS#t$$rd}
d}YŒ›wxYw#t8$r |||<YŒnwxYw#tD$rB|jAd
g«j'|jGt|tH«¬««YŒwxYw)a
Parse a distribution's metadata stored as email headers (e.g. from ``METADATA``).
This function returns a two-item tuple of dicts. The first dict is of
recognized fields from the core metadata specification. Fields that can be
parsed and translated into Python's built-in types are converted
appropriately. All other fields are left as-is. Fields that are allowed to
appear multiple times are stored as lists.
The second dict contains all other fields from the metadata. This includes
any unrecognized fields. It also includes any fields which are expected to
be parsed into a built-in type but were not formatted appropriately. Finally,
any fields that are expected to appear only once but are repeated are
included in this dict.
rTrmrnÚlatin1Fr
rrSÚr:rMr9r"rkr)%ror"ÚemailÚparserÚParserrŽÚcompat32ÚparsestrÚ BytesParserÚ
parsebytesÚ frozensetÚkeysÚlowerÚget_allÚheaderÚHeaderÚ
decode_headerrlrrÚappendÚ make_headerÚ_EMAIL_TO_RAW_MAPPINGÚgetÚ_STRING_FIELDSr„Ú _LIST_FIELDSr\rircryr ÚpopÚ
setdefaultÚextendrsrprq)rZÚrawÚunparsedÚparsedÚname_with_caser5Úheadersr†Úvalid_encodingÚchunksÚbinaryÚ _encodingÚencodingÚraw_namervÚdescription_headers rrrIsoð 8:€CØ%'€HäÔÜ×$¬E¯L©L×,AÑ,AÐKÈDÓQ‰ä×·±×1FÑ1FÐRÐSWÓXˆô
$ F§K¡K£MÓyð×ð
—.. Ó,¨"ˆðˆðˆØò# ˆAô˜a¤%§,¡,×"5Ñ"5´sÐ!;Ô ˜!œUŸ\™\×:<Ü).¯©×)CÑ)CÀAÓ)Fò %F˜Ÿ
 f¨hÔ $*˜Ø—MM 6¨8Ð"4Õ  œS¤§¡×!9Ñ!9¸&Ó!AÓ ˜Q•ðG# ñPØ"ˆHT‰NÙ ä,¨TÓØ Ð ð#ˆHT‰NÙ ð ”~Ñ %¬#¨e«*¸ª/Ø! !™HˆC‹Mð˜Ò
'¨E°b°TªM؈CœÑ
!ˆC ˜Ò
¨E«
°aªÜ+¨E°!©HÓ5ˆC‹Mð˜Ò

'Ü 3°EÓ :H“
ð #ˆHTNðsy#ð~˜v tÓ,ˆñ ð Ñ#Ü%)¨%°·±¸Ó1GÓ%HÐ×# M°2Ó6×Ðð ˜Ñ'×.¨wÕ7à%, 
˜ #  -øô[/à#+˜Ø).›ð/ûôTò
'Ø!&˜ð
'ûô ò
Ø×јM¨2Ó × Ñ ¤j°´uÓ&=Ð Ó 
ð
ús7Å'LÉ/LÊ L/Ì
L ÌL ÌL,Ì+L,Ì/AM:Í9M:)ú1.0ú1.1ú1.2ú2.1ú2.2z2.3ú2.4ú2.5)r4r5rcóÞeZdZUdZded<ded<ded<ddœ dd „Zdd
Zdd Z d dd
ZddZ d dZ
d!dZ d dZ d dZ
d"dZ d#dZd$dZ d%dZd&dZd"dZd"dZeZy )'Ú
_ValidatoravValidate a metadata field.
All _process_*() methods correspond to a core metadata field. The method is
called with the field's raw value. If the raw value is valid it is returned
in its "enriched" form (e.g. ``version.Version`` for the ``Version`` field).
If the raw value is invalid, :exc:`InvalidMetadata` is raised (with a cause
as appropriate).
r"r5Ú_MetadataVersionÚaddedr¼©có||_yr)r's rr&z_Validator.__init__s ð
ˆ
rcó.||_t||_yr)r5Ú_RAW_TO_EMAIL_MAPPINGrº)r'Ú_ownerr5s rÚ __set_name__z_Validator.__set_name__s؈Œ Ü-¨dÑ
rcór|j}|jj|j«}|jtvs|" t |d|j«}||«}|||j< |j|j=td|«S#t $rYŒ>wxYw#t$rYŒ&wxYw)NÚ _process_r) Ú__dict__Ú_rawr©r5Ú_REQUIRED_ATTRSÚgetattrÚAttributeErrorrcr )r'ÚinstancerËÚcacher†Ú converters rÚ__get__z_Validator.__get__!ðר
×! $§)¡)Ó,ˆð 9‰9œÑ '¨5Ð+<ð
)Ü07¸À È$Ï)É)ÈÐ>UÓ0V ñ" (à ˆˆdi‰iÑð Ø
˜dŸi™iÐÓÐøô
Ùð
ûôò Ù ð ús$ÁBÁ8B*Â B'Â&B'Â* B6Â5B6Nc óˆt|j|jdt|j«i««}||_|S)Nr#)rÚ
format_mapÚreprÚ __cause__)r'rtÚcauserxs rÚ_invalid_metadataz_Validator._invalid_metadata<s<ôØ M‰M˜3Ÿ>™>¨7´D¸¿¹Ó4GÐ*HÓ
ˆðˆŒ
؈
rcóR|tvr|j|d«td|«S)Nz is not a valid metadata versionrÅ)Ú_VALID_METADATA_VERSIONSrÝr ©r'r†s rÚ_process_metadata_versionz$_Validator._process_metadata_versionEs2à Ô ×(¨E¨9Ð4TÐ)UÓ ÐÓ.rcóÀ|s|jd« tj|d¬«|S#tj$r}|j|d|¬«|d}~wwxYw){field} is a required fieldT©Úvalidateú is invalid for {field}©)rÚcanonicalize_nameÚ InvalidName©r'r†rxs rÚ
_process_namez_Validator._process_nameKssÙØ×(Ð)FÓ  Ü × # E°DÕ ˆLøô × Ñ ò Ø×5¸Sðàð
ûð ús.®AÁAÁAcó¸|s|jd« tj|«S#tj$r}|j|d|¬«|d}~wwxYw)Nrã)Úversion_moduleÚparseÚInvalidVersionrês rÚ_process_versionz_Validator._process_versionXskÙØ×(Ð)FÓ  Ü!×Ó .øÜ× Ø×5¸Sðàð
ûð ús*ªA½AÁAcó0d|vr|jd«|S)z%Check the field contains no newlines.rz{field} must be a single line)s rÚ_process_summaryz_Validator._process_summarybs à 5‰=Ø×(Ð)HÓ ˆ rcóîhd£}tjj«}||d<|j«j «|dj