
    ia                         d dl mZ d dlmZmZmZmZmZmZ d dl	m
Z
mZmZmZmZmZ d dlmZ dee
   deeef   dee   fdZ G d	 d
e
      Z G d de
      Z G d de
      Z G d de
      Z G d de
      Zy)    )defaultdict)AnyDictListOptionalTypeUnion)	BaseModel
ConfigDictField	StrictStrValidationErrormodel_validator)msgschemaobjreturnc                    	  | di | g S # t         $ r}|j                         }t        t              }|D ]c  }dj	                  |j                  dg       D cg c]  }t        |       nc c}w c}      }||   j                  |j                  d             e |j                         D 	cg c]  \  }}	d| ddj	                  |	        nc c}	}w c}	}cY d}~S d}~ww xY w)	zValidate data against a given pydantic schema.

    obj (Dict[str, Any]): JSON-serializable data to validate.
    schema (pydantic.BaseModel): The schema to validate against.
    RETURNS (List[str]): A list of error messages, if available.
    z -> locr   [z] z, N )	r   errorsr   listjoingetstrappenditems)
r   r   er   dataerrorperr_locr   r   s
             _/var/www/vps2.regionflexible.com/Desarrollo/venv/lib/python3.12/site-packages/weasel/schemas.pyvalidater%      s    	J	 J4  	3Ekk599UB3G"Ha3q6"H"HIGM  5!12	3 =AJJLIS!C5499S>*+IIIJs4   	 	C%AC A+*AC /!C
C C% C%c                   h    e Zd ZU  edd      Zeed<    edd      Zeed<    edd      Zeed	<   y
)ProjectConfigAssetGitItem.z URL of Git repo to download fromtitlerepozAFile path or sub-directory to download (used for sparse checkout)pathmasterzBranch to clone frombranchN)	__name__
__module____qualname__r   r*   r   __annotations__r+   r-   r       r$   r'   r'      s8    C'IJD)JC'jkD)kh.DEFIEr2   r'   c                       e Zd ZU  edd      Zeed<    edd      Zee   ed<    eddd	
      Z	ee
   ed<    edd      Zeed<   y)ProjectConfigAssetURL.zDestination of downloaded assetr(   destNzURL of asseturlMD5 hash of file([a-fA-F\d]{32})r)   patternchecksum Description of assetdescription)r.   r/   r0   r   r5   r   r1   r6   r   r;   r   r>   r   r2   r$   r4   r4   &   sU    C'HID)I$T@C)	@#D0BL_`Hhsm`"2-CDKDr2   r4   c                   v    e Zd ZU  edd      Zeed<    eddd      Zee	   ed	<    edd
      Z
ee   ed<   y)ProjectConfigAssetGit.zGit repo informationr(   gitNr7   r8   r9   r;   r=   r>   )r.   r/   r0   r   rA   r'   r1   r;   r   r   r>   r   r   r2   r$   r@   r@   /   sE    %*36L%MC	"M#D0BL_`Hhsm`',T9O'PK)$Pr2   r@   c                      e Zd ZU  edd      Zeed<    edd      Zee   ed<    eg d      Z	e
e   ed	<    eg d
      Ze
e   ed<    eg d      Ze
e   ed<    eg d      Ze
e   ed<    edd      Zeed<    edd      Zy)ProjectConfigCommand.zName of commandr(   nameNzCommand descriptionhelpz%List of CLI commands to run, in orderscriptz*File dependencies required by this commanddepsz Outputs produced by this commandoutputsz%Outputs not tracked by DVC (DVC only)outputs_no_cacheFz0Never skip this command, even if nothing changedno_skipz4A single named command specified in a project configforbid)r)   extra)r.   r/   r0   r   rD   r   r1   rE   r   rF   r   rG   rH   rI   rJ   boolr   model_configr   r2   r$   rC   rC   7   s    C'89D)9 %d2G HD(9
H#B.UVFDOV!",XYD$y/Y$R/QRGT)_R(-b8_(`d9o`%'YZGTZ DLr2   rC   c                   Z   e Zd ZU  ei d      Zeeef   ed<    ei d      Z	eeef   ed<    eg d      Z
eeeef      ed<    ei d      Zeeee   f   ed	<    eg d
      Zee   ed<    edd      Zee   ed<    ed      Z ed      edeeef   deeef   fd              Zy)ProjectConfigSchemaz,Optional variables to substitute in commandsr(   varszWOptional variable names to substitute in commands, mapped to environment variable namesenvzData assetsassetszCNamed workflows, mapped to list of project commands to run in order	workflowszProject command shortuctscommandsNzProject titler)   z%Schema for project configuration filebefore)moder   r   c                 j    d|v rt        j                  d       d|v rt        j                  d       |S )Nspacy_versionzYour project configuration file includes a `spacy_version` key, which is now deprecated. Weasel will not validate your version of spaCy.check_requirementszYour project configuration file includes a `check_requirements` key, which is now deprecated. Weasel will not validate your requirements.)r   warn)clsr   s     r$   check_legacy_keysz%ProjectConfigSchema.check_legacy_keysT   sA     c!HH[  3&HHW 
r2   )r.   r/   r0   r   rQ   r   r   r   r1   rR   rS   r   r	   r4   r@   rT   rU   rC   r)   r   r   r   rN   r   classmethodr]   r   r2   r$   rP   rP   H   s   !&r1_!`D$y#~
` %b  1J  !KCin	  KHMbXeHfFD,.CCDEf27  CH  3IItItI./  I+0;V+WHd'(W _=E8C== $KLL(#DcN tCH~   $r2   rP   N)collectionsr   typingr   r   r   r   r   r	   pydanticr
   r   r   r   r   r   wasabir   r   r%   r'   r4   r@   rC   rP   r   r2   r$   <module>rc      s    # 9 9 ^ ^ JT)_ J4S> Jd3i J,F	 FEI EQI Q9 ") r2   