3
Êb_{  ã               @   s‚   d dl Zd dlZd dlZd dlZdddddddd	d
ddddddddddddddddœZejedœdd„Zd#eee	ed œd!d"„Z
dS )$é    Nz4.6.0z1.2.1z0.3.2z0.2.2z3.8.0z2.2.2z2.6.2z1.3.0z2.5.7z0.8.0z0.13.0z3.4.2z5.0.1z1.0.6z0.3.0z0.19.0z1.1.4z0.8.3z0.8.2z1.1.0z1.2.0z0.9.8z0.46.0)Zbs4Z
bottleneckZfastparquetZgcsfsz
lxml.etreeZ
matplotlibZnumexprZodfpyZopenpyxlZ
pandas_gbqZpyarrowZpytablesZpytestZpyxlsbZs3fsZscipyZ
sqlalchemyZtablesÚtabulateZxarrayZxlrdZxlwtZ
xlsxwriterZnumba)ÚmoduleÚreturnc             C   s<   t | dd ƒ}|d kr t | dd ƒ}|d kr8td| j› �ƒ‚|S )NÚ__version__Z__VERSION__zCan't determine version for )ÚgetattrÚImportErrorÚ__name__)r   Úversion© r
   ú9/tmp/pip-build-jkwsxyiy/pandas/pandas/compat/_optional.pyÚ_get_version$   s    r   Ú TÚraise)ÚnameÚextraÚraise_on_missingÚ
on_versionc             C   sÆ   d| › d|› d| › d�}yt j| ƒ}W n( tk
rN   |rFt|ƒd‚ndS Y nX tj| ƒ}|rÂt|ƒ}tjj|ƒ|k rÂ|dks‚t	‚d	|› d
| › d|› d�}|dkr²t
j|tƒ dS |dkrÂt|ƒ‚|S )a  
    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. This should be top-level only, so that the
        version may be checked.
    extra : str
        Additional text to include in the ImportError message.
    raise_on_missing : bool, default True
        Whether to raise if the optional dependency is not found.
        When False and the module is not present, None is returned.
    on_version : str {'raise', 'warn'}
        What to do when a dependency's version is too old.

        * raise : Raise an ImportError
        * warn : Warn that the version is too old. Returns None
        * ignore: Return the module, even if the version is too old.
          It's expected that users validate the version locally when
          using ``on_version="ignore"`` (see. ``io/html.py``)

    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 `raise_on_missing`
        is False, or when the package's version is too old and `on_version`
        is ``'warn'``.
    zMissing optional dependency 'z'. z Use pip or conda to install Ú.NÚwarnr   ÚignorezPandas requires version 'z' or newer of 'z' (version 'z' currently installed).>   r   r   r   )Ú	importlibÚimport_moduler   ÚVERSIONSÚgetr   Ú	distutilsr	   ZLooseVersionÚAssertionErrorÚwarningsr   ÚUserWarning)r   r   r   r   Úmsgr   Zminimum_versionr	   r
   r
   r   Úimport_optional_dependency/   s&    &

r   )r   Tr   )Zdistutils.versionr   r   Útypesr   r   Ú
ModuleTypeÚstrr   Úboolr   r
   r
   r
   r   Ú<module>   s:   