def maybe_get_pkg_resources():
    """
    Return the pkg_resources module or None, depending on whether we think that whatever
    the system has available is going to do an ok job at parsing requirements patterns.
    We don't want to strictly require any particular version of setuptools to not force
    the user to mess with their system.
    """
    try:
        import pkg_resources
        try:
            pkg_resources.Requirement.parse(
                'foo[bar]==2.0;python_version>"2.7"')
        except (ValueError, AttributeError):
            return None
        else:
            return pkg_resources
    except ImportError:
        return None
