
    G@dIA                        d Z ddlZddlmZ ddlZddlmZmZm	Z	m
Z
 ddlmZ  ej         ej        e                    ZdZdZdZdZd	Zd
ZdZdZdZ e            rdndZdZdZdZdZdZdZ dZ!dZ"dZ#dZ$dZ%dZ&dZ'dZ(dZ)dZ*d	Z+dZ,d Z-d!Z.d"Z/d#Z0d$Z1d%Z2d&Z3d'Z4d(Z5d)Z6d*Z7d+Z8d,Z9 e            rdnd-Z:d.Z;d/Z<d0Z=d1Z>d2Z?d3Z@g d4d4 ed5          eejA        d6k    o
 e
             d7d8d8 ed9          ed:d;d; ed<          ed:d=d= ed>          ed:d?d? ed@          ed:dAdB edC          ed:dDdD edE          ed:dFdF edG          ed:dHdH edI          ed:dJdJ edK          ed:dLdL edM          ed:dNdN edO          ed:dPdP edQ          e d:dRdR edS          e!d:dTdT edU          e"ejB        dVk    d7dWdW edX          e#d:dYdY edZ          e$d:d[d[ ed\          e%d:d]d] ed^          e&d:d_d_ ed`          e'd:dada edb          e(d:dcdd ede          e)d:dfdg edh          e*d:didj edk          e+d:dldm edn          e,d:dodp edq          e-ejA        C                    dr          d7dsdt edu          e.d:dvdv edw          e/d:dxdx edy          e0d:dzdz ed{          e1d:d|d| ed}          e2d:d~d~ ed          e3d:dd ed          e4d:dd ed          e5d:dd ed          e6d:dd ed          e7d:dd ed          e8d:dd ed          e9d:dd ed          e:d:ZDeDdd ed          e;eddd ed          e<eddd ed          e=eddd ed          e>eddd ed          e?eddd ed          e@edgz  ZD G d deE          ZFg aGdefdZHd ZIt          ejJ        fdZKd ZLd ZMdS )z+Module checking Spyder runtime dependencies    N)_
is_pynsistrunning_in_cirunning_in_mac_app)programs	mandatoryoptionalzspyder pluginsz>=0.3.0z>=1.2.0z>=2.0.0z>=0.5.0z>=1.6.0z
>=20181111z>=3.0.2z(>=7.31.1,<9.0.0,!=8.8.0,!=8.9.0,!=8.10.0z>=0.17.2,<0.19.0z>=0.7z>=3.2.0z>=17.0.0z>=4.0z>=0.6.0z>=2.4.0z>=0.7.0,<0.9.0z>=4.4.0z>=0.4z>=5.3z>=2.0z>=2.5.0,<3.0z>=2.1.1z>=1.7.2,<1.8.0z>=0.4.0z>=0.26z>=22.1.0z>=3.0.2,<3.2.0z>=0.2.2z>=1.2.1z>=5.4.2,<5.5.0z>=2.1.0z>=0.9.7z>=49.6.0z>=0.6.6z>=2.4.3,<2.5.0z>=4.2.0z>=0.1.1z>=0.10.3z>=0.21z>=3.0.0z>=1.7z>=1.1.1z>=0.17.0z>=0.7.3applaunchservicesz.Notify macOS that Spyder can open Python filesdarwin)modnamepackage_namefeaturesrequired_versiondisplayatomicwritesz Atomic file writes in the Editor)r   r   r   r   chardetz0Character encoding auto-detection for the Editorcloudpicklez1Handle communications between kernel and frontendcookiecutterz+Create projects from cookiecutter templatesdiff_match_patchzdiff-match-patchz-Compute text file diff changes during editionintervaltreez$Compute folding range nesting levelsIPythonz&IPython interactive python environmentjediz+Main backend for the Python Language Server	jellyfishzOptimize algorithms for folding
jsonschemaz"Verify if snippets files are validkeyringz:Save Github credentials to report internal errors securely	nbconvertz*Manipulate Jupyter notebooks in the Editornumpydocz=Improve code completion for objects that use Numpy docstringsparamikoz%Connect to remote kernels through SSHntparsozAPython parser that supports error recovery and round-trip parsingpexpectz,Stdio support for our language server clientpicklesharez*Cache the list of installed Python modulespsutilz+CPU and memory usage info in the status barpygmentsz9Syntax highlighting for a lot of file types in the EditorpylintzStatic code analysispylint_venvzpylint-venvzDUse the same Pylint installation with different virtual environmentspylspzpython-lsp-serverz*Code completion and linting for the Editorpylsp_blackzpython-lsp-blackz<Autoformat Python files in the Editor with the Black packagepyls_spyderzpyls-spyderz'Spyder plugin for the Python LSP ServerxdgpyxdgzParse desktop files on Linuxlinuxzmqpyzmqz-Client for the language server protocol (LSP)
qdarkstylez#Dark style for the entire interface	qstylizerzCustomize Qt stylesheets	qtawesomez9Icon theme based on FontAwesome and Material Design icons	qtconsolez$Main package for the IPython consoleqtpyz)Abstraction layer for Python Qt bindings.rtreez$Fast access to code snippets regions
setuptoolszDetermine package versionsphinxzDShow help for objects in the Editor and Consoles in a dedicated panespyder_kernelszspyder-kernelsz&Jupyter kernels for the Spyder consoletextdistancez!Compute distances between stringsthree_mergezthree-mergez/3-way merge algorithm to merge document changeswatchdogz)Watch file changes on project directoriescythonz'Run Cython files in the IPython Console)r   r   r   r   kind
matplotlibz%2D/3D plotting in the IPython consolenumpyzGView and edit two and three dimensional arrays in the Variable Explorerpandasz<View and edit DataFrames and Series in the Variable Explorerscipyz6Import Matlab workspace files in the Variable Explorersympyz+Symbolic mathematics in the IPython Consolec                   8    e Zd ZdZdZdZdefdZd Zd Z	d Z
dS )	
Dependencyz
    Spyder's dependency

    Version may starts with =, >=, > or < to specify the exact requirement;
    multiple conditions may be separated by ',' (e.g. '>=0.13,<1.0')OKNOKNc                 T   || _         || _        || _        || _        || _        | j                            dd          | _        |[	 t          j        |          | _	        | j	        s t          j
        | j                  | _	        d S d S # t          $ r d | _	        Y d S w xY w|| _	        d S )N-r   )r   r   r   r   r<   replacedistribution_namer   get_module_versioninstalled_versionget_package_version	Exception)selfr   r   r   r   rK   r<   s          3lib/python3.11/site-packages/spyder/dependencies.py__init__zDependency.__init__4  s    (  0	 "&!2!:!:3!D!D$.)1)DW)M)M&- 0 .6-I..0 .0D***	0 0  . . . *.&&&&	. &7D"""s   >B	 	BBc                 d    | j         r(t          j        | j        | j         | j                  }|S dS )z Check if dependency is installed)rI   T)r   r   is_module_installedr   rI   )rN   	installeds     rO   checkzDependency.checkU  sB      	 4%"&"8  I
 4    c                 r    |                                  r| j        d| j        dS | j        d| j        dS )!Return dependency status (string)z ())rT   rK   rD   rE   rN   s    rO   get_installed_versionz Dependency.get_installed_versiona  sG    ::<< 	B $ 6 6 6@@ $ 6 6 6AArU   c                 F    |                                  r| j        S | j        S )rW   )rT   rD   rE   rY   s    rO   
get_statuszDependency.get_statush  s     ::<< 	7N8OrU   )__name__
__module____qualname____doc__rD   rE   	MANDATORYrP   rT   rZ   r\    rU   rO   rC   rC   *  sx        H H 
B
C $(i7 7 7 7B
 
 
B B B    rU   rC   c           	          t           D ]2}t                      rd| v r|j        | k    rt          d|            3t           t	          | |||||          gz  a dS )zAdd Spyder dependencyspyder_boilerplatez(Dependency has already been registered: N)DEPENDENCIESr   r   
ValueErrorrC   )r   r   r   r   rK   r<   
dependencys          rO   addrh   s  s     # F F
?? 	3w>>((D7DDF F F ) Zx 0 149 9 : :LLLrU   c                 |    t           D ]#}|j        | k    r|                                c S $t          d| z            )z)Check if required dependency is installedzUnknown dependency %s)re   r   rT   RuntimeError)r   rg   s     rO   rT   rT     sR    " > >
((##%%%%% ) 2W<===rU   c                    d}g }| D ]}|j         }|j        |d|j        z   z  }t          |t          |          g          }t          dt
          dt          di}t          t
          t          d}|                    ||j                 ||	                                g           |dz  }d	}d
}	t          |d           D ]}\  }
}}|
|	k    rR||
         }|t          k    r|d|                                 d| z  }n|| d|                                 d| z  }|
}	||                    |           d| | z  }~|dk    s
|dd         }|S )z Return a status of dependencies.r   N 012)rm   rn   ro       z-1c                 H    | d         | d                                          z   S )Nr   rp   )lower)xs    rO   <lambda>zstatus.<locals>.<lambda>  s    !qtzz|| 3 rU   )keyz# :z:  <br>)r   r   maxlenra   OPTIONALPLUGINappendr<   rZ   sorted
capitalizeljust)depslinesepmaxwidthdatadeptitle	dep_order	order_deptext
prev_orderorderversionnames                rO   statusr     s   HD  O O+S3///E#e**-..XsFC@	#(@@	Ysx(%1J1J1L1LMNNNN MHDJ!'33"5 "5 "5 
@ 
@ugJU#Dy  :T__..:::::7CCdoo&7&7CC'CCCJ5;;x((??W?g??? fCRCyKrU   c                      g } t           D ];}|j        t          k    r)|                                s|                     |           <| rt          | d          S dS )z2Return the status of missing dependencies (if any)rx   )r   r   rq   )re   r<   r|   rT   r~   r   )missing_depsrg   s     rO   missing_dependenciesr     si    L" , ,
?h&&z/?/?/A/A&
+++ <8888rrU   c                      t           D ]]} |                     dd          rEt          | d         | d         | d         | d         |                     dt                               ^d S )	Nr   Tr   r   r   r   r<   )r<   )DESCRIPTIONSgetrh   ra   )r   s    rO   declare_dependenciesr     sv     1 1779d## 	1IN 3J%7!8WWVY//1 1 1 11 1rU   )Nr`   osos.pathpathospsysspyder.config.baser   r   r   r   spyder.utilsr   dirnameabspath__file__HEREra   r|   r}   APPLAUNCHSERVICES_REQVERATOMICWRITES_REQVERCHARDET_REQVERCLOUDPICKLE_REQVERCOOKIECUTTER_REQVERDIFF_MATCH_PATCH_REQVERINTERVALTREE_REQVERIPYTHON_REQVERJEDI_REQVERJELLYFISH_REQVERJSONSCHEMA_REQVERKEYRING_REQVERNBCONVERT_REQVERNUMPYDOC_REQVERPARAMIKO_REQVERPARSO_REQVERPEXPECT_REQVERPICKLESHARE_REQVERPSUTIL_REQVERPYGMENTS_REQVERPYLINT_REQVERPYLINT_VENV_REQVERPYLSP_REQVERPYLSP_BLACK_REQVERPYLS_SPYDER_REQVERPYXDG_REQVERPYZMQ_REQVERQDARKSTYLE_REQVERQSTYLIZER_REQVERQTAWESOME_REQVERQTCONSOLE_REQVERQTPY_REQVERRTREE_REQVERSETUPTOOLS_REQVERSPHINX_REQVERSPYDER_KERNELS_REQVERTEXTDISTANCE_REQVERTHREE_MERGE_REQVERWATCHDOG_REQVERCYTHON_REQVERMATPLOTLIB_REQVERNUMPY_REQVERPANDAS_REQVERSCIPY_REQVERSYMPY_REQVERplatformr   
startswithr   objectrC   re   rh   rT   r   r   r   r   rb   rU   rO   <module>r      s+
   2 1 
			       



 P O O O O O O O O O O O ! ! ! ! ! !s{;3;x(())
 		 %    &  )jll9dd	 ;        $   #  (    %*,,6$$J  d#(CDD1(E1C1C1E1E-E	G Gd #566,. .d EFF') )d "FGG+- -d$ #@AA,. .%d, #'BCC02 2-d4 #9::,. .5d< ;<<') )=dD @AA$& &EdL  455)+ +MdT !788*, ,Ud\  % & &'	) )]df  ?@@)+ +gdn RSS(* *odv :;;(4	! !wd@  ( ) )%	' 'AdJ ABB') )KdR "?@@+- -SdZ @AA&( ([db NOO(* *cdj )**&( (kdr " # $ $+	- -sd| (?@@%' '}dD '   +	- -EdN "<==+- -OdV 122%''00	2 2Wd` BCC%' 'adh !899*, ,idp  -..)+ +qdx  NOO)+ +yd@  9::)+ +AdH >??$& &IdP 9::%' 'QdX !.//*, ,Yd` YZZ&( (adh !%;<<.0 0idp #677,. .qdx "DEE+- -yd@ >??(* *AdP <==&	 
 !:;;*	 
 \]]%	 
 QRR&	 
 KLL%	 
 @AA%	 5 JC C C C C C C CL  Y: : : :$> > > bj $ $ $ $N
 
 
1 1 1 1 1rU   