
    JeA                        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ej"                  dd dk(  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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$Z0d%Z1d&Z2d'Z3d(Z4d)Z5d*Z6d+Z7d,Z8d-Z9d.Z:d/Z; e       rdnd0Z<d1Z=d2Z>d3Z?d4Z@d5ZAd6ZBg d7d7 ed8      eej                  d9k(  xr  e
        d:d;d; ed<      ed=d>d> ed?      ed=d@d@ edA      ed=dBdB edC      ed=dDdE edF      ed=dGdG edH      ed=dIdI edJ      ed=dKdK edL      ed=dMdM edN      ed=dOdO edP      e d=dQdQ edR      e!d=dSdS edT      e"d=dUdU edV      e#d=dWdW edX      e$ej                  dYk(  d:dZdZ ed[      e%d=d\d\ ed]      e&d=d^d^ ed_      e'd=d`d` eda      e(d=dbdb edc      e)d=dddd ede      e*d=dfdg edh      e+d=didj edk      e,d=dldm edn      e-d=dodp edq      e.d=drds edt      e/ej                  j                  du      d:dvdw edx      e0d=dydy edz      e1d=d{d{ ed|      e2d=d}d} ed~      e3d=dd 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=dd ed      e;d=dd ed      e<d=ZFeFdd 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      eAeddd ed      eBedgz  ZF G d deG      ZHg aIdefdZJd ZKt        ej                  fdZMd ZNd ZOy)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>=8.12.2,<8.13.0z>=8.13.0,<9.0.0,!=8.17.1z>=0.17.2,<0.20.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.1z>=1.10.0,<1.11.0z>=2.0.0,<3.0.0z>=0.4.0z>=0.26z>=22.1.0z>=3.2.0,<3.3.0z>=0.2.2z>=1.2.1z>=5.5.1,<5.6.0z>=2.1.0z>=0.9.7z>=49.6.0z>=0.6.6z>=2.5.0,<2.6.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                   6    e Zd ZdZdZdZdefdZd Zd Z	d Z
y)	
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                 d   || _         || _        || _        || _        || _        | j                  j                  dd      | _        |M	 t        j                  |      | _	        | j                  s%t        j                  | j                        | _	        y y || _	        y # t        $ r
 d | _	        Y y w xY w)N-r   )r   r   r   r   r?   replacedistribution_namer   get_module_versioninstalled_versionget_package_version	Exception)selfr   r   r   r   rN   r?   s          5/usr/lib/python3/dist-packages/spyder/dependencies.py__init__zDependency.__init__9  s    (  0	 "&!2!2!:!:3!D$.)1)D)DW)M&-- .6-I-I...0D*	 . &7D"  . *.&	.s   A
B B/.B/c                     | j                   r8t        j                  | j                  | j                   | j                        }|S y)z Check if dependency is installed)rL   T)r   r   is_module_installedr   rL   )rQ   	installeds     rR   checkzDependency.checkZ  s?       44%%"&"8"8I
     c                     | j                         r| j                  d| j                  dS | j                  d| j                  dS )!Return dependency status (string)z ())rW   rN   rG   rH   rQ   s    rR   get_installed_versionz Dependency.get_installed_versionf  s5    ::< $ 6 6@@ $ 6 6AArX   c                 R    | j                         r| j                  S | j                  S )rZ   )rW   rG   rH   r\   s    rR   
get_statuszDependency.get_statusm  s    ::<77N88OrX   )__name__
__module____qualname____doc__rG   rH   	MANDATORYrS   rW   r]   r_    rX   rR   rF   rF   /  s1    H 
B
C $(i7B
BrX   rF   c           	          t         D ].  }t               rd| v r|j                  | k(  s"t        d|         t         t	        | |||||      gz  a y)zAdd Spyder dependencyspyder_boilerplatez(Dependency has already been registered: N)DEPENDENCIESr   r   
ValueErrorrF   )r   r   r   r   rN   r?   
dependencys          rR   addrk   x  sr     # F
?3w>(:7)DF FF Zx 0 149 : :LrX   c                 v    t         D ]#  }|j                  | k(  s|j                         c S  t        d| z        )z)Check if required dependency is installedzUnknown dependency %s)rh   r   rW   RuntimeError)r   rj   s     rR   rW   rW     sA    " >
(##%%> 2W<==rX   c                 d   d}g }| D ]  }|j                   }|j                  |d|j                  z   z  }t        |t        |      g      }t        dt
        dt        di}t        t
        t        d}|j                  ||j                     ||j                         g        |dz  }d	}d
}	t        |d       D ]k  \  }
}}|
|	k7  rE|
   }|t        k(  r|d|j                          d| z  }n|| d|j                          d| z  }|
}	||j                  |       d| | z  }m |dk(  s|dd }|S )z Return a status of dependencies.r   N 012)rp   rq   rr       z-1c                 4    | d   | d   j                         z   S )Nr   rs   )lower)xs    rR   <lambda>zstatus.<locals>.<lambda>  s    !qtzz| 3 rX   )keyz# :z:  <br>)r   r   maxlenrd   OPTIONALPLUGINappendr?   r]   sorted
capitalizeljust)depslinesepmaxwidthdatadeptitle	dep_order	order_deptext
prev_orderorderversionnames                rR   statusr     su   HD  O+S3////E#e*-.XsFC@	#(@	Ysxx(%1J1J1LMNO MHDJ!'3"5 
@ugJU#Dy "T__./q	::7)2doo&7%8'CCJ5;;x()WIgY??
@ fCRyKrX   c                      g } t         D ]8  }|j                  t        k7  s|j                         r(| j	                  |       : | rt        | d      S y)z2Return the status of missing dependencies (if any)r{   )r   r   rt   )rh   r?   r   rW   r   r   )missing_depsrj   s     rR   missing_dependenciesr     sP    L" ,
??h&z/?/?/A
+, <88rX   c                      t         D ]E  } | j                  dd      st        | d   | d   | d   | d   | j                  dt                     G y )	Nr   Tr   r   r   r   r?   )r?   )DESCRIPTIONSgetrk   rd   )r   s    rR   declare_dependenciesr     sQ     1779d#IN 3J%7!8WWVY/11rX   )Prc   osos.pathpathospsysspyder.config.baser   r   r   r   spyder.utilsr   dirnameabspath__file__HEREversion_infoPY38rd   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   objectrF   rh   rk   rW   r   r   r   r   re   rX   rR   <module>r      s   2 
  
 P O ! s{{;3;;x() v% 		 %    &  )ld	 '+#1K      !%  $   #  (    %,$J  d#(CD1(E1C1E-E	Gd #56,.d EF')d "FG+-d$ #@A,.%d, #'BC02-d4 #9:,.5d< ;<')=dD @A$&EdL  45)+MdT !78*,Ud\  % &'	)]df  ?@)+gdn RS(*odv :;(4	!wd@  ( )%	'AdJ AB')KdR "?@+-SdZ @A&([db NO(*cdj )*&(kdr " # $+	-sd| (?@%'}dD '  +	-EdN "<=+-OdV 12%''0	2Wd` BC%'adh !89*,idp  -.)+qdx  NO)+yd@  9:)+AdH >?$&IdP 9:%'QdX !./*,Yd` YZ&(adh !%;<.0idp #67,.qdx "DE+-yd@ >?(*AdP <=&	
 !:;*	
 \]%	
 QR&	
 KL%	
 @A%	5 JC CL  Y:$> bjj $N
1rX   