+
    \i%                       R t ^ RIHt ^ RIt^ RIt^ RIHt ^ RIt]P                  '       d   ^ RI	t	^ RI
HtHt ^ RIHt ^RIHt ^RIHt RR	.tR
 R lt]P(                  ! RR7       ! R R4      4       t]P(                  ! RR7       ! R R	4      4       tR R ltR R ltR R ltR R ltR R ltR R ltR R ltR R ltR  R! ltR" R# lt R$ R% lt!R& R' lt"R# )(a  
This module focuses on reading pyproject.toml fields with error collection. It is
mostly internal, except for License and Readme classes, which are re-exported in
the top-level package.

These functions return None if an error occurred, and use the ErrorCollector to
record errors.
)annotationsN)Any)	GeneratorIterable)Requirement)ErrorCollector)ProjectTableLicenseReadmec                   V ^8  d   QhRR/# )   return	list[str] )formats   "h/home/piyush/.cache/uv/builds-v0/.tmpPfdyTF/lib/python3.14/site-packages/pyproject_metadata/pyproject.py__annotate__r   $   s           c                     \         # N)__all__r   r   r   __dir__r   $   s    Nr   T)frozenc                  0    ] tR t^(t$ RtR]R&   R]R&   RtR# )r	   z
This represents a classic license, which contains text, and optionally a
file path. Modern licenses are just SPDX identifiers, which are strings.
strtextpathlib.Path | Nonefiler   N__name__
__module____qualname____firstlineno____doc____annotations____static_attributes__r   r   r   r	   r	   (   s    
 I
r   c                  :    ] tR t^3t$ RtR]R&   R]R&   R]R&   RtR# )	r
   z_
This represents a readme, which contains text and a content type, and
optionally a file path.
r   r   r   r   content_typer   Nr   r   r   r   r
   r
   3   s    
 I
r   c                    V ^8  d   QhRRRR/# )r   valueobjectr   z
str | Noner   )r   s   "r   r   r   ?   s      f  r   c                6    \        V \        4      '       d   V # R# )z Ensure that a value is a string.N)
isinstancer   )r)   s   &r   
ensure_strr-   ?   s    %r   c                    V ^8  d   QhRRRR/# )r   valr*   r   zlist[str] | Noner   )r   s   "r   r   r   F   s     
 
V 
 0 
r   c                    V f   R# \        V \        4      '       g   R# V  F  p\        V\        4      '       d   K   R# 	  V # )z)Ensure that a value is a list of strings.N)r,   listr   r/   items   & r   ensure_listr4   F   s;    
{c4  $$$  Jr   c                    V ^8  d   QhRRRR/# )r   r/   r*   r   zdict[str, str] | Noner   )r   s   "r   r   r   S   s      V  5 r   c                    \        V \        4      '       g   R# V P                  4        F  p\        V\        4      '       d   K   R# 	  V # )z/Ensure that a value is a dictionary of strings.N)r,   dictvaluesr   r2   s   & r   ensure_dictr9   S   s9    c4  

$$$  Jr   c                    V ^8  d   QhRRRR/# )r   r/   r*   r   zlist[tuple[str, str | None]]r   )r   s   "r   r   r   ]   s     
Q 
Qv 
Q"> 
Qr   c                L   \        V \        4      '       g   . # V  FP  p\        V\        4      '       g   . u # VP                  4        F  p\        V\        4      '       d   K  . u u # 	  KR  	  V  Uu. uF%  q3P                  RR4      VP                  R4      3NK'  	  up# u upi )zNEnsure that a value is a list of tables with optional "name" and "email" keys.nameUnknownemail)r,   r1   r7   r8   r   get)r/   eachr)   entrys   &   r   ensure_peoplerB   ]   s    c4  	$%%I[[]EeS))	 #  MPPC5YYvy)599W+=>CPPPs   3+B!c               (    V ^8  d   QhRRRRRRRR/# )	r   projectr   project_dirpathlib.Patherror_collectorr   r   zLicense | str | Noner   )r   s   "r   r   r   j   s,     $ $$(4$GU$$r   c                   V P                  R4      pVf   R# \        V\        4      '       d   V# \        V\        4      '       d   \	        V4      pVf   R# MR# RpVP                  R4      pVP                  R4      pV'       d	   V'       g   V'       g   V'       g   R# V'       dV   VP                  V4      pVP                  4       '       g   RV: R2pVP                  VRR7       R# VP                  R	R
7      pVf   Q h\        Wu4      # )zGet the license field from the project table. Handles PEP 639 style license too.

None is returned if the license field is not present or if an error occurred.
licenseNr   r   zLicense file not found ()zproject.license.file)keyutf-8encoding)
r?   r,   r   r7   r9   joinpathis_fileconfig_error	read_textr	   )	rD   rE   rG   r/   _licenser   filenamer   msgs	   &&&      r   get_licenserV   j   s     ++i
 C
{#s
#ts#   $D||F#H<<DT8D##H-||~~,XL:C((2H(I~~w~/4r   c               (    V ^8  d   QhRRRRRRRR/# )	r   rD   dict[str, Any]rE   rF   rG   r   r   zlist[pathlib.Path] | Noner   )r   s   "r   r   r      s2     T TT*6TIWTTr   c                x    V P                  R4      pVf   R# \        V4      f   R# \        \        WV4      4      # )zGet the license-files list of files from the project table.

Returns None if an error occurred (including invalid globs, etc) or if
not present.
zlicense-filesN)r?   r4   r1   _get_files_from_globs)rD   rE   rG   license_filess   &&& r   get_license_filesr\      s<     KK0M=!)%k/RSSr   c               (    V ^8  d   QhRRRRRRRR/# )	r   rD   rX   rE   rF   rG   r   r   zReadme | Noner   )r   s   "r   r   r      s2     E, E,E,*6E,IWE,E,r   c                l   RV 9  d   R# RpRpRpRpV R,          p\        V\        4      '       dQ   RpTpVP                  R4      '       d   RpMVP                  R4      '       d   RpMRpVP                  VRVR	7       R# \        V\        4      '       d   V F  p	V	R9  g   K   R# 	  VP                  R
4      p
V
e   \        V
4      pVf   R# VP                  R4      pVe   \        V4      pVf   R# VP                  R4      pVe   \        V4      pVf   R# V'       d	   V'       g   V'       g   V'       g   R# V'       g   R# MR# V'       dR   VP                  V4      pVP                  4       '       g   RpVP                  VRVR	7       R# VP                  RR7      pVf   Q h\        WTV4      # )z}Get the text of the readme from the project table.

Returns None if an error occurred or if the readme field is not present.
readmeNz.mdztext/markdownz.rstz
text/x-rstz9Could not infer content type for readme file {filename!r}zproject.readme)rK   rT   content-typer   r   z$Readme file not found ({filename!r})zproject.readme.filerL   rM   )r`   r   r   )r,   r   endswithrQ   r7   r?   r-   rO   rP   rR   r
   )rD   rE   rG   rT   r   r   r'   r_   rU   fieldcontent_type_rawfilename_rawtext_raws   &&&          r   
get_readmerf      s    wH $DD#LXF&#U##*Lv&&'LMC((2BX(V	FD	!	!E<<  "::n5'%&67L#zz&)#!,/H::f%h'D|x  ##H-||~~8C((. )  ~~w~/$l++r   c                    V ^8  d   QhRRRR/# )r   rD   rX   r   zlist[Requirement]r   )r   s   "r   r   r      s      n 1B r   c                    RpV P                  R4      pVe   \        V4      pVf   . # . p VP                  R V 4       4       V#   \        P                  P
                   d    . u # i ; i)z,Get the dependencies from the project table.Ndependenciesc              3  `   "   T F$  p\         P                  P                  V4      x  K&  	  R # 5ir   )	packagingrequirementsr   ).0reqs   & r   	<genexpr>#get_dependencies.<locals>.<genexpr>   s(      
?RI""..s33?Rs   ,.)r?   r4   extendrk   rl   InvalidRequirement)rD   requirement_stringsrequirement_strings_rawrl   s   &   r   get_dependenciesru      s    ,0%kk.9*)*AB"	&(L 
?R
 	

  !!44 	s   A !A*)A*c                    V ^8  d   QhRRRR/# )r   rD   rX   r   zdict[str, list[Requirement]]r   )r   s   "r   r   r      s     # ##!#r   c                F   V P                  R4      pV'       g   / # / p\        V\        4      '       g   / # VP                  4       P	                  4        F  w  r4\        V\
        4      '       g   Q h\        V\        4      '       g   / u # . W#&   V FT  p\        V\
        4      '       g   / u u #  W#,          P                  \        P                  P                  V4      4       KV  	  K  	  \        V4      #   \        P                  P                   d
    / u u u # i ; i)z5Get the optional dependencies from the project table.zoptional-dependencies)r?   r,   r7   copyitemsr   r1   appendrk   rl   r   rr   )rD   r/   requirements_dictextrarl   rn   s   &     r   get_optional_dependenciesr}      s     ++-
.C	68c4  	"xxz//1%%%%%,--I#% Cc3''	!(//	0F0F0R0RSV0WX	    2 !"" ))<< 	s   14C88!D D c                    V ^8  d   QhRRRR/# )r   rD   rX   r   zdict[str, dict[str, str]]r   )r   s   "r   r   r     s      ^ 0I r   c                ,   V P                  R4      pVf   / # \        V\        4      '       g   / # VP                  4        FP  p\        V\        4      '       g   / u # VP                  4        F  p\        V\        4      '       d   K  / u u # 	  KR  	  V# )z+Get the entrypoints from the project table.zentry-points)r?   r,   r7   r8   r   )rD   r/   entrypoints
entrypoints   &   r   get_entrypointsr     sz    
++n
%C
{	c4  	zz|+t,,I%,,.Jj#..	 / $ Jr   c                    V ^8  d   QhRRRR/# )r   rD   rX   r   r   r   )r   s   "r   r   r   '  s     9 9 9I 9r   c                L    \        V P                  R. 4      4      ;'       g    . # )z{Get the dynamic fields from the project table.

Returns an empty list if the field is not present or if an error occurred.
dynamic)r4   r?   )rD   s   &r   get_dynamicr   '  s"    
 w{{9b1288b8r   c               (    V ^8  d   QhRRRRRRRR/# )	r   rE   rF   globszIterable[str]rG   r   r   z#Generator[pathlib.Path, None, None]r   )r   s   "r   r   r   /  s,     - --&3-FT-(-r   c              #  r  "   V F  pVP                  R4      '       d   RpVP                  VRVR7        R# V P                  V4       Uu. uF  qUP                  4       '       g   K  VNK  	  ppV'       g   RpVP                  VRVR7        R# V F  pVP	                  V 4      x  K  	  K  	  R# u upi 5i)z,Given a list of globs, get files that match.z\{glob!r} is an invalid {key} glob: the pattern must match files within the project directoryzproject.license-files)rK   globzOEvery pattern in {key} must match at least one file: {glob!r} did not match anyN)z../)
startswithrQ   r   rP   relative_to)rE   r   rG   r   rU   ffiless   &&&    r   rZ   rZ   /  s      ??;''pC((2IPT(U',,T2B2qiik2BcC((2IPT(UA--,,  
 Cs   A	B7B2'B2-A
B7)#r#   
__future__r   dataclassestypingr   packaging.requirementsrk   TYPE_CHECKINGpathlibcollections.abcr   r   r   errorsr   project_tabler   r   r   	dataclassr	   r
   r-   r4   r9   rB   rV   r\   rf   ru   r}   r   r   rZ   r   r   r   <module>r      s    #    	32&+  d#  $ d#  $

Q$NT"E,P&#4 9-r   