# -*- coding=utf-8 -*- from __future__ import absolute_import, unicode_literals import packaging.specifiers import packaging.version import requirementslib from ._pip import find_installation_candidates, get_vcs_ref def _filter_matching_python_requirement(candidates, required_python): # TODO: This should also takes the parent's python_version and # python_full_version markers, and only return matches with valid # intersections. For example, if parent requires `python_version >= '3.0'`, # this should not return entries with "Requires-Python: <3". for c in candidates: try: requires_python = c.requires_python except AttributeError: requires_python = c.location.requires_python if required_python and requires_python: # Old specifications had people setting this to single digits # which is effectively the same as '>=digit,