U
    xž^n  ã                   @   s,   d dl Z d dlZdd„ Zdd„ Zdd„ ZdS )é    Nc                 C   s2   |   d¡}|ddg  dd… }tdd„ |D ƒƒS )z¼
        Take a string version and conver it to a tuple (for easier comparison), e.g.:

            "1.2.3" --> (1, 2, 3)
            "1.2" --> (1, 2, 0)
            "1" --> (1, 0, 0)
    Ú.é   Ú0Nc                 s   s   | ]}t |ƒV  qd S )N)Úint)Ú.0Úx© r   úD/tmp/pip-install-dq5v43_d/flask-sqlalchemy/flask_sqlalchemy/utils.pyÚ	<genexpr>   s     z parse_version.<locals>.<genexpr>)ÚsplitÚtuple)ÚvÚpartsr   r   r	   Úparse_version   s    
r   c                 C   sp   t tjƒ}t |ƒ}| dks(td | ¡ƒ‚| dkr8||k S | dkrH||kS | dkrX||kS | dkrh||kS ||kS )N)ú<ú>ú<=ú>=z==zop {} not supportedr   r   r   r   )r   Ú
sqlalchemyÚ__version__ÚAssertionErrorÚformat)ÚopÚvalZsa_verZ
target_verr   r   r	   Úsqlalchemy_version   s    
r   c                 C   s&   | | d k	r"t  d |||¡t¡ d S )NzpThe `{}` config option is deprecated and will be removed in v{}.  Use `SQLALCHEMY_ENGINE_OPTIONS['{}']` instead.)ÚwarningsÚwarnr   ÚDeprecationWarning)ÚconfigÚversionZdeprecated_config_keyZengine_optionr   r   r	   Úengine_config_warning&   s      þür    )r   r   r   r   r    r   r   r   r	   Ú<module>   s   