
    #Zja                     &   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dS )    )defaultdict)AnyDictListOptionalTypeUnion)	BaseModel
ConfigDictField	StrictStrValidationErrormodel_validator)msgschemaobjreturnc           	         	  | di | g S # t           $ r}|                                }t          t                    }|D ]c}d                    d |                    dg           D                       }||                             |                    d                     dd |                                D             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 -> c                 ,    g | ]}t          |          S  )str).0ps     Z/Users/jameslopez/projects/MentorCore/.venv/lib/python3.11/site-packages/weasel/schemas.py
<listcomp>zvalidate.<locals>.<listcomp>   s    "H"H"Ha3q66"H"H"H    locr   c                 J    g | ] \  }}d | dd                     |           !S )[z] z, )join)r   r   r   s      r   r   zvalidate.<locals>.<listcomp>   s7    IIIS+C++499S>>++IIIr   Nr   )r   errorsr   listr    getappenditems)r   r   er!   dataerrorerr_locs          r   validater*      s    	J	 J J J4   	3 	3Ekk"H"H599UB3G3G"H"H"HIIGM  5!1!12222IIDJJLLIIIIIIIIIJs   	 
CB+CCCc                   |    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	<   d
S )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__r0   r2   r   r   r   r,   r,      sr         eC'IJJJD)JJJeC'jkkkD)kkkh.DEEEFIEEEEEr   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<   dS )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)r3   r4   r5   r   r9   r   r6   r:   r   r?   r   rB   r   r   r   r8   r8   &   s         eC'HIIID)III$uT@@@C)	@@@#eD0BL_```Hhsm```"U2-CDDDKDDDDDr   r8   c                       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<   dS )ProjectConfigAssetGit.zGit repo informationr-   gitNr;   r<   r=   r?   rA   rB   )r3   r4   r5   r   rE   r,   r6   r?   r   r   rB   r   r   r   r   rD   rD   /   s         %*U36L%M%M%MC	"MMM#eD0BL_```Hhsm```',uT9O'P'P'PK)$PPPPPr   rD   c                   b   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dS )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)r3   r4   r5   r   rH   r   r6   rI   r   rJ   r   rK   rL   rM   rN   boolr   model_configr   r   r   rG   rG   7   s$        eC'8999D)999 %d2G H H HD(9
HHH#eB.UVVVFDOVVV!E",XYYYD$y/YYY$uR/QRRRGT)_RRR(-b8_(`(`(`d9o```E%'YZZZGTZZZ :D  LLLr   rG   c                      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dS )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                 f    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   sW     c!!H[    3&&HW   
r   )r3   r4   r5   r   rU   r   r   r   r6   rV   rW   r   r	   r8   rD   rX   rY   rG   r.   r   r   r   rR   r   classmethodra   r   r   r   rT   rT   H   s        !&r1_!`!`!`D$y#~
``` %b  1J  !K  !K  !KCin	  K  K  KHMbXeHfHfHfFD,.CCDEfff27%  CH  3I  3I  3IItItI./  I  I  I+05;V+W+W+WHd'(WWW 5_===E8C==== :$KLLLL_(###DcN tCH~    [ $#  r   rT   N)collectionsr   typingr   r   r   r   r   r	   pydanticr
   r   r   r   r   r   wasabir   r   r*   r,   r8   rD   rG   rT   r   r   r   <module>rg      s   # # # # # # 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^      JT)_ J4S> Jd3i J J J J,F F F F F	 F F FE E E E EI E E EQ Q Q Q QI Q Q Q    9   "    )     r   