+
    –°³j³$  ã                   óô  € R t ^ RIt^ RIt^ RIHt ^ RIHt ^ RIHtH	t	H
t
 ^ RIHt ^ RIHt ^ RIHt ^ RIt^ RIHt ^ R	IHt ^ R
IHtHt ]P2                  ! R4      tRt] ! R R4      4       t];QJ d    . R ]
! ]4       4       F  NK  	  5M! R ]
! ]4       4       4      t] ! R R4      4       t]R R l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# )(z¡Read launch defaults from a UV script's optional `[tool.hf-jobs]` PEP 723 table.

See the CLI guide for the header format and `cli/jobs.py` for the merge rules.
N)Ú	Generator)Úcontextmanager)Ú	dataclassÚfieldÚfields)ÚPath)ÚAny)Úurlsplit)Ú	constants)ÚCLIError)ÚSoftTemporaryDirectoryÚget_sessionzG(?m)^# /// (?P<type>[a-zA-Z0-9-]+)$\s(?P<content>(^#(| .*)$\s)+)^# ///$ztool.hf-jobsc                   ó¦   a € ] tR t^)t o RtRtRtRtRtRt	Rt
Rt]! ]R7      t]! ]R7      t]! ]R7      t]! ]R7      t]! ]R7      tV 3R ltRtV tR# )ÚUvScriptHeaderzWThe `[tool.hf-jobs]` table of a UV script: the launch configuration the script carries.N)Údefault_factoryc                óh  <€ V ^8„  d   Qh/ S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[ R,          ;R&   S[S[ S[ 3,          ;R	&   S[S[ ,          ;R
&   S[S[ S[ 3,          ;R&   S[S[ ,          ;R&   S[S[ ,          ;R&   # )é   NÚimageÚflavorÚpythonÚtimeoutÚnameÚ	namespaceÚnetwork_groupÚenvÚsecretsÚlabelsÚvolumesÚnetwork_aliases)ÚstrÚdictÚlist)ÚformatÚ__classdict__s   "€Úf/home/luca/screen-checking/.venv/lib/python3.14/site-packages/huggingface_hub/cli/_uv_script_header.pyÚ__annotate__ÚUvScriptHeader.__annotate__)   sÙ   ø‡ ‚ ñ ��:Ññ	 ñ
 �$�JÑñ ñ �$�JÑñ ñ �4�ZÑñ ñ ��*Ññ ñ �T�zÑ ñ ñ ˜•:Ñ$ñ ñ 
‰c‘3ˆh�Ñ5ñ ñ ‘#�YÑ4ñ ñ ‘‘c��NÑ8ñ ñ ‘#�YÑ4ñ ñ ™#•YÑ<ò ó    © )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r   r   r   r   r   r   r    r   r!   r   r   r   r   Ú__annotate_func__Ú__static_attributes__Ú__classdictcell__©r#   s   @r$   r   r   )   sd   ø‡ € áaà€EØ€FØ€FØ€GØ€DØ €IØ $€MÙ°Ô5€CÙ¨tÔ4€GÙ"°4Ô8€FÙ¨tÔ4€GÙ!&°tÔ!<€O÷ ƒ r'   r   c              #   ó8   "  € T F  qP                   x € K  	  R # 5i©N)r   )Ú.0Úfs   & r$   Ú	<genexpr>r6   ;   s   é € Ð:Ñ#9˜a—6–6Ó#9ùó   ‚c                   ó8   a € ] tR t^>t o Rt Rt V 3R ltRtV tR# )ÚUvScriptzNA UV script ready to be submitted, with the launch config it carries (if any).Nc                ó@   <€ V ^8„  d   Qh/ S[ ;R&   S[R,          ;R&   # )r   ÚscriptNÚheader©r   r   )r"   r#   s   "€r$   r%   ÚUvScript.__annotate__>   s#   ø‡ ‚ ñ �Kñ	 ñ ˜TÕ!Ñ(ò r'   r(   )	r)   r*   r+   r,   r-   r<   r.   r/   r0   r1   s   @r$   r9   r9   >   s   ø‡ € áXð jà$(€FØJ÷ ƒ r'   r9   c                óL   € V ^8„  d   QhR\         R\        \        RR3,          /# )r   r;   ÚreturnN)r   r   r9   )r"   s   "r$   r%   r%   J   s&   € ÷ "ñ "œ3ð "¤9¬X°t¸TÐ-AÕ#Bñ "r'   c              #  óà  "  € V P                  R4      '       df   \        RR7      ;_uu_ 4       p\        V \        V4      4      p\	        \        V4      \        VP                  RR7      4      R7      x € RRR4       R# \        V 4      pVP                  4       '       d+   \	        V \        VP                  RR7      4      R7      x € R# \	        V R7      x € R#   + '       g   i     R# ; i5i)	ak  Resolve a `hf jobs uv run` script argument and read its `[tool.hf-jobs]` header.

- a local file is read in place
- an `http(s)` URL is downloaded to a temporary directory and from there shipped to the Job like
  any local script: the URL is fetched exactly once, at submit time, instead of being fetched
  again by the container (the header has to be read client-side anyway, since `image`, `flavor`,
  `secrets`, ... are all decided before the container exists). The download lives until the
  `with` block exits, i.e. until the Job is submitted.
- anything else is a command (e.g. `lighteval`) and carries no header
zhf-jobs-uv-)Úprefixzutf-8)Úencoding)r;   r<   N)r;   )zhttp://zhttps://)	Ú
startswithr   Ú_download_scriptr   r9   r   Úparse_uv_script_headerÚ	read_textÚis_file)r;   Útmp_dirÚ
local_pathÚpaths   &   r$   Úload_uv_scriptrL   I   s¹   é € ð ×ÑÐ0×1Ò1Ü#¨=×9Õ9¸WÜ)¨&´$°w³-Ó@ˆJÜÜ˜:“Ô/EÀj×FZÑFZÐdkÐFZÓFlÓ/môò ÷ :ñ
 	Ü�‹<€DØ‡|�|‡~‚~Ü˜fÔ-CÀDÇNÁNÐ\cÀNÓDdÓ-eÔfÒfÙÜ
˜&Ô
!Ô!÷ :Ö9ñ
 	üs   ‚,C.®ACÁ5A%C.ÃC+	Ã%	C.c                ó>   € V ^8„  d   QhR\         R\        R,          /# ©r   Útextr@   Nr=   )r"   s   "r$   r%   r%   e   s   € ÷ ñ ¤ð ¬¸$Õ)>ñ r'   c                óÄ  € \        V 4      pVe   RV9  d   R# \        V4      P                  R/ 4      P                  R4      pVf   R# \        V\        4      '       g   \        R\         R\         R24      h\        R V 4       4      ;p'       dC   \        RR	P                  R
 V 4       4       R\         RR	P                  \        4       R24      h\        \        VR4      \        VR4      \        VR4      \        V4      \        VR4      \        VR4      \        VR4      \        VR4      \        V4      \        VR4      \        VR4      \        VR4      R7      # )z\Parse the `[tool.hf-jobs]` table out of a script's PEP 723 header. Returns `None` if absent.Nzhf-jobsÚtoolÚ'z9' must be a table in the script's PEP 723 header (i.e. `[z]`).c              3   ó>   "  € T F  q\         9  g   K  Vx € K  	  R # 5ir3   )Ú
VALID_KEYS©r4   Úkeys   & r$   r6   Ú)parse_uv_script_header.<locals>.<genexpr>q   s   é € ÐG© ¼JÑ1FŸš«ùs   ‚“
zUnknown key(s) z, c              3   ó8   "  € T F  p\        V4      x € K  	  R # 5ir3   )ÚreprrU   s   & r$   r6   rW   s   s   é € Ð'E¹W°c¬¨S¯	¨	»Wùr7   z in the script's [z] table. Valid keys are: Ú.r   r   r   r   r   r   r   r   r   r   )r   r   r   r   r   r   r   r   r   r   r   r   )Ú_extract_pep_723_blockÚ
_load_tomlÚgetÚ
isinstancer    r   Ú
TABLE_NAMEÚsortedÚjoinrT   r   Ú_as_strÚ_as_timeoutÚ_as_str_tableÚ_as_secret_namesÚ_as_str_list)rO   ÚcontentÚtableÚunknowns   &   r$   rF   rF   e   sS  € ä$ TÓ*€Gà‚˜)¨7Ô2ÙÜ�wÓ×#Ñ# F¨BÓ/×3Ñ3°IÓ>€EØ‚}ÙÜ�eœT×"Ò"Ü˜œ:˜,Ð&_Ô`jÐ_kÐkoÐpÓqÐqäÑG©ÓGÓGÐG€wÖGÜØ˜dŸi™iÑ'E¹WÓ'EÓEÐFÐFXÔYcÐXdð e Ø $§	¡	¬*Ó 5Ð6°að9ó
ð 	
ô Ü�e˜WÓ%Ü�u˜hÓ'Ü�u˜hÓ'Ü˜EÓ"Ü�U˜FÓ#Ü˜% Ó-Ü˜e _Ó5Ü˜% Ó'Ü  Ó'Ü˜U HÓ-Ü˜U IÓ.Ü$ UÐ,=Ó>ôð r'   c                ó<   € V ^8„  d   QhR\         R\        R\        /# )r   ÚurlÚdest_dirr@   )r   r   )r"   s   "r$   r%   r%   †   s!   € ÷ ñ œ#ð ¬ð ´$ñ r'   c                ó   € \        \        V 4      P                  4      P                  pYP	                  R4      '       d   TMR,          p \        4       P                  V \        P                  R7      pVP                  4        TP                  TP                  4       T#   \        P                   d   p\        RT  RT 24      ThRp?ii ; i)zFDownload a remote UV script into `dest_dir` and return its local path.z.pyz	script.py)r   z'Could not download the UV script from 'z': N)r   r	   rK   r   Úendswithr   r]   r
   ÚDEFAULT_REQUEST_TIMEOUTÚraise_for_statusÚhttpxÚ	HTTPErrorr   Úwrite_bytesrg   )rk   rl   r   rJ   ÚresponseÚes   &&    r$   rE   rE   †   s³   € ä”˜“×"Ñ"Ó#×(Ñ(€DØ§]¡]°5×%9Ò%9™T¸{ÕK€JðUä“=×$Ñ$ S´)×2SÑ2SÐ$ÓTˆØ×!Ñ!Ô#ð ×Ñ˜8×+Ñ+Ô,ØÐøô �?‰?ô UÜÐ@ÀÀÀSÈÈÐLÓMÐSTÐTûðUús   Á9B! Â!CÂ6CÃCc                ó>   € V ^8„  d   QhR\         R\         R,          /# rN   )r   )r"   s   "r$   r%   r%   ”   s   € ÷ ñ ¤ð ¬¨t­ñ r'   c                ó   € V P                  RR4      P                  RR4      p \        P                  V 4       FR  pVP                  R4      R8X  g   K  RP	                  R VP                  R4      P                  R	R
7       4       4      u # 	  R# )zXReturn the content of the first PEP 723 `script` block, with the `# ` prefixes stripped.z
Ú
ÚÚtyper;   Ú c              3   ót   "  € T F.  pVP                  R 4      '       d
   VR,          MVR,          x € K0  	  R# 5i)z# :r   NN:é   NNN)rD   )r4   Úlines   & r$   r6   Ú)_extract_pep_723_block.<locals>.<genexpr>›   s2   é € ð áL�Dð !ŸO™O¨D×1Ò1��R–°t¸BµxÔ?ÛLùs   ‚8ž8rg   T)ÚkeependsN)ÚreplaceÚ_PEP_723_REGEXÚfinditerÚgroupra   Ú
splitlines)rO   Úmatchs   & r$   r[   r[   ”   s�   € ð �<‰<˜ Ó%×-Ñ-¨d°DÓ9€DÜ×(Ñ(¨Ö.ˆØ�;‰;�vÓ (Ö*Ø—7‘7ñ à!ŸK™K¨	Ó2×=Ñ=ÀtÐ=ÔLóó ò ñ /ñ r'   c                óR   € V ^8„  d   QhR\         R\        \         \        3,          /# )r   rg   r@   )r   r    r   )r"   s   "r$   r%   r%   ¢   s&   € ÷ Sñ Sœð S¤¤S¬# X¥ñ Sr'   c                 ó  € \         P                  R8¼  d   ^ RIpM ^ RIp VP                  V 4      #   \         d   p\        R\         R24      ThRp?ii ; i  TP                   d   p\        RT 24      ThRp?ii ; i)é   NzReading the [zo] table of a UV script requires a TOML parser. Upgrade to Python 3.11+ or install one with `pip install tomli`.z-Invalid TOML in the script's PEP 723 header: )r‰   é   )	ÚsysÚversion_infoÚtomllibÚtomliÚImportErrorr   r_   ÚloadsÚTOMLDecodeError)rg   r�   ru   s   &  r$   r\   r\   ¢   s–   € Ü
×Ñ˜7Ô"Üð	Û#ðSØ�}‰}˜WÓ%Ð%øô ô 	ÜØ¤
˜|ð ,Tð Tóð ðûð	ûð ×"Ñ"ô SÜÐFÀqÀcÐJÓKÐQRÐRûðSús+   œ2 ¡A ²A½AÁAÁA>Á*A9Á9A>c                óH   € V ^8„  d   QhR\         R\        R\         R\        /# )r   rV   ÚvalueÚexpectedr@   )r   r   r   )r"   s   "r$   r%   r%   ³   s.   € ÷ iñ i”Sð i¤ð i´ð i¼ñ ir'   c                 ó<   € \        R V  R\         RV RV: R2	4      # )rR   z' in the script's [z] table must be z, got: rZ   )r   r_   )rV   r“   r”   s   &&&r$   Ú_type_errorr–   ³   s.   € Ü�a˜�uÐ/´
¨|Ð;KÈHÈ:ÐU\Ð]bÑ\eÐefÐgÓhÐhr'   c                ól   € V ^8„  d   QhR\         \        \        3,          R\        R\        R,          /# )r   rh   rV   r@   N©r    r   r   )r"   s   "r$   r%   r%   ·   s-   € ÷ ñ ”4œœS˜•>ð ¬ð ´°dµ
ñ r'   c                 óx   € V P                  V4      pVf   R # \        V\        4      '       g   \        WR4      hV# )Núa string)r]   r^   r   r–   ©rh   rV   r“   s   && r$   rb   rb   ·   s6   € Ø�I‰I�c‹N€EØ‚}ÙÜ�eœS×!Ò!Ü˜# jÓ1Ð1Ø€Lr'   c                ó`   € V ^8„  d   QhR\         \        \        3,          R\        R,          /# )r   rh   r@   Nr˜   )r"   s   "r$   r%   r%   À   s&   € ÷ ñ ”tœC¤˜H•~ð ¬#°­*ñ r'   c                 óÄ   € V P                  R 4      pVf   R# \        V\        4      '       g   \        V\        \        34      '       g   \        R VR4      h\        V4      # )r   Nz5a duration string (e.g. "30m") or a number of seconds)r]   r^   Úboolr   Úintr–   )rh   r“   s   & r$   rc   rc   À   sO   € Ø�I‰I�iÓ €EØ‚}ÙÜ�%œ×Ò¤j°¼¼c¸
×&CÒ&CÜ˜) UÐ,cÓdÐdÜˆu‹:Ðr'   c                ó€   € V ^8„  d   QhR\         \        \        3,          R\        R\         \        \        3,          /# ©r   rh   rV   r@   r˜   )r"   s   "r$   r%   r%   É   s1   € ÷ 
ñ 
œœc¤3˜h�ð 
¬cð 
´d¼3Ä¸8µnñ 
r'   c                 óú   € V P                  V4      pVf   / # \        V\        4      '       g   \        WR4      hVP	                  4        F-  w  r4\        V\
        4      '       d   K  \        V RV 2VR4      h	  V# )Nza table of stringsrZ   rš   )r]   r^   r    r–   Úitemsr   )rh   rV   r“   r   Úitems   &&   r$   rd   rd   É   ss   € Ø�I‰I�c‹N€EØ‚}Øˆ	Ü�eœT×"Ò"Ü˜#Ð&:Ó;Ð;Ø—k‘k–m‰
ˆä˜$¤×$Ô$Ü   Q t f˜o¨t°ZÓ@Ð@ñ $ð €Lr'   c                ót   € V ^8„  d   QhR\         \        \        3,          R\        R\        \        ,          /# r¡   ©r    r   r   r!   )r"   s   "r$   r%   r%   Ö   s-   € ÷ ñ œœS¤#˜X�ð ¬Sð ´T¼#µYñ r'   c                 óì   € V P                  V4      pVf   . # \        V\        4      '       d;   \        ;QJ d    R V 4       F  '       g   K   RM	  RM! R V 4       4      '       d   \	        WR4      hV# )Nc              3   óL   "  € T F  p\        V\        4      '       * x € K  	  R # 5ir3   )r^   r   )r4   r¤   s   & r$   r6   Ú_as_str_list.<locals>.<genexpr>Ú   s   é € Ð)VÑPUÈ¬j¸¼sÓ.C×*CÑ*CÓPUùs   ‚"$TFza list of strings)r]   r^   r!   Úanyr–   r›   s   && r$   rf   rf   Ö   s[   € Ø�I‰I�c‹N€EØ‚}Øˆ	Ü�eœT×"Ò"§c£cÑ)VÑPUÓ)V§c§c¢cÑ)VÑPUÓ)V×&VÒ&VÜ˜#Ð&9Ó:Ð:Ø€Lr'   c                óh   € V ^8„  d   QhR\         \        \        3,          R\        \        ,          /# )r   rh   r@   r¦   )r"   s   "r$   r%   r%   ß   s&   € ÷ *ñ *œD¤¤c �Nð *¬t´C­yñ *r'   c                 óŠ   € \        V P                  R 4      \        4      '       d   \        R\         R24      h\        V R 4      # )r   z'secrets' in the script's [z¸] table must be a list of names (e.g. `secrets = ["HF_TOKEN"]`), not a table: scripts travel publicly, so secret values are always read from the environment of whoever runs the script.)r^   r]   r    r   r_   rf   )rh   s   &r$   re   re   ß   sE   € Ü�%—)‘)˜IÓ&¬×-Ò-ÜØ)¬*¨ð 6(ð (ó
ð 	
ô
 ˜˜yÓ)Ð)r'   )+r-   Úrer‹   Úcollections.abcr   Ú
contextlibr   Údataclassesr   r   r   Úpathlibr   Útypingr   Úurllib.parser	   rq   Úhuggingface_hubr
   Úhuggingface_hub.errorsr   Úhuggingface_hub.utilsr   r   Úcompiler‚   r_   r   ÚtuplerT   r9   rL   rF   rE   r[   r\   r–   rb   rc   rd   rf   re   r(   r'   r$   Ú<module>r¹      sñ   ðñó
 
Û 
Ý %Ý %ß 0Ñ 0Ý Ý Ý !ã å %Ý +ß Eð —’ÐfÓg€à€
ð ÷=ð =ó ð=÷" ˆUÑ:¡6¨.Ô#9Ó:�U‰UÑ:¡6¨.Ô#9Ó:Ó:€
ð ÷Kð Kó ðKð ô"ó ð"õ6õBõõSõ"iõõõ
õ÷*r'   