ôY ã@s¯ddlmZddlmZddlZddlZddlmZddlmZddl m Z ddl m Z ej eƒZdd „Zd d „Zd d „ZdS)é)Úabsolute_import)Ú FeedParserN)Ú specifiers)Úversion)Ú pkg_resources)Ú exceptionscCsW|dkrdStj|ƒ}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-3puug3g5/pip/pip/utils/packaging.pyÚcheck_requires_pythons .rcCsNt|tjƒr.|jdƒr.|jdƒS|jdƒrJ|jdƒSdS)NÚMETADATAzPKG-INFO)Ú isinstancerÚDistInfoDistributionÚ has_metadataÚ get_metadata)Údistrrrr%s  rcCsÛt|ƒ}tƒ}|j|ƒ|jƒ}|jdƒ}yNt|ƒsŠtjd|j|dj t t t j dd…ƒƒfƒ‚WnItjk rÖ}z&tjd|j||fƒdSWYdd}~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"     0r))Ú __future__rÚ email.parserrÚloggingrZpip._vendor.packagingrrÚ pip._vendorrÚpiprÚ getLoggerÚ__name__r#rrr)rrrrÚs