3
®y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dœZ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.7.4z0.3.2z0.6.0z3.8.0z2.2.2z2.6.2z1.3.0z2.5.7z0.12.0z0.13.0z3.4.3z5.0.1z1.0.6z0.4.0z1.2.0z1.1.4z0.8.3z0.8.2z1.1.0z0.9.8z0.46.0)Úbs4Ú
bottleneckZfsspecZfastparquetZgcsfsz
lxml.etreeZ
matplotlibZnumexprÚodfpyZopenpyxlÚ
pandas_gbqZpyarrowZpytablesZpytestZpyxlsbZs3fsZscipyÚ
sqlalchemyÚtablesÚtabulateZxarrayZxlrdZxlwtZ
xlsxwriterZnumbaZbeautifulsoup4Z
BottleneckÚlxmlr   z
pandas-gbqZ
SQLAlchemyZJinja2)r   r   z
lxml.etreeZodfr   r   Zjinja2)Ú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   ú;/tmp/pip-install-4cy230dp/pandas/pandas/compat/_optional.pyÚ_get_version2   s    r   Ú TÚraise)ÚnameÚextraÚraise_on_missingÚ
on_versionc       
      C   sà   t j| ƒ}|dk	r|n| }d|› d|› d|› d�}ytj| ƒ}W n( tk
rh   |r`t|ƒ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'``.
    NzMissing optional dependency 'z'. z Use pip or conda to install Ú.Úwarnr   ÚignorezPandas requires version 'z' or newer of 'z' (version 'z' currently installed).>   r   r   r   )ÚINSTALL_MAPPINGÚgetÚ	importlibÚimport_moduler   ÚVERSIONSr   Ú	distutilsr   ZLooseVersionÚAssertionErrorÚwarningsr   ÚUserWarning)
r   r   r   r   Úpackage_nameZinstall_nameÚmsgr
   Zminimum_versionr   r   r   r   Úimport_optional_dependency=   s*    &


r(   )r   Tr   )Zdistutils.versionr"   r   Útypesr$   r!   r   Ú
ModuleTypeÚstrr   Úboolr(   r   r   r   r   Ú<module>   sJ   