3

Q'íc ã@s~ddlmZddlmZddlZddlZddlmZddlmZddl	m
Z
ddlmZej
eƒZdd	„Zd
d„Zdd
„ZdS)é)Úabsolute_import)Ú
FeedParserN)Ú
specifiers)Úversion)Ú
pkg_resources)Ú
exceptionscCs>|dkrdStj|ƒ}tjdjtttjdd…ƒƒƒ}||kS)aG
    Check if the python version in use match the `requires_python` specifier.

    Returns `True` if the version of python in use matches the requirement.
    Returns `False` if the version of python in use does not matches the
    requirement.

    Raises an InvalidSpecifier if `requires_python` have an invalid format.
    NTÚ.é)	rÚSpecifierSetrÚparseÚjoinÚmapÚstrÚsysÚversion_info)Úrequires_pythonÚrequires_python_specifierÚpython_version©rú2/tmp/pip-build-l_bcah40/pip/pip/utils/packaging.pyÚcheck_requires_pythons


 rcCs8t|tjƒr |jdƒr |jdƒS|jdƒr4|jdƒSdS)NÚMETADATAzPKG-INFO)Ú
isinstancerÚDistInfoDistributionÚhas_metadataÚget_metadata)Údistrrrr%s



rcCs t|ƒ}tƒ}|j|ƒ|jƒ}|jdƒ}y8t|ƒs`tjd|j|dj	t
ttj
dd…ƒƒfƒ‚Wn8tjk
rš}ztjd|j||fƒdSd}~XnXdS)NzRequires-Pythonz4%s requires Python '%s' but the running Python is %srr	z7Package %s has an invalid Requires-Python entry %s - %s)rrÚfeedÚcloseÚgetrrÚUnsupportedPythonVersionÚproject_namerr
rrrrÚInvalidSpecifierÚloggerÚwarning)rÚmetadataÚfeed_parserÚ
pkg_info_dictrÚerrrÚcheck_dist_requires_python-s"

$r))Ú
__future__rÚemail.parserrÚloggingrZpip._vendor.packagingrrÚpip._vendorrÚpiprÚ	getLoggerÚ__name__r#rrr)rrrrÚ<module>s