
    bi              
         d dl mZ d dlZd dlZd dlZd dlZd dlmZ ej                  dk\  rd dl	m
Z nd dlZd dlmZ  edj                   eeej                  dd                   Zej$                  dk(  Zej$                  d	k(  Zej$                  d
k(  Zej$                  dk(  ZddZdddddddZdddZddZ	 	 ddd	 	 	 	 	 	 	 	 	 ddZy)    )annotationsN)Literal)      )Version.r   
emscriptenlinuxdarwinwin32c                f    t        j                  dt        d       t        j                  |       S )Nz`dask._compatibility.entry_points` has been replaced by `importlib_metadata.entry_points` and will be removed in a future version. Please use `importlib_metadata.entry_points` instead.   )
stacklevelgroup)warningswarnDeprecationWarningimportlib_metadataentry_pointsr   s    N/home/cdr/jupyterlab/.venv/lib/python3.12/site-packages/dask/_compatibility.pyr   r      s-    MM	U	 **77    z1.21.0z2.0.0z3.1.0z2.10.3z14.0.1z4.3.2)numpypandasbokehjinja2pyarrowlz4
SQLAlchemypytables)
sqlalchemytablesc                    t        | dd       }|t        d| j                         | j                  dk(  r|j                         d   }|S )N__version__zCan't determine version for psycopg2r   )getattrImportError__name__split)moduleversions     r   get_versionr,   4   sN    fmT2G88IJKK*$--/!$Nr   raise)errorsc               4   |dv sJ t         j                  |       }||n| }d| d| d| d}	 t        j                  |       }| j                  d      d   }	|	| k7  r|	}t        j                  |   }
n|}
||nt        j                  |	      }|rat        |
      }|rTt        |      t        |      k  r=d	| d
|	 d| d}|dk(  rt        j                  |t               y|dk(  rt	        |      y|S # t        $ r}|dk(  rt	        |      |Y d}~yd}~ww xY w)aI  
    Import an optional dependency.

    By default, if a dependency is missing an ImportError with a nice
    message will be raised. If a dependency is present, but too old,
    we raise.

    Parameters
    ----------
    name : str
        The module name.
    extra : str
        Additional text to include in the ImportError message.
    errors : str {'raise', 'warn', 'ignore'}
        What to do when a dependency is not found or its version is too old.

        * raise : Raise an ImportError
        * warn : Only applicable when a module's version is to old.
          Warns that the version is too old and returns None
        * ignore: If the module is not installed, return None, otherwise,
          return the module, even if the version is too old.
          It's expected that users validate the version locally when
          using ``errors="ignore"`` (see. ``io/html.py``)
    min_version : str, default None
        Specify a minimum version that is different from the global pandas
        minimum version required.
    Returns
    -------
    maybe_module : Optional[ModuleType]
        The imported module, when found and the version is correct.
        None is returned when the package is not found and `errors`
        is False, or when the package's version is too old and `errors`
        is ``'warn'`` or ``'ignore'``.
    >   r   r-   ignoreNzMissing optional dependency 'z'. z Use pip or conda to install r   r-   r   zDask requires version 'z' or newer of 'z' (version 'z' currently installed).r   )INSTALL_MAPPINGget	importlibimport_moduler'   r)   sysmodulesVERSIONSr,   r   r   r   UserWarning)nameextramin_versionr.   package_nameinstall_namemsgr*   errparentmodule_to_getminimum_versionr+   s                r   import_optional_dependencyrC   ?   sZ   R 0000"&&t,L#/#;<L (~S @''3nA	7 ((. ZZ_QF~L1%0%<k(,,vBVOm,ww''/*BB)/):/& R$I%<>  c;/7"!#&&M9  Wc"+s   C3 3	D<DD)N)r*   ztypes.ModuleTypereturnstr) N)
r9   rE   r:   rE   r;   z
str | Noner.   z"Literal['raise', 'warn', 'ignore']rD   ztypes.ModuleType | None)
__future__r   r3   r5   typesr   typingr   version_infoimportlib.metadatametadatar   packaging.versionr   joinmaprE   
PY_VERSIONplatform
EMSCRIPTENLINUXMACOSWINDOWSr   r7   r1   r,   rC    r   r   <module>rW      s   "  
   w3 %SXXc#s'7'7';<=>
\\\)
 
,,'
!8   "P
 29P
PP P
 /P Pr   